Skip to content

Commit 0c0aeaf

Browse files
committed
fix: Add KeyUsages for iOS App Attest
Maybe Apple added a keyusage within their attestation. We need to try on int.
1 parent 7cd57a2 commit 0c0aeaf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

model/oauth/ios.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,13 @@ func (obj *appleAttestationObject) setupAppleCertificates() (*x509.Certificate,
218218
intermediates.AddCert(cert)
219219
}
220220

221+
// App Attest credential certificates have a Key Usage for attestation that
222+
// doesn't match Go's default expectations (TLS). We must explicitly allow
223+
// any key usage to verify the chain.
221224
opts := x509.VerifyOptions{
222225
Roots: roots,
223226
Intermediates: intermediates,
227+
KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageAny},
224228
}
225229
credCert := certs[0]
226230
return credCert, &opts, nil

0 commit comments

Comments
 (0)