[DEPRECATED] WebAuthn/FIDO2: Verifying Apple Anonymous Attestation
!!! THIS ATTESTATION BEEN DEPRECATED AND NO LONGED NEED TO BE SUPPORTED !!!
Please note that this is an advance post, and requires prior understanding of the FIDO2 attestations. You can read more about them here.
The apple does not fall far from the Packed… TPM…

As the proverb goes, it’s all almost exactly the same as Packed attestation, with the nonce in the attestation certificate… like TPM… Without further ado, let’s verify it, shall we?
If you check attStmt and it contains “x5c” it is a FULL attestation. FULL basically means that it is an attestation that chains to the manufacturer. It is signed by batch private key, who’s public key is in a batch certificate, that is chained to apple attestation root certificate. Generally certificates have authorityInfoAccess extension, that helps locate the root, but Apple decided to not to do that. Nevertheless, quick googling gave us the needed root certificate
https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem
Verifying attestation
- Concatenate authData with clientDataHash to create nonceBase
- Hash nonceBase with SHA-256 to create expectedNonce
- Extract leaf(first) cert from “x5c” as attCert and decode it
- Check that attCert is of version 3(ASN1 INT 2)
- Check that attCert basic constraints for CA is set to FALSE
- Check that certificate contains AppleAnonymousAttestation OID 1.2.840.113635.100.8.2 extension
- Decode AppleAnonymousAttestation extension, and check that nonce contains expectedNonce
Apple has not yet publish schema for the extension(as of JAN 2021. Yes, human kind survived somehow), so instead here is me publishing it :

