@simplewebauthn/server 10.0.0 → 11.0.0-alpha3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/esm/authentication/generateAuthenticationOptions.d.ts +2 -1
- package/esm/authentication/generateAuthenticationOptions.d.ts.map +1 -0
- package/esm/authentication/verifyAuthenticationResponse.d.ts +4 -3
- package/esm/authentication/verifyAuthenticationResponse.d.ts.map +1 -0
- package/esm/authentication/verifyAuthenticationResponse.js +7 -7
- package/esm/helpers/convertAAGUIDToString.d.ts +1 -0
- package/esm/helpers/convertAAGUIDToString.d.ts.map +1 -0
- package/esm/helpers/convertAAGUIDToString.js +4 -4
- package/esm/helpers/convertCOSEtoPKCS.d.ts +1 -0
- package/esm/helpers/convertCOSEtoPKCS.d.ts.map +1 -0
- package/esm/helpers/convertCertBufferToPEM.d.ts +2 -1
- package/esm/helpers/convertCertBufferToPEM.d.ts.map +1 -0
- package/esm/helpers/convertPEMToBytes.d.ts +1 -0
- package/esm/helpers/convertPEMToBytes.d.ts.map +1 -0
- package/esm/helpers/convertX509PublicKeyToCOSE.d.ts +1 -0
- package/esm/helpers/convertX509PublicKeyToCOSE.d.ts.map +1 -0
- package/esm/helpers/convertX509PublicKeyToCOSE.js +4 -1
- package/esm/helpers/cose.d.ts +1 -0
- package/esm/helpers/cose.d.ts.map +1 -0
- package/esm/helpers/decodeAttestationObject.d.ts +1 -0
- package/esm/helpers/decodeAttestationObject.d.ts.map +1 -0
- package/esm/helpers/decodeAuthenticatorExtensions.d.ts +5 -14
- package/esm/helpers/decodeAuthenticatorExtensions.d.ts.map +1 -0
- package/esm/helpers/decodeClientDataJSON.d.ts +2 -1
- package/esm/helpers/decodeClientDataJSON.d.ts.map +1 -0
- package/esm/helpers/decodeCredentialPublicKey.d.ts +1 -0
- package/esm/helpers/decodeCredentialPublicKey.d.ts.map +1 -0
- package/esm/helpers/fetch.d.ts +1 -0
- package/esm/helpers/fetch.d.ts.map +1 -0
- package/esm/helpers/fetch.js +1 -1
- package/esm/helpers/generateChallenge.d.ts +1 -0
- package/esm/helpers/generateChallenge.d.ts.map +1 -0
- package/esm/helpers/generateUserID.d.ts +1 -0
- package/esm/helpers/generateUserID.d.ts.map +1 -0
- package/esm/helpers/getCertificateInfo.d.ts +2 -1
- package/esm/helpers/getCertificateInfo.d.ts.map +1 -0
- package/esm/helpers/getCertificateInfo.js +2 -1
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.d.ts.map +1 -0
- package/esm/helpers/isCertRevoked.d.ts +2 -1
- package/esm/helpers/isCertRevoked.d.ts.map +1 -0
- package/esm/helpers/isCertRevoked.js +2 -1
- package/esm/helpers/iso/index.d.ts +1 -0
- package/esm/helpers/iso/index.d.ts.map +1 -0
- package/esm/helpers/iso/isoBase64URL.d.ts +2 -1
- package/esm/helpers/iso/isoBase64URL.d.ts.map +1 -0
- package/esm/helpers/iso/isoBase64URL.js +1 -1
- package/esm/helpers/iso/isoCBOR.d.ts +2 -1
- package/esm/helpers/iso/isoCBOR.d.ts.map +1 -0
- package/esm/helpers/iso/isoCBOR.js +1 -1
- package/esm/helpers/iso/isoCrypto/digest.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/digest.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/getRandomValues.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/getRandomValues.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts +2 -1
- package/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/importKey.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/importKey.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/index.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/index.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/structs.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/structs.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts +3 -1
- package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js +60 -17
- package/esm/helpers/iso/isoCrypto/verify.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/verify.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/verify.js +6 -2
- package/esm/helpers/iso/isoCrypto/verifyEC2.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/verifyEC2.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/verifyOKP.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/verifyOKP.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/verifyRSA.d.ts +1 -0
- package/esm/helpers/iso/isoCrypto/verifyRSA.d.ts.map +1 -0
- package/esm/helpers/iso/isoUint8Array.d.ts +1 -0
- package/esm/helpers/iso/isoUint8Array.d.ts.map +1 -0
- package/esm/helpers/logging.d.ts +1 -0
- package/esm/helpers/logging.d.ts.map +1 -0
- package/esm/helpers/logging.js +0 -1
- package/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts +1 -0
- package/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map +1 -0
- package/esm/helpers/matchExpectedRPID.d.ts +1 -0
- package/esm/helpers/matchExpectedRPID.d.ts.map +1 -0
- package/esm/helpers/parseAuthenticatorData.d.ts +1 -0
- package/esm/helpers/parseAuthenticatorData.d.ts.map +1 -0
- package/esm/helpers/parseAuthenticatorData.js +6 -6
- package/esm/helpers/parseBackupFlags.d.ts +2 -1
- package/esm/helpers/parseBackupFlags.d.ts.map +1 -0
- package/esm/helpers/toHash.d.ts +1 -0
- package/esm/helpers/toHash.d.ts.map +1 -0
- package/esm/helpers/validateCertificatePath.d.ts +1 -0
- package/esm/helpers/validateCertificatePath.d.ts.map +1 -0
- package/esm/helpers/validateCertificatePath.js +1 -1
- package/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts +7 -0
- package/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts.map +1 -0
- package/esm/helpers/validateExtFIDOGenCEAAGUID.js +34 -0
- package/esm/helpers/verifySignature.d.ts +1 -0
- package/esm/helpers/verifySignature.d.ts.map +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/metadata/mdsTypes.d.ts +2 -1
- package/esm/metadata/mdsTypes.d.ts.map +1 -0
- package/esm/metadata/parseJWT.d.ts +1 -0
- package/esm/metadata/parseJWT.d.ts.map +1 -0
- package/esm/metadata/verifyAttestationWithMetadata.d.ts +2 -1
- package/esm/metadata/verifyAttestationWithMetadata.d.ts.map +1 -0
- package/esm/metadata/verifyJWT.d.ts +1 -0
- package/esm/metadata/verifyJWT.d.ts.map +1 -0
- package/esm/registration/generateRegistrationOptions.d.ts +2 -1
- package/esm/registration/generateRegistrationOptions.d.ts.map +1 -0
- package/esm/registration/verifications/tpm/constants.d.ts +1 -0
- package/esm/registration/verifications/tpm/constants.d.ts.map +1 -0
- package/esm/registration/verifications/tpm/constants.js +8 -4
- package/esm/registration/verifications/tpm/parseCertInfo.d.ts +1 -0
- package/esm/registration/verifications/tpm/parseCertInfo.d.ts.map +1 -0
- package/esm/registration/verifications/tpm/parsePubArea.d.ts +1 -0
- package/esm/registration/verifications/tpm/parsePubArea.d.ts.map +1 -0
- package/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts +1 -0
- package/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts.map +1 -0
- package/esm/registration/verifications/tpm/verifyAttestationTPM.js +11 -3
- package/esm/registration/verifications/verifyAttestationAndroidKey.d.ts +1 -0
- package/esm/registration/verifications/verifyAttestationAndroidKey.d.ts.map +1 -0
- package/esm/registration/verifications/verifyAttestationAndroidKey.js +3 -1
- package/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts +1 -0
- package/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map +1 -0
- package/esm/registration/verifications/verifyAttestationApple.d.ts +1 -0
- package/esm/registration/verifications/verifyAttestationApple.d.ts.map +1 -0
- package/esm/registration/verifications/verifyAttestationApple.js +2 -1
- package/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts +1 -0
- package/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts.map +1 -0
- package/esm/registration/verifications/verifyAttestationPacked.d.ts +1 -0
- package/esm/registration/verifications/verifyAttestationPacked.d.ts.map +1 -0
- package/esm/registration/verifications/verifyAttestationPacked.js +10 -3
- package/esm/registration/verifyRegistrationResponse.d.ts +5 -4
- package/esm/registration/verifyRegistrationResponse.d.ts.map +1 -0
- package/esm/registration/verifyRegistrationResponse.js +11 -7
- package/esm/services/defaultRootCerts/android-key.d.ts +1 -0
- package/esm/services/defaultRootCerts/android-key.d.ts.map +1 -0
- package/esm/services/defaultRootCerts/android-safetynet.d.ts +1 -0
- package/esm/services/defaultRootCerts/android-safetynet.d.ts.map +1 -0
- package/esm/services/defaultRootCerts/apple.d.ts +1 -0
- package/esm/services/defaultRootCerts/apple.d.ts.map +1 -0
- package/esm/services/defaultRootCerts/mds.d.ts +1 -0
- package/esm/services/defaultRootCerts/mds.d.ts.map +1 -0
- package/esm/services/metadataService.d.ts +19 -4
- package/esm/services/metadataService.d.ts.map +1 -0
- package/esm/services/metadataService.js +8 -3
- package/esm/services/settingsService.d.ts +17 -14
- package/esm/services/settingsService.d.ts.map +1 -0
- package/esm/services/settingsService.js +14 -0
- package/package.json +29 -33
- package/script/authentication/generateAuthenticationOptions.d.ts +2 -1
- package/script/authentication/generateAuthenticationOptions.d.ts.map +1 -0
- package/script/authentication/generateAuthenticationOptions.js +1 -2
- package/script/authentication/verifyAuthenticationResponse.d.ts +4 -3
- package/script/authentication/verifyAuthenticationResponse.d.ts.map +1 -0
- package/script/authentication/verifyAuthenticationResponse.js +8 -9
- package/script/helpers/convertAAGUIDToString.d.ts +1 -0
- package/script/helpers/convertAAGUIDToString.d.ts.map +1 -0
- package/script/helpers/convertAAGUIDToString.js +5 -6
- package/script/helpers/convertCOSEtoPKCS.d.ts +1 -0
- package/script/helpers/convertCOSEtoPKCS.d.ts.map +1 -0
- package/script/helpers/convertCOSEtoPKCS.js +1 -2
- package/script/helpers/convertCertBufferToPEM.d.ts +2 -1
- package/script/helpers/convertCertBufferToPEM.d.ts.map +1 -0
- package/script/helpers/convertCertBufferToPEM.js +1 -2
- package/script/helpers/convertPEMToBytes.d.ts +1 -0
- package/script/helpers/convertPEMToBytes.d.ts.map +1 -0
- package/script/helpers/convertPEMToBytes.js +1 -2
- package/script/helpers/convertX509PublicKeyToCOSE.d.ts +1 -0
- package/script/helpers/convertX509PublicKeyToCOSE.d.ts.map +1 -0
- package/script/helpers/convertX509PublicKeyToCOSE.js +11 -9
- package/script/helpers/cose.d.ts +1 -0
- package/script/helpers/cose.d.ts.map +1 -0
- package/script/helpers/cose.js +11 -11
- package/script/helpers/decodeAttestationObject.d.ts +1 -0
- package/script/helpers/decodeAttestationObject.d.ts.map +1 -0
- package/script/helpers/decodeAttestationObject.js +2 -2
- package/script/helpers/decodeAuthenticatorExtensions.d.ts +5 -14
- package/script/helpers/decodeAuthenticatorExtensions.d.ts.map +1 -0
- package/script/helpers/decodeAuthenticatorExtensions.js +1 -2
- package/script/helpers/decodeClientDataJSON.d.ts +2 -1
- package/script/helpers/decodeClientDataJSON.d.ts.map +1 -0
- package/script/helpers/decodeClientDataJSON.js +2 -2
- package/script/helpers/decodeCredentialPublicKey.d.ts +1 -0
- package/script/helpers/decodeCredentialPublicKey.d.ts.map +1 -0
- package/script/helpers/decodeCredentialPublicKey.js +2 -2
- package/script/helpers/fetch.d.ts +1 -0
- package/script/helpers/fetch.d.ts.map +1 -0
- package/script/helpers/fetch.js +4 -4
- package/script/helpers/generateChallenge.d.ts +1 -0
- package/script/helpers/generateChallenge.d.ts.map +1 -0
- package/script/helpers/generateChallenge.js +2 -2
- package/script/helpers/generateUserID.d.ts +1 -0
- package/script/helpers/generateUserID.d.ts.map +1 -0
- package/script/helpers/generateUserID.js +2 -2
- package/script/helpers/getCertificateInfo.d.ts +2 -1
- package/script/helpers/getCertificateInfo.d.ts.map +1 -0
- package/script/helpers/getCertificateInfo.js +6 -6
- package/script/helpers/index.d.ts +1 -0
- package/script/helpers/index.d.ts.map +1 -0
- package/script/helpers/isCertRevoked.d.ts +2 -1
- package/script/helpers/isCertRevoked.d.ts.map +1 -0
- package/script/helpers/isCertRevoked.js +10 -10
- package/script/helpers/iso/index.d.ts +1 -0
- package/script/helpers/iso/index.d.ts.map +1 -0
- package/script/helpers/iso/isoBase64URL.d.ts +2 -1
- package/script/helpers/iso/isoBase64URL.d.ts.map +1 -0
- package/script/helpers/iso/isoBase64URL.js +20 -18
- package/script/helpers/iso/isoCBOR.d.ts +2 -1
- package/script/helpers/iso/isoCBOR.d.ts.map +1 -0
- package/script/helpers/iso/isoCBOR.js +28 -6
- package/script/helpers/iso/isoCrypto/digest.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/digest.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/digest.js +1 -2
- package/script/helpers/iso/isoCrypto/getRandomValues.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/getRandomValues.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/getRandomValues.js +1 -2
- package/script/helpers/iso/isoCrypto/getWebCrypto.d.ts +2 -1
- package/script/helpers/iso/isoCrypto/getWebCrypto.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/getWebCrypto.js +2 -2
- package/script/helpers/iso/isoCrypto/importKey.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/importKey.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/importKey.js +1 -2
- package/script/helpers/iso/isoCrypto/index.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/index.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js +1 -2
- package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js +1 -2
- package/script/helpers/iso/isoCrypto/structs.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/structs.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts +3 -1
- package/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/unwrapEC2Signature.js +62 -20
- package/script/helpers/iso/isoCrypto/verify.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/verify.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/verify.js +6 -3
- package/script/helpers/iso/isoCrypto/verifyEC2.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/verifyEC2.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/verifyEC2.js +1 -2
- package/script/helpers/iso/isoCrypto/verifyOKP.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/verifyOKP.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/verifyOKP.js +1 -2
- package/script/helpers/iso/isoCrypto/verifyRSA.d.ts +1 -0
- package/script/helpers/iso/isoCrypto/verifyRSA.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/verifyRSA.js +1 -2
- package/script/helpers/iso/isoUint8Array.d.ts +1 -0
- package/script/helpers/iso/isoUint8Array.d.ts.map +1 -0
- package/script/helpers/iso/isoUint8Array.js +8 -9
- package/script/helpers/logging.d.ts +1 -0
- package/script/helpers/logging.d.ts.map +1 -0
- package/script/helpers/logging.js +2 -4
- package/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts +1 -0
- package/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map +1 -0
- package/script/helpers/mapX509SignatureAlgToCOSEAlg.js +1 -2
- package/script/helpers/matchExpectedRPID.d.ts +1 -0
- package/script/helpers/matchExpectedRPID.d.ts.map +1 -0
- package/script/helpers/matchExpectedRPID.js +1 -2
- package/script/helpers/parseAuthenticatorData.d.ts +1 -0
- package/script/helpers/parseAuthenticatorData.d.ts.map +1 -0
- package/script/helpers/parseAuthenticatorData.js +8 -8
- package/script/helpers/parseBackupFlags.d.ts +2 -1
- package/script/helpers/parseBackupFlags.d.ts.map +1 -0
- package/script/helpers/parseBackupFlags.js +2 -2
- package/script/helpers/toHash.d.ts +1 -0
- package/script/helpers/toHash.d.ts.map +1 -0
- package/script/helpers/toHash.js +1 -2
- package/script/helpers/validateCertificatePath.d.ts +1 -0
- package/script/helpers/validateCertificatePath.d.ts.map +1 -0
- package/script/helpers/validateCertificatePath.js +3 -4
- package/script/helpers/validateExtFIDOGenCEAAGUID.d.ts +7 -0
- package/script/helpers/validateExtFIDOGenCEAAGUID.d.ts.map +1 -0
- package/script/helpers/validateExtFIDOGenCEAAGUID.js +37 -0
- package/script/helpers/verifySignature.d.ts +1 -0
- package/script/helpers/verifySignature.d.ts.map +1 -0
- package/script/helpers/verifySignature.js +2 -2
- package/script/index.d.ts +1 -0
- package/script/index.d.ts.map +1 -0
- package/script/metadata/mdsTypes.d.ts +2 -1
- package/script/metadata/mdsTypes.d.ts.map +1 -0
- package/script/metadata/parseJWT.d.ts +1 -0
- package/script/metadata/parseJWT.d.ts.map +1 -0
- package/script/metadata/parseJWT.js +1 -2
- package/script/metadata/verifyAttestationWithMetadata.d.ts +2 -1
- package/script/metadata/verifyAttestationWithMetadata.d.ts.map +1 -0
- package/script/metadata/verifyAttestationWithMetadata.js +2 -2
- package/script/metadata/verifyJWT.d.ts +1 -0
- package/script/metadata/verifyJWT.d.ts.map +1 -0
- package/script/metadata/verifyJWT.js +1 -2
- package/script/registration/generateRegistrationOptions.d.ts +2 -1
- package/script/registration/generateRegistrationOptions.d.ts.map +1 -0
- package/script/registration/generateRegistrationOptions.js +2 -2
- package/script/registration/verifications/tpm/constants.d.ts +1 -0
- package/script/registration/verifications/tpm/constants.d.ts.map +1 -0
- package/script/registration/verifications/tpm/constants.js +8 -4
- package/script/registration/verifications/tpm/parseCertInfo.d.ts +1 -0
- package/script/registration/verifications/tpm/parseCertInfo.d.ts.map +1 -0
- package/script/registration/verifications/tpm/parseCertInfo.js +1 -2
- package/script/registration/verifications/tpm/parsePubArea.d.ts +1 -0
- package/script/registration/verifications/tpm/parsePubArea.d.ts.map +1 -0
- package/script/registration/verifications/tpm/parsePubArea.js +1 -2
- package/script/registration/verifications/tpm/verifyAttestationTPM.d.ts +1 -0
- package/script/registration/verifications/tpm/verifyAttestationTPM.d.ts.map +1 -0
- package/script/registration/verifications/tpm/verifyAttestationTPM.js +17 -10
- package/script/registration/verifications/verifyAttestationAndroidKey.d.ts +1 -0
- package/script/registration/verifications/verifyAttestationAndroidKey.d.ts.map +1 -0
- package/script/registration/verifications/verifyAttestationAndroidKey.js +7 -6
- package/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts +1 -0
- package/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map +1 -0
- package/script/registration/verifications/verifyAttestationAndroidSafetyNet.js +1 -2
- package/script/registration/verifications/verifyAttestationApple.d.ts +1 -0
- package/script/registration/verifications/verifyAttestationApple.d.ts.map +1 -0
- package/script/registration/verifications/verifyAttestationApple.js +4 -4
- package/script/registration/verifications/verifyAttestationFIDOU2F.d.ts +1 -0
- package/script/registration/verifications/verifyAttestationFIDOU2F.d.ts.map +1 -0
- package/script/registration/verifications/verifyAttestationFIDOU2F.js +1 -2
- package/script/registration/verifications/verifyAttestationPacked.d.ts +1 -0
- package/script/registration/verifications/verifyAttestationPacked.d.ts.map +1 -0
- package/script/registration/verifications/verifyAttestationPacked.js +11 -5
- package/script/registration/verifyRegistrationResponse.d.ts +5 -4
- package/script/registration/verifyRegistrationResponse.d.ts.map +1 -0
- package/script/registration/verifyRegistrationResponse.js +12 -9
- package/script/services/defaultRootCerts/android-key.d.ts +1 -0
- package/script/services/defaultRootCerts/android-key.d.ts.map +1 -0
- package/script/services/defaultRootCerts/android-safetynet.d.ts +1 -0
- package/script/services/defaultRootCerts/android-safetynet.d.ts.map +1 -0
- package/script/services/defaultRootCerts/apple.d.ts +1 -0
- package/script/services/defaultRootCerts/apple.d.ts.map +1 -0
- package/script/services/defaultRootCerts/mds.d.ts +1 -0
- package/script/services/defaultRootCerts/mds.d.ts.map +1 -0
- package/script/services/metadataService.d.ts +19 -4
- package/script/services/metadataService.d.ts.map +1 -0
- package/script/services/metadataService.js +8 -3
- package/script/services/settingsService.d.ts +17 -14
- package/script/services/settingsService.d.ts.map +1 -0
- package/script/services/settingsService.js +14 -0
- package/esm/deps.d.ts +0 -9
- package/esm/deps.js +0 -12
- package/script/deps.d.ts +0 -9
- package/script/deps.js +0 -68
|
@@ -1,30 +1,73 @@
|
|
|
1
|
-
import { AsnParser
|
|
1
|
+
import { AsnParser } from '@peculiar/asn1-schema';
|
|
2
|
+
import { ECDSASigValue } from '@peculiar/asn1-ecc';
|
|
3
|
+
import { COSECRV } from '../../cose.js';
|
|
2
4
|
import { isoUint8Array } from '../index.js';
|
|
3
5
|
/**
|
|
4
6
|
* In WebAuthn, EC2 signatures are wrapped in ASN.1 structure so we need to peel r and s apart.
|
|
5
7
|
*
|
|
6
8
|
* See https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types
|
|
7
9
|
*/
|
|
8
|
-
export function unwrapEC2Signature(signature) {
|
|
10
|
+
export function unwrapEC2Signature(signature, crv) {
|
|
9
11
|
const parsedSignature = AsnParser.parse(signature, ECDSASigValue);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const rBytes = new Uint8Array(parsedSignature.r);
|
|
13
|
+
const sBytes = new Uint8Array(parsedSignature.s);
|
|
14
|
+
const componentLength = getSignatureComponentLength(crv);
|
|
15
|
+
const rNormalizedBytes = toNormalizedBytes(rBytes, componentLength);
|
|
16
|
+
const sNormalizedBytes = toNormalizedBytes(sBytes, componentLength);
|
|
17
|
+
const finalSignature = isoUint8Array.concat([
|
|
18
|
+
rNormalizedBytes,
|
|
19
|
+
sNormalizedBytes,
|
|
20
|
+
]);
|
|
19
21
|
return finalSignature;
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
+
* The SubtleCrypto Web Crypto API expects ECDSA signatures with `r` and `s` values to be encoded
|
|
25
|
+
* to a specific length depending on the order of the curve. This function returns the expected
|
|
26
|
+
* byte-length for each of the `r` and `s` signature components.
|
|
27
|
+
*
|
|
28
|
+
* See <https://www.w3.org/TR/WebCryptoAPI/#ecdsa-operations>
|
|
29
|
+
*/
|
|
30
|
+
function getSignatureComponentLength(crv) {
|
|
31
|
+
switch (crv) {
|
|
32
|
+
case COSECRV.P256:
|
|
33
|
+
return 32;
|
|
34
|
+
case COSECRV.P384:
|
|
35
|
+
return 48;
|
|
36
|
+
case COSECRV.P521:
|
|
37
|
+
return 66;
|
|
38
|
+
default:
|
|
39
|
+
throw new Error(`Unexpected COSE crv value of ${crv} (EC2)`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Converts the ASN.1 integer representation to bytes of a specific length `n`.
|
|
44
|
+
*
|
|
45
|
+
* DER encodes integers as big-endian byte arrays, with as small as possible representation and
|
|
46
|
+
* requires a leading `0` byte to disambiguate between negative and positive numbers. This means
|
|
47
|
+
* that `r` and `s` can potentially not be the expected byte-length that is needed by the
|
|
48
|
+
* SubtleCrypto Web Crypto API: if there are leading `0`s it can be shorter than expected, and if
|
|
49
|
+
* it has a leading `1` bit, it can be one byte longer.
|
|
24
50
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
51
|
+
* See <https://www.itu.int/rec/T-REC-X.690-202102-I/en>
|
|
52
|
+
* See <https://www.w3.org/TR/WebCryptoAPI/#ecdsa-operations>
|
|
27
53
|
*/
|
|
28
|
-
function
|
|
29
|
-
|
|
54
|
+
function toNormalizedBytes(bytes, componentLength) {
|
|
55
|
+
let normalizedBytes;
|
|
56
|
+
if (bytes.length < componentLength) {
|
|
57
|
+
// In case the bytes are shorter than expected, we need to pad it with leading `0`s.
|
|
58
|
+
normalizedBytes = new Uint8Array(componentLength);
|
|
59
|
+
normalizedBytes.set(bytes, componentLength - bytes.length);
|
|
60
|
+
}
|
|
61
|
+
else if (bytes.length === componentLength) {
|
|
62
|
+
normalizedBytes = bytes;
|
|
63
|
+
}
|
|
64
|
+
else if (bytes.length === componentLength + 1 && bytes[0] === 0 && (bytes[1] & 0x80) === 0x80) {
|
|
65
|
+
// The bytes contain a leading `0` to encode that the integer is positive. This leading `0`
|
|
66
|
+
// needs to be removed for compatibility with the SubtleCrypto Web Crypto API.
|
|
67
|
+
normalizedBytes = bytes.subarray(1);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
throw new Error(`Invalid signature component length ${bytes.length}, expected ${componentLength}`);
|
|
71
|
+
}
|
|
72
|
+
return normalizedBytes;
|
|
30
73
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,aAAa,EAKd,MAAM,eAAe,CAAC;AAMvB;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBnB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COSEKEYS, isCOSEPublicKeyEC2, isCOSEPublicKeyOKP, isCOSEPublicKeyRSA, } from '../../cose.js';
|
|
1
|
+
import { COSEKEYS, isCOSECrv, isCOSEPublicKeyEC2, isCOSEPublicKeyOKP, isCOSEPublicKeyRSA, } from '../../cose.js';
|
|
2
2
|
import { verifyEC2 } from './verifyEC2.js';
|
|
3
3
|
import { verifyRSA } from './verifyRSA.js';
|
|
4
4
|
import { verifyOKP } from './verifyOKP.js';
|
|
@@ -9,7 +9,11 @@ import { unwrapEC2Signature } from './unwrapEC2Signature.js';
|
|
|
9
9
|
export function verify(opts) {
|
|
10
10
|
const { cosePublicKey, signature, data, shaHashOverride } = opts;
|
|
11
11
|
if (isCOSEPublicKeyEC2(cosePublicKey)) {
|
|
12
|
-
const
|
|
12
|
+
const crv = cosePublicKey.get(COSEKEYS.crv);
|
|
13
|
+
if (!isCOSECrv(crv)) {
|
|
14
|
+
throw new Error(`unknown COSE curve ${crv}`);
|
|
15
|
+
}
|
|
16
|
+
const unwrappedSignature = unwrapEC2Signature(signature, crv);
|
|
13
17
|
return verifyEC2({
|
|
14
18
|
cosePublicKey,
|
|
15
19
|
signature: unwrappedSignature,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyEC2.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verifyEC2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAqB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAO7E;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CA0EnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyOKP.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verifyOKP.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,gBAAgB,EAAa,MAAM,eAAe,CAAC;AAM/E,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;CAClB,GAAG,OAAO,CAAC,OAAO,CAAC,CAyDnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyRSA.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verifyRSA.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,gBAAgB,EAAa,MAAM,eAAe,CAAC;AAO/E;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CA2FnB"}
|
|
@@ -34,3 +34,4 @@ export declare function fromASCIIString(value: string): Uint8Array;
|
|
|
34
34
|
* Prepare a DataView we can slice our way around in as we parse the bytes in a Uint8Array
|
|
35
35
|
*/
|
|
36
36
|
export declare function toDataView(array: Uint8Array): DataView;
|
|
37
|
+
//# sourceMappingURL=isoUint8Array.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isoUint8Array.d.ts","sourceRoot":"","sources":["../../../src/helpers/iso/isoUint8Array.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAMxE;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAK/C;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAe/C;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAYvD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAGtD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAG7D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAEzD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,CAEtD"}
|
package/esm/helpers/logging.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/helpers/logging.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,CAGvF"}
|
package/esm/helpers/logging.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapX509SignatureAlgToCOSEAlg.d.ts","sourceRoot":"","sources":["../../src/helpers/mapX509SignatureAlgToCOSEAlg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAwBT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchExpectedRPID.d.ts","sourceRoot":"","sources":["../../src/helpers/matchExpectedRPID.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,UAAU,EACpB,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,MAAM,CAAC,CA8BjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseAuthenticatorData.d.ts","sourceRoot":"","sources":["../../src/helpers/parseAuthenticatorData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4CAA4C,EAE7C,MAAM,oCAAoC,CAAC;AAI5C;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,UAAU,GACnB,uBAAuB,CAwHzB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,UAAU,CAAC;IACrB,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE;QACL,EAAE,EAAE,OAAO,CAAC;QACZ,EAAE,EAAE,OAAO,CAAC;QACZ,EAAE,EAAE,OAAO,CAAC;QACZ,EAAE,EAAE,OAAO,CAAC;QACZ,EAAE,EAAE,OAAO,CAAC;QACZ,EAAE,EAAE,OAAO,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,cAAc,CAAC,EAAE,4CAA4C,CAAC;IAC9D,oBAAoB,CAAC,EAAE,UAAU,CAAC;CACnC,CAAC;AAGF,eAAO,MAAM,gCAAgC;sBACzB,uBAAuB;CAC1C,CAAC"}
|
|
@@ -15,12 +15,12 @@ export function parseAuthenticatorData(authData) {
|
|
|
15
15
|
// Bit positions can be referenced here:
|
|
16
16
|
// https://www.w3.org/TR/webauthn-2/#flags
|
|
17
17
|
const flags = {
|
|
18
|
-
up: !!(flagsInt & (1 << 0)),
|
|
19
|
-
uv: !!(flagsInt & (1 << 2)),
|
|
20
|
-
be: !!(flagsInt & (1 << 3)),
|
|
21
|
-
bs: !!(flagsInt & (1 << 4)),
|
|
22
|
-
at: !!(flagsInt & (1 << 6)),
|
|
23
|
-
ed: !!(flagsInt & (1 << 7)),
|
|
18
|
+
up: !!(flagsInt & (1 << 0)), // User Presence
|
|
19
|
+
uv: !!(flagsInt & (1 << 2)), // User Verified
|
|
20
|
+
be: !!(flagsInt & (1 << 3)), // Backup Eligibility
|
|
21
|
+
bs: !!(flagsInt & (1 << 4)), // Backup State
|
|
22
|
+
at: !!(flagsInt & (1 << 6)), // Attested Credential Data Present
|
|
23
|
+
ed: !!(flagsInt & (1 << 7)), // Extension Data Present
|
|
24
24
|
flagsInt,
|
|
25
25
|
};
|
|
26
26
|
const counterBuf = authData.slice(pointer, pointer + 4);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CredentialDeviceType } from '
|
|
1
|
+
import type { CredentialDeviceType } from '@simplewebauthn/types';
|
|
2
2
|
/**
|
|
3
3
|
* Make sense of Bits 3 and 4 in authenticator indicating:
|
|
4
4
|
*
|
|
@@ -17,3 +17,4 @@ export declare function parseBackupFlags({ be, bs }: {
|
|
|
17
17
|
export declare class InvalidBackupFlags extends Error {
|
|
18
18
|
constructor(message: string);
|
|
19
19
|
}
|
|
20
|
+
//# sourceMappingURL=parseBackupFlags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseBackupFlags.d.ts","sourceRoot":"","sources":["../../src/helpers/parseBackupFlags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,OAAO,CAAA;CAAE,GAAG;IAC1E,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAeA;AAED,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B"}
|
package/esm/helpers/toHash.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toHash.d.ts","sourceRoot":"","sources":["../../src/helpers/toHash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;;GAGG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,UAAU,GAAG,MAAM,EACzB,SAAS,GAAE,OAAY,GACtB,OAAO,CAAC,UAAU,CAAC,CAQrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateCertificatePath.d.ts","sourceRoot":"","sources":["../../src/helpers/validateCertificatePath.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,EAAE,EACtB,gBAAgB,GAAE,MAAM,EAAO,GAC9B,OAAO,CAAC,OAAO,CAAC,CAuClB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AsnSerializer } from '
|
|
1
|
+
import { AsnSerializer } from '@peculiar/asn1-schema';
|
|
2
2
|
import { isCertRevoked } from './isCertRevoked.js';
|
|
3
3
|
import { verifySignature } from './verifySignature.js';
|
|
4
4
|
import { mapX509SignatureAlgToCOSEAlg } from './mapX509SignatureAlgToCOSEAlg.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Extensions } from '@peculiar/asn1-x509';
|
|
2
|
+
/**
|
|
3
|
+
* Look for the id-fido-gen-ce-aaguid certificate extension. If it's present then check it against
|
|
4
|
+
* the attestation statement AAGUID.
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateExtFIDOGenCEAAGUID(certExtensions: Extensions | undefined, aaguid: Uint8Array): boolean;
|
|
7
|
+
//# sourceMappingURL=validateExtFIDOGenCEAAGUID.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateExtFIDOGenCEAAGUID.d.ts","sourceRoot":"","sources":["../../src/helpers/validateExtFIDOGenCEAAGUID.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAWjD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,UAAU,GAAG,SAAS,EACtC,MAAM,EAAE,UAAU,GACjB,OAAO,CA6BT"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AsnParser, OctetString } from '@peculiar/asn1-schema';
|
|
2
|
+
import { isoUint8Array } from './iso/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Attestation Certificate Extension OID: `id-fido-gen-ce-aaguid`
|
|
5
|
+
*
|
|
6
|
+
* Sourced from https://fidoalliance.org/specs/fido-v2.0-ps-20150904/fido-key-attestation-v2.0-ps-20150904.html#verifying-an-attestation-statement
|
|
7
|
+
*/
|
|
8
|
+
const id_fido_gen_ce_aaguid = '1.3.6.1.4.1.45724.1.1.4';
|
|
9
|
+
/**
|
|
10
|
+
* Look for the id-fido-gen-ce-aaguid certificate extension. If it's present then check it against
|
|
11
|
+
* the attestation statement AAGUID.
|
|
12
|
+
*/
|
|
13
|
+
export function validateExtFIDOGenCEAAGUID(certExtensions, aaguid) {
|
|
14
|
+
// The certificate had no extensions so there's nothing to validate
|
|
15
|
+
if (!certExtensions) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
const extFIDOGenCEAAGUID = certExtensions.find((ext) => ext.extnID === id_fido_gen_ce_aaguid);
|
|
19
|
+
// The extension isn't present so there's nothing to validate
|
|
20
|
+
if (!extFIDOGenCEAAGUID) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
// Parse the extension value
|
|
24
|
+
const parsedExtFIDOGenCEAAGUID = AsnParser.parse(extFIDOGenCEAAGUID.extnValue, OctetString);
|
|
25
|
+
const extValue = new Uint8Array(parsedExtFIDOGenCEAAGUID.buffer);
|
|
26
|
+
// Compare the two values
|
|
27
|
+
const aaguidAndExtAreEqual = isoUint8Array.areEqual(aaguid, extValue);
|
|
28
|
+
if (!aaguidAndExtAreEqual) {
|
|
29
|
+
const _debugExtHex = isoUint8Array.toHex(extValue);
|
|
30
|
+
const _debugAAGUIDHex = isoUint8Array.toHex(aaguid);
|
|
31
|
+
throw new Error(`Certificate extension id-fido-gen-ce-aaguid (${id_fido_gen_ce_aaguid}) value of "${_debugExtHex}" was present but not equal to attestation statement AAGUID value of "${_debugAAGUIDHex}"`);
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifySignature.d.ts","sourceRoot":"","sources":["../../src/helpers/verifySignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,MAAM,WAAW,CAAC;AAKnD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,SAAS,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,OAAO,CAAC,CAmCnB;AAGD,eAAO,MAAM,yBAAyB;sBAClB,OAAO,CAAC,OAAO,CAAC;CACnC,CAAC"}
|
package/esm/index.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ import type { MetadataStatement } from './metadata/mdsTypes.js';
|
|
|
15
15
|
import type { VerifiedRegistrationResponse, VerifyRegistrationResponseOpts } from './registration/verifyRegistrationResponse.js';
|
|
16
16
|
import type { VerifiedAuthenticationResponse, VerifyAuthenticationResponseOpts } from './authentication/verifyAuthenticationResponse.js';
|
|
17
17
|
export type { GenerateAuthenticationOptionsOpts, GenerateRegistrationOptionsOpts, MetadataStatement, VerifiedAuthenticationResponse, VerifiedRegistrationResponse, VerifyAuthenticationResponseOpts, VerifyRegistrationResponseOpts, };
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,4BAA4B,EAC5B,0BAA0B,GAC3B,CAAC;AAEF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,mDAAmD,CAAC;AAC3G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EACV,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,kDAAkD,CAAC;AAE1D,YAAY,EACV,iCAAiC,EACjC,+BAA+B,EAC/B,iBAAiB,EACjB,8BAA8B,EAC9B,4BAA4B,EAC5B,gCAAgC,EAChC,8BAA8B,GAC/B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Base64URLString } from '
|
|
1
|
+
import type { Base64URLString } from '@simplewebauthn/types';
|
|
2
2
|
/**
|
|
3
3
|
* Metadata Service structures
|
|
4
4
|
* https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html
|
|
@@ -214,3 +214,4 @@ export type AuthenticatorGetInfo = {
|
|
|
214
214
|
}[];
|
|
215
215
|
};
|
|
216
216
|
export {};
|
|
217
|
+
//# sourceMappingURL=mdsTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdsTypes.d.ts","sourceRoot":"","sources":["../../src/metadata/mdsTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,eAAe,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,wBAAwB,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC,CAAC,EAAE,MAAM,EAAE,CAAC;IAChD,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACjD,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACt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C;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,CAAC,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,EAAE,CAAC,EAAE,OAAO,CAAC;QACb,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,EAAE,CAAC,EAAE,OAAO,CAAC;QACb,EAAE,CAAC,EAAE,OAAO,CAAC;KACd,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseJWT.d.ts","sourceRoot":"","sources":["../../src/metadata/parseJWT.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,CAO9D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Base64URLString } from '
|
|
1
|
+
import type { Base64URLString } from '@simplewebauthn/types';
|
|
2
2
|
import type { AlgSign, MetadataStatement } from './mdsTypes.js';
|
|
3
3
|
import { COSEALG, COSECRV, COSEKTY } from '../helpers/cose.js';
|
|
4
4
|
/**
|
|
@@ -27,3 +27,4 @@ export declare const algSignToCOSEInfoMap: {
|
|
|
27
27
|
[key in AlgSign]: COSEInfo;
|
|
28
28
|
};
|
|
29
29
|
export {};
|
|
30
|
+
//# sourceMappingURL=verifyAttestationWithMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyAttestationWithMetadata.d.ts","sourceRoot":"","sources":["../../src/metadata/verifyAttestationWithMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAY,OAAO,EAAsB,MAAM,oBAAoB,CAAC;AAE7F;;;GAGG;AACH,wBAAsB,6BAA6B,CAAC,EAClD,SAAS,EACT,mBAAmB,EACnB,GAAG,EACH,uBAAuB,GACxB,EAAE;IACD,SAAS,EAAE,iBAAiB,CAAC;IAC7B,mBAAmB,EAAE,UAAU,CAAC;IAChC,GAAG,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE,CAAC;IACtC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC,GAAG,OAAO,CAAC,OAAO,CAAC,CAoJnB;AAED,KAAK,QAAQ,GAAG;IACd,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE;KAAG,GAAG,IAAI,OAAO,GAAG,QAAQ;CAe9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyJWT.d.ts","sourceRoot":"","sources":["../../src/metadata/verifyJWT.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CA0B7E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticatorSelectionCriteria, AuthenticatorTransportFuture, Base64URLString, COSEAlgorithmIdentifier, PublicKeyCredentialCreationOptionsJSON } from '
|
|
1
|
+
import type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticatorSelectionCriteria, AuthenticatorTransportFuture, Base64URLString, COSEAlgorithmIdentifier, PublicKeyCredentialCreationOptionsJSON } from '@simplewebauthn/types';
|
|
2
2
|
export type GenerateRegistrationOptionsOpts = {
|
|
3
3
|
rpName: string;
|
|
4
4
|
rpID: string;
|
|
@@ -41,3 +41,4 @@ export declare const supportedCOSEAlgorithmIdentifiers: COSEAlgorithmIdentifier[
|
|
|
41
41
|
* @param supportedAlgorithmIDs **(Optional)** - Array of numeric COSE algorithm identifiers supported for attestation by this RP. See https://www.iana.org/assignments/cose/cose.xhtml#algorithms. Defaults to `[-8, -7, -257]`
|
|
42
42
|
*/
|
|
43
43
|
export declare function generateRegistrationOptions(options: GenerateRegistrationOptionsOpts): Promise<PublicKeyCredentialCreationOptionsJSON>;
|
|
44
|
+
//# sourceMappingURL=generateRegistrationOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateRegistrationOptions.d.ts","sourceRoot":"","sources":["../../src/registration/generateRegistrationOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,oCAAoC,EACpC,8BAA8B,EAC9B,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,sCAAsC,EAEvC,MAAM,uBAAuB,CAAC;AAM/B,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,+BAA+B,CAAC;IAClD,kBAAkB,CAAC,EAAE;QACnB,EAAE,EAAE,eAAe,CAAC;QACpB,UAAU,CAAC,EAAE,4BAA4B,EAAE,CAAC;KAC7C,EAAE,CAAC;IACJ,sBAAsB,CAAC,EAAE,8BAA8B,CAAC;IACxD,UAAU,CAAC,EAAE,oCAAoC,CAAC;IAClD,qBAAqB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAE,uBAAuB,EAqBtE,CAAC;AAsBF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,sCAAsC,CAAC,CAiHjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/constants.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAEH;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAkB3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAsC5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAUlD,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;CAiFhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAM/D,CAAC"}
|
|
@@ -109,6 +109,10 @@ export const TPM_MANUFACTURERS = {
|
|
|
109
109
|
name: 'IBM',
|
|
110
110
|
id: 'IBM',
|
|
111
111
|
},
|
|
112
|
+
'id:49424D00': {
|
|
113
|
+
name: 'IBM',
|
|
114
|
+
id: 'IBM',
|
|
115
|
+
},
|
|
112
116
|
'id:49465800': {
|
|
113
117
|
name: 'Infineon',
|
|
114
118
|
id: 'IFX',
|
|
@@ -174,9 +178,9 @@ export const TPM_MANUFACTURERS = {
|
|
|
174
178
|
* Match TPM public area curve ID's to `crv` numbers used in COSE public keys
|
|
175
179
|
*/
|
|
176
180
|
export const TPM_ECC_CURVE_COSE_CRV_MAP = {
|
|
177
|
-
TPM_ECC_NIST_P256: 1,
|
|
178
|
-
TPM_ECC_NIST_P384: 2,
|
|
179
|
-
TPM_ECC_NIST_P521: 3,
|
|
180
|
-
TPM_ECC_BN_P256: 1,
|
|
181
|
+
TPM_ECC_NIST_P256: 1, // p256
|
|
182
|
+
TPM_ECC_NIST_P384: 2, // p384
|
|
183
|
+
TPM_ECC_NIST_P521: 3, // p521
|
|
184
|
+
TPM_ECC_BN_P256: 1, // p256
|
|
181
185
|
TPM_ECC_SM2_P256: 1, // p256
|
|
182
186
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseCertInfo.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/parseCertInfo.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,UAAU,GAAG,cAAc,CAkElE;AAED,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,UAAU,CAAC;IAC5B,SAAS,EAAE,UAAU,CAAC;IACtB,SAAS,EAAE;QACT,KAAK,EAAE,UAAU,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;IACF,eAAe,EAAE,UAAU,CAAC;IAC5B,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,UAAU,CAAC;QAC1B,IAAI,EAAE,UAAU,CAAC;QACjB,aAAa,EAAE,UAAU,CAAC;KAC3B,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsePubArea.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/parsePubArea.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,GAAG,aAAa,CAyG/D;AAED,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,aAAa,GAAG,aAAa,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE;QAChB,QAAQ,EAAE,OAAO,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,EAAE,OAAO,CAAC;QACrB,mBAAmB,EAAE,OAAO,CAAC;QAC7B,YAAY,EAAE,OAAO,CAAC;QACtB,eAAe,EAAE,OAAO,CAAC;QACzB,IAAI,EAAE,OAAO,CAAC;QACd,oBAAoB,EAAE,OAAO,CAAC;QAC9B,UAAU,EAAE,OAAO,CAAC;QACpB,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE;QACV,GAAG,CAAC,EAAE,aAAa,CAAC;QACpB,GAAG,CAAC,EAAE,aAAa,CAAC;KACrB,CAAC;IACF,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyAttestationTPM.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/verifyAttestationTPM.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAuBzF,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA+VlB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AsnParser
|
|
1
|
+
import { AsnParser } from '@peculiar/asn1-schema';
|
|
2
|
+
import { Certificate, ExtendedKeyUsage, id_ce_extKeyUsage, id_ce_subjectAltName, SubjectAlternativeName, } from '@peculiar/asn1-x509';
|
|
2
3
|
import { decodeCredentialPublicKey } from '../../../helpers/decodeCredentialPublicKey.js';
|
|
3
4
|
import { COSEALG, COSEKEYS, isCOSEAlg, isCOSEPublicKeyEC2, isCOSEPublicKeyRSA, } from '../../../helpers/cose.js';
|
|
4
5
|
import { toHash } from '../../../helpers/toHash.js';
|
|
@@ -7,6 +8,7 @@ import { validateCertificatePath } from '../../../helpers/validateCertificatePat
|
|
|
7
8
|
import { getCertificateInfo } from '../../../helpers/getCertificateInfo.js';
|
|
8
9
|
import { verifySignature } from '../../../helpers/verifySignature.js';
|
|
9
10
|
import { isoUint8Array } from '../../../helpers/iso/index.js';
|
|
11
|
+
import { validateExtFIDOGenCEAAGUID } from '../../../helpers/validateExtFIDOGenCEAAGUID.js';
|
|
10
12
|
import { MetadataService } from '../../../services/metadataService.js';
|
|
11
13
|
import { verifyAttestationWithMetadata } from '../../../metadata/verifyAttestationWithMetadata.js';
|
|
12
14
|
import { TPM_ECC_CURVE_COSE_CRV_MAP, TPM_MANUFACTURERS } from './constants.js';
|
|
@@ -206,8 +208,14 @@ export async function verifyAttestationTPM(options) {
|
|
|
206
208
|
if (extKeyUsage[0] !== '2.23.133.8.3') {
|
|
207
209
|
throw new Error(`Unexpected extKeyUsage "${extKeyUsage[0]}", expected "2.23.133.8.3" (TPM)`);
|
|
208
210
|
}
|
|
209
|
-
//
|
|
210
|
-
|
|
211
|
+
// Validate attestation statement AAGUID against leaf cert AAGUID
|
|
212
|
+
try {
|
|
213
|
+
await validateExtFIDOGenCEAAGUID(parsedCert.tbsCertificate.extensions, aaguid);
|
|
214
|
+
}
|
|
215
|
+
catch (err) {
|
|
216
|
+
const _err = err;
|
|
217
|
+
throw new Error(`${_err.message} (TPM)`);
|
|
218
|
+
}
|
|
211
219
|
// Run some metadata checks if a statement exists for this authenticator
|
|
212
220
|
const statement = await MetadataService.getStatement(aaguid);
|
|
213
221
|
if (statement) {
|
|
@@ -3,3 +3,4 @@ import type { AttestationFormatVerifierOpts } from '../verifyRegistrationRespons
|
|
|
3
3
|
* Verify an attestation response with fmt 'android-key'
|
|
4
4
|
*/
|
|
5
5
|
export declare function verifyAttestationAndroidKey(options: AttestationFormatVerifierOpts): Promise<boolean>;
|
|
6
|
+
//# sourceMappingURL=verifyAttestationAndroidKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyAttestationAndroidKey.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationAndroidKey.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAUtF;;GAEG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA+HlB"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { AsnParser
|
|
1
|
+
import { AsnParser } from '@peculiar/asn1-schema';
|
|
2
|
+
import { Certificate } from '@peculiar/asn1-x509';
|
|
3
|
+
import { id_ce_keyDescription, KeyDescription } from '@peculiar/asn1-android';
|
|
2
4
|
import { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';
|
|
3
5
|
import { validateCertificatePath } from '../../helpers/validateCertificatePath.js';
|
|
4
6
|
import { verifySignature } from '../../helpers/verifySignature.js';
|
|
@@ -3,3 +3,4 @@ import type { AttestationFormatVerifierOpts } from '../verifyRegistrationRespons
|
|
|
3
3
|
* Verify an attestation response with fmt 'android-safetynet'
|
|
4
4
|
*/
|
|
5
5
|
export declare function verifyAttestationAndroidSafetyNet(options: AttestationFormatVerifierOpts): Promise<boolean>;
|
|
6
|
+
//# sourceMappingURL=verifyAttestationAndroidSafetyNet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyAttestationAndroidSafetyNet.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationAndroidSafetyNet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAWtF;;GAEG;AACH,wBAAsB,iCAAiC,CACrD,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA2IlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyAttestationApple.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationApple.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAOtF,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA6ElB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AsnParser
|
|
1
|
+
import { AsnParser } from '@peculiar/asn1-schema';
|
|
2
|
+
import { Certificate } from '@peculiar/asn1-x509';
|
|
2
3
|
import { validateCertificatePath } from '../../helpers/validateCertificatePath.js';
|
|
3
4
|
import { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';
|
|
4
5
|
import { toHash } from '../../helpers/toHash.js';
|
|
@@ -3,3 +3,4 @@ import type { AttestationFormatVerifierOpts } from '../verifyRegistrationRespons
|
|
|
3
3
|
* Verify an attestation response with fmt 'fido-u2f'
|
|
4
4
|
*/
|
|
5
5
|
export declare function verifyAttestationFIDOU2F(options: AttestationFormatVerifierOpts): Promise<boolean>;
|
|
6
|
+
//# sourceMappingURL=verifyAttestationFIDOU2F.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyAttestationFIDOU2F.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationFIDOU2F.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAStF;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA4DlB"}
|
|
@@ -3,3 +3,4 @@ import type { AttestationFormatVerifierOpts } from '../verifyRegistrationRespons
|
|
|
3
3
|
* Verify an attestation response with fmt 'packed'
|
|
4
4
|
*/
|
|
5
5
|
export declare function verifyAttestationPacked(options: AttestationFormatVerifierOpts): Promise<boolean>;
|
|
6
|
+
//# sourceMappingURL=verifyAttestationPacked.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyAttestationPacked.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationPacked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAYtF;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CAyJlB"}
|