Skip to content

Commit 100deda

Browse files
carmenyhcopybara-github
authored andcommitted
Fix a bunch of misspellings and bad grammar.
PiperOrigin-RevId: 979828575
1 parent 2faf60e commit 100deda

11 files changed

Lines changed: 15 additions & 15 deletions

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Android Key Attestation root certificates are documented
100100

101101
## Getting Revoked Serials
102102

103-
It's important to check the revoked serials list to prevent allowing accepting
103+
It's important to check the revoked serials list to prevent accepting
104104
fraudulent attestations from known leaked keys. The revoked serials may be
105105
retrieved from https://android.googleapis.com/attestation/status. This list is
106106
updated relatively frequently so it's important to use a fresh copy of the

‎src/main/kotlin/ChallengeChecker.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface ChallengeChecker {
3131
/**
3232
* Checks the given [challenge] for validity.
3333
*
34-
* @return A ListenableFuture containing True if the challenge is valid, else false.
34+
* @return A ListenableFuture containing true if the challenge is valid, else false.
3535
*/
3636
fun checkChallenge(challenge: ByteString): ListenableFuture<Boolean>
3737
}

‎src/main/kotlin/ConstraintConfig.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ sealed class SecurityLevelConstraint(
266266

267267
/**
268268
* Checks that the keyMintSecurityLevel matches the security level claimed by the certificate.
269-
* this constraint may be used in conjunction with other security level constraints. e.g. it may
269+
* This constraint may be used in conjunction with other security level constraints. e.g. it may
270270
* be combined with [STRICT] to verify that the keyMintSecurityLevel is precisely
271271
* [SecurityLevel.STRONG_BOX] and that the security level matches the value claimed by the
272272
* Google-signed certificate.

‎src/main/kotlin/Verifier.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ constructor(
201201
* Verifies an Android Key Attestation certificate chain asynchronously.
202202
*
203203
* @param chain The attestation certificate chain to verify.
204-
* @param coroutineScope The coroutine scope to from which to run the verification.
204+
* @param coroutineScope The coroutine scope from which to run the verification.
205205
* @param challengeChecker The challenge checker to use for additional challenge validation.
206206
* @param log The log hook to use for logging.
207207
* @return A [ListenableFuture] containing the [VerificationResult].
@@ -285,7 +285,7 @@ constructor(
285285
inputLimits = constraintConfig.inputLimits,
286286
)
287287
) {
288-
// Should never happen since the extension's presence is checked by by validate().
288+
// Should never happen since the extension's presence is checked by validate().
289289
"Key attestation extension not found"
290290
}
291291
} catch (e: ExtensionParsingException) {

‎src/main/kotlin/VerifierCli.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import java.io.PrintStream
2121
import java.security.cert.X509Certificate
2222
import java.time.Instant
2323

24-
// Any chain shorter than this is not possibly valid Key Attestation chain.
24+
// Any chain shorter than this cannot possibly be a valid Key Attestation chain.
2525
private const val MIN_CERTS_IN_VALID_CHAIN = 3
2626

2727
class VerifierCli(private val output: PrintStream, private val instantSource: InstantSource) {

‎src/main/kotlin/provider/KeyAttestationCertPath.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class KeyAttestationCertPath(certs: List<X509Certificate>) : CertPath("X.509") {
9898
}
9999

100100
/*
101-
* The security level of the certitificate chain.
101+
* The security level of the certificate chain.
102102
*
103103
* This should match the attestation security level in the key description.
104104
*/

‎src/main/kotlin/provider/KeyAttestationCertPathValidator.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import javax.security.auth.x500.X500Principal
4545
* A [CertPathValidatorSpi] for verifying Android Key Attestation certificate chains.
4646
*
4747
* Older Android devices produce Key Attestation certificate chains that do not fully conform to RFC
48-
* 5280 and thus cannot be validating using [sun.security.provider.certpath.PKIXCertPathValidator].
48+
* 5280 and thus cannot be validated using [sun.security.provider.certpath.PKIXCertPathValidator].
4949
* This provider implements a more permissive [CertPathValidatorSpi] implementation that is able to
5050
* validate these chains.
5151
*
@@ -334,7 +334,7 @@ private class BasicChecker(
334334
// TODO(google-internal bug): Add support for ATTEST_KEY chains.
335335
if (cert.hasAttestationExtension()) {
336336
throw CertPathValidatorException(
337-
"Only the target certificate should contain an attestation extension, attestation extenion found in ${step}",
337+
"Only the target certificate should contain an attestation extension, attestation extension found in ${step}",
338338
/* cause = */ null,
339339
certPath,
340340
/* index = */ remainingCerts,

‎src/main/kotlin/provider/KeyAttestationProvider.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import java.security.Provider
2020
import java.security.ProviderException
2121

2222
/**
23-
* A JCA provider for verifying Android Key Attestation certificates chains.
23+
* A JCA provider for verifying Android Key Attestation certificate chains.
2424
*
2525
* https://docs.oracle.com/en/java/javase/21/security/howtoimplaprovider.html
2626
*/
@@ -33,7 +33,7 @@ class KeyAttestationProvider : Provider("KeyAttestation", 0.1, "Android Key Atte
3333
this,
3434
"CertPathValidator",
3535
"KeyAttestation",
36-
"com.google.wireless.android.security.attestationverifier.provider.KeyAttestationCertPathValidator",
36+
"com.android.keyattestation.verifier.provider.KeyAttestationCertPathValidator",
3737
)
3838
)
3939
}

‎src/main/kotlin/testing/Certs.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ object CertLists {
400400
val REVOKED_SERIAL_NUMBER_LONG_STRING = "c35747a084470c3135aeefe2b8d40cd6".toBigInteger(16)
401401
@JvmField val REVOKED_SERIAL_NUMBER_ODD_LENGTH = 1228286566665971148.toBigInteger()
402402

403-
/* A chain where the attesstation certificate has {@link REVOKED_SERIAL_NUMBER}. */
403+
/* A chain where the attestation certificate has {@link REVOKED_SERIAL_NUMBER}. */
404404
@JvmStatic
405405
val revoked by lazy {
406406
listOf(

‎src/main/kotlin/testing/KeyAttestationCertFactory.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder
4747

4848
internal class KeyAttestationCertFactory(
4949
val fakeCalendar: FakeCalendar = FakeCalendar.DEFAULT,
50-
val hardodedRootKey: KeyPair? = null,
50+
val hardcodedRootKey: KeyPair? = null,
5151
val hardcodedRoot: X509Certificate? = null,
5252
) {
5353
private val ecKeyPairGenerator =
@@ -64,7 +64,7 @@ internal class KeyAttestationCertFactory(
6464

6565
internal fun generateRsaKeyPair() = rsaKeyPairGenerator.generateKeyPair()
6666

67-
val rootKey = hardodedRootKey ?: ecKeyPairGenerator.generateKeyPair()
67+
val rootKey = hardcodedRootKey ?: ecKeyPairGenerator.generateKeyPair()
6868
val intermediateKey = ecKeyPairGenerator.generateKeyPair()
6969
val rkpKey = ecKeyPairGenerator.generateKeyPair()
7070
val attestationKey = ecKeyPairGenerator.generateKeyPair()

0 commit comments

Comments
 (0)