@simplewebauthn/server 7.4.0 → 8.0.0-alpha.0
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/LICENSE.md +11 -14
- package/README.md +6 -2
- package/{dist → esm}/authentication/generateAuthenticationOptions.d.ts +2 -2
- package/esm/authentication/generateAuthenticationOptions.js +36 -0
- package/{dist → esm}/authentication/verifyAuthenticationResponse.d.ts +2 -2
- package/esm/authentication/verifyAuthenticationResponse.js +164 -0
- package/esm/deps.d.ts +10 -0
- package/esm/deps.js +12 -0
- package/esm/helpers/convertAAGUIDToString.js +17 -0
- package/esm/helpers/convertCOSEtoPKCS.js +21 -0
- package/{dist → esm}/helpers/convertCertBufferToPEM.d.ts +1 -1
- package/esm/helpers/convertCertBufferToPEM.js +31 -0
- package/esm/helpers/convertPEMToBytes.js +11 -0
- package/{dist → esm}/helpers/convertX509PublicKeyToCOSE.d.ts +1 -1
- package/esm/helpers/convertX509PublicKeyToCOSE.js +70 -0
- package/{dist → esm}/helpers/cose.d.ts +2 -1
- package/esm/helpers/cose.js +81 -0
- package/{dist → esm}/helpers/decodeAttestationObject.d.ts +3 -0
- package/esm/helpers/decodeAttestationObject.js +13 -0
- package/esm/helpers/decodeAuthenticatorExtensions.js +34 -0
- package/{dist → esm}/helpers/decodeClientDataJSON.d.ts +3 -0
- package/esm/helpers/decodeClientDataJSON.js +13 -0
- package/esm/helpers/decodeCredentialPublicKey.d.ts +5 -0
- package/esm/helpers/decodeCredentialPublicKey.js +8 -0
- package/esm/helpers/fetch.d.ts +8 -0
- package/esm/helpers/fetch.js +12 -0
- package/esm/helpers/generateChallenge.d.ts +7 -0
- package/esm/helpers/generateChallenge.js +21 -0
- package/{dist → esm}/helpers/getCertificateInfo.d.ts +1 -1
- package/esm/helpers/getCertificateInfo.js +76 -0
- package/esm/helpers/index.d.ts +22 -0
- package/esm/helpers/index.js +16 -0
- package/{dist → esm}/helpers/isCertRevoked.d.ts +1 -1
- package/esm/helpers/isCertRevoked.js +98 -0
- package/{dist → esm}/helpers/iso/index.d.ts +4 -4
- package/esm/helpers/iso/index.js +11 -0
- package/esm/helpers/iso/isoBase64URL.js +57 -0
- package/{dist → esm}/helpers/iso/isoCBOR.d.ts +1 -1
- package/esm/helpers/iso/isoCBOR.js +44 -0
- package/{dist → esm}/helpers/iso/isoCrypto/digest.d.ts +1 -1
- package/esm/helpers/iso/isoCrypto/digest.js +14 -0
- package/{dist → esm}/helpers/iso/isoCrypto/getRandomValues.d.ts +1 -1
- package/esm/helpers/iso/isoCrypto/getRandomValues.js +11 -0
- package/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts +6 -0
- package/esm/helpers/iso/isoCrypto/getWebCrypto.js +40 -0
- package/esm/helpers/iso/isoCrypto/importKey.js +8 -0
- package/esm/helpers/iso/isoCrypto/index.d.ts +3 -0
- package/esm/helpers/iso/isoCrypto/index.js +3 -0
- package/{dist → esm}/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts +2 -2
- package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js +20 -0
- package/{dist → esm}/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts +2 -2
- package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js +19 -0
- package/esm/helpers/iso/isoCrypto/structs.js +1 -0
- package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js +30 -0
- package/{dist → esm}/helpers/iso/isoCrypto/verify.d.ts +1 -1
- package/esm/helpers/iso/isoCrypto/verify.js +28 -0
- package/{dist → esm}/helpers/iso/isoCrypto/verifyEC2.d.ts +1 -1
- package/esm/helpers/iso/isoCrypto/verifyEC2.js +73 -0
- package/{dist → esm}/helpers/iso/isoCrypto/verifyOKP.d.ts +1 -1
- package/esm/helpers/iso/isoCrypto/verifyOKP.js +51 -0
- package/{dist → esm}/helpers/iso/isoCrypto/verifyRSA.d.ts +1 -1
- package/esm/helpers/iso/isoCrypto/verifyRSA.js +91 -0
- package/esm/helpers/iso/isoUint8Array.js +75 -0
- package/{dist → esm}/helpers/logging.d.ts +1 -1
- package/esm/helpers/logging.js +19 -0
- package/{dist → esm}/helpers/mapX509SignatureAlgToCOSEAlg.d.ts +1 -1
- package/esm/helpers/mapX509SignatureAlgToCOSEAlg.js +35 -0
- package/esm/helpers/matchExpectedRPID.js +41 -0
- package/{dist → esm}/helpers/parseAuthenticatorData.d.ts +4 -1
- package/esm/helpers/parseAuthenticatorData.js +71 -0
- package/{dist → esm}/helpers/parseBackupFlags.d.ts +4 -1
- package/esm/helpers/parseBackupFlags.js +25 -0
- package/{dist → esm}/helpers/toHash.d.ts +1 -1
- package/esm/helpers/toHash.js +12 -0
- package/esm/helpers/validateCertificatePath.js +122 -0
- package/{dist → esm}/helpers/verifySignature.d.ts +4 -1
- package/esm/helpers/verifySignature.js +32 -0
- package/esm/index.d.ts +17 -0
- package/esm/index.js +11 -0
- package/{dist → esm}/metadata/mdsTypes.d.ts +1 -1
- package/esm/metadata/mdsTypes.js +17 -0
- package/esm/metadata/parseJWT.js +12 -0
- package/{dist → esm}/metadata/verifyAttestationWithMetadata.d.ts +3 -3
- package/esm/metadata/verifyAttestationWithMetadata.js +159 -0
- package/esm/metadata/verifyJWT.js +37 -0
- package/esm/package.json +3 -0
- package/{dist → esm}/registration/generateRegistrationOptions.d.ts +2 -2
- package/esm/registration/generateRegistrationOptions.js +142 -0
- package/esm/registration/verifications/tpm/constants.js +182 -0
- package/esm/registration/verifications/tpm/parseCertInfo.js +58 -0
- package/esm/registration/verifications/tpm/parsePubArea.js +94 -0
- package/{dist → esm}/registration/verifications/tpm/verifyAttestationTPM.d.ts +1 -1
- package/esm/registration/verifications/tpm/verifyAttestationTPM.js +323 -0
- package/{dist → esm}/registration/verifications/verifyAttestationAndroidKey.d.ts +1 -1
- package/esm/registration/verifications/verifyAttestationAndroidKey.js +90 -0
- package/{dist → esm}/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts +1 -1
- package/esm/registration/verifications/verifyAttestationAndroidSafetyNet.js +112 -0
- package/{dist → esm}/registration/verifications/verifyAttestationApple.d.ts +1 -1
- package/esm/registration/verifications/verifyAttestationApple.js +57 -0
- package/{dist → esm}/registration/verifications/verifyAttestationFIDOU2F.d.ts +1 -1
- package/esm/registration/verifications/verifyAttestationFIDOU2F.js +48 -0
- package/{dist → esm}/registration/verifications/verifyAttestationPacked.d.ts +1 -1
- package/esm/registration/verifications/verifyAttestationPacked.js +105 -0
- package/{dist → esm}/registration/verifyRegistrationResponse.d.ts +3 -3
- package/esm/registration/verifyRegistrationResponse.js +198 -0
- package/esm/services/defaultRootCerts/android-key.js +85 -0
- package/esm/services/defaultRootCerts/android-safetynet.js +32 -0
- package/esm/services/defaultRootCerts/apple.js +25 -0
- package/esm/services/defaultRootCerts/mds.js +32 -0
- package/{dist → esm}/services/metadataService.d.ts +1 -1
- package/{dist → esm}/services/metadataService.js +52 -36
- package/{dist → esm}/services/settingsService.d.ts +1 -1
- package/esm/services/settingsService.js +65 -0
- package/package.json +40 -45
- package/script/authentication/generateAuthenticationOptions.d.ts +23 -0
- package/{dist → script}/authentication/generateAuthenticationOptions.js +8 -9
- package/script/authentication/verifyAuthenticationResponse.d.ts +66 -0
- package/{dist → script}/authentication/verifyAuthenticationResponse.js +25 -23
- package/script/deps.d.ts +10 -0
- package/script/deps.js +68 -0
- package/script/helpers/convertAAGUIDToString.d.ts +4 -0
- package/{dist → script}/helpers/convertAAGUIDToString.js +2 -3
- package/script/helpers/convertCOSEtoPKCS.d.ts +4 -0
- package/{dist → script}/helpers/convertCOSEtoPKCS.js +7 -8
- package/script/helpers/convertCertBufferToPEM.d.ts +5 -0
- package/{dist → script}/helpers/convertCertBufferToPEM.js +5 -6
- package/script/helpers/convertPEMToBytes.d.ts +4 -0
- package/{dist → script}/helpers/convertPEMToBytes.js +2 -3
- package/script/helpers/convertX509PublicKeyToCOSE.d.ts +2 -0
- package/{dist → script}/helpers/convertX509PublicKeyToCOSE.js +21 -25
- package/script/helpers/cose.d.ts +98 -0
- package/{dist → script}/helpers/cose.js +1 -1
- package/script/helpers/decodeAttestationObject.d.ts +29 -0
- package/script/helpers/decodeAttestationObject.js +17 -0
- package/script/helpers/decodeAuthenticatorExtensions.d.ts +20 -0
- package/{dist → script}/helpers/decodeAuthenticatorExtensions.js +2 -3
- package/script/helpers/decodeClientDataJSON.d.ts +17 -0
- package/script/helpers/decodeClientDataJSON.js +17 -0
- package/script/helpers/decodeCredentialPublicKey.d.ts +5 -0
- package/script/helpers/decodeCredentialPublicKey.js +12 -0
- package/script/helpers/fetch.d.ts +8 -0
- package/script/helpers/fetch.js +16 -0
- package/script/helpers/generateChallenge.d.ts +7 -0
- package/{dist → script}/helpers/generateChallenge.js +9 -6
- package/script/helpers/getCertificateInfo.d.ts +31 -0
- package/{dist → script}/helpers/getCertificateInfo.js +4 -6
- package/script/helpers/index.d.ts +22 -0
- package/script/helpers/index.js +59 -0
- package/script/helpers/isCertRevoked.d.ts +8 -0
- package/{dist → script}/helpers/isCertRevoked.js +20 -25
- package/script/helpers/iso/index.d.ts +11 -0
- package/{dist → script}/helpers/iso/index.js +4 -5
- package/script/helpers/iso/isoBase64URL.d.ts +37 -0
- package/{dist → script}/helpers/iso/isoBase64URL.js +0 -1
- package/script/helpers/iso/isoCBOR.d.ts +12 -0
- package/{dist → script}/helpers/iso/isoCBOR.js +8 -28
- package/script/helpers/iso/isoCrypto/digest.d.ts +8 -0
- package/script/helpers/iso/isoCrypto/digest.js +18 -0
- package/script/helpers/iso/isoCrypto/getRandomValues.d.ts +6 -0
- package/script/helpers/iso/isoCrypto/getRandomValues.js +15 -0
- package/script/helpers/iso/isoCrypto/getWebCrypto.d.ts +6 -0
- package/script/helpers/iso/isoCrypto/getWebCrypto.js +44 -0
- package/script/helpers/iso/isoCrypto/importKey.d.ts +4 -0
- package/script/helpers/iso/isoCrypto/importKey.js +12 -0
- package/script/helpers/iso/isoCrypto/index.d.ts +3 -0
- package/{dist → script}/helpers/iso/isoCrypto/index.js +6 -7
- package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts +6 -0
- package/{dist → script}/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js +6 -6
- package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts +6 -0
- package/{dist → script}/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js +5 -6
- package/script/helpers/iso/isoCrypto/structs.d.ts +3 -0
- package/{dist → script}/helpers/iso/isoCrypto/structs.js +0 -1
- package/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts +6 -0
- package/{dist → script}/helpers/iso/isoCrypto/unwrapEC2Signature.js +4 -6
- package/script/helpers/iso/isoCrypto/verify.d.ts +10 -0
- package/script/helpers/iso/isoCrypto/verify.js +32 -0
- package/script/helpers/iso/isoCrypto/verifyEC2.d.ts +10 -0
- package/{dist → script}/helpers/iso/isoCrypto/verifyEC2.js +19 -22
- package/script/helpers/iso/isoCrypto/verifyOKP.d.ts +6 -0
- package/{dist → script}/helpers/iso/isoCrypto/verifyOKP.js +13 -16
- package/script/helpers/iso/isoCrypto/verifyRSA.d.ts +10 -0
- package/{dist → script}/helpers/iso/isoCrypto/verifyRSA.js +19 -22
- package/script/helpers/iso/isoUint8Array.d.ts +36 -0
- package/{dist → script}/helpers/iso/isoUint8Array.js +7 -8
- package/script/helpers/logging.d.ts +17 -0
- package/{dist → script}/helpers/logging.js +2 -6
- package/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts +8 -0
- package/{dist → script}/helpers/mapX509SignatureAlgToCOSEAlg.js +8 -9
- package/script/helpers/matchExpectedRPID.d.ts +7 -0
- package/{dist → script}/helpers/matchExpectedRPID.js +5 -6
- package/script/helpers/parseAuthenticatorData.d.ts +28 -0
- package/{dist → script}/helpers/parseAuthenticatorData.js +19 -16
- package/script/helpers/parseBackupFlags.d.ts +19 -0
- package/{dist → script}/helpers/parseBackupFlags.js +2 -2
- package/script/helpers/toHash.d.ts +6 -0
- package/{dist → script}/helpers/toHash.js +4 -5
- package/script/helpers/validateCertificatePath.d.ts +6 -0
- package/{dist → script}/helpers/validateCertificatePath.js +13 -15
- package/script/helpers/verifySignature.d.ts +14 -0
- package/script/helpers/verifySignature.js +36 -0
- package/script/index.d.ts +17 -0
- package/script/index.js +19 -0
- package/script/metadata/mdsTypes.d.ts +216 -0
- package/{dist → script}/metadata/mdsTypes.js +0 -1
- package/script/metadata/parseJWT.d.ts +4 -0
- package/{dist → script}/metadata/parseJWT.js +3 -4
- package/script/metadata/verifyAttestationWithMetadata.d.ts +29 -0
- package/{dist → script}/metadata/verifyAttestationWithMetadata.js +24 -22
- package/script/metadata/verifyJWT.d.ts +10 -0
- package/script/metadata/verifyJWT.js +41 -0
- package/script/package.json +3 -0
- package/script/registration/generateRegistrationOptions.d.ts +43 -0
- package/{dist → script}/registration/generateRegistrationOptions.js +9 -10
- package/script/registration/verifications/tpm/constants.d.ts +47 -0
- package/{dist → script}/registration/verifications/tpm/constants.js +1 -2
- package/script/registration/verifications/tpm/parseCertInfo.d.ts +24 -0
- package/{dist → script}/registration/verifications/tpm/parseCertInfo.js +13 -14
- package/script/registration/verifications/tpm/parsePubArea.d.ts +43 -0
- package/{dist → script}/registration/verifications/tpm/parsePubArea.js +16 -17
- package/script/registration/verifications/tpm/verifyAttestationTPM.d.ts +2 -0
- package/{dist → script}/registration/verifications/tpm/verifyAttestationTPM.js +58 -58
- package/script/registration/verifications/verifyAttestationAndroidKey.d.ts +5 -0
- package/{dist → script}/registration/verifications/verifyAttestationAndroidKey.js +22 -26
- package/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts +5 -0
- package/{dist → script}/registration/verifications/verifyAttestationAndroidSafetyNet.js +22 -23
- package/script/registration/verifications/verifyAttestationApple.d.ts +2 -0
- package/{dist → script}/registration/verifications/verifyAttestationApple.js +15 -17
- package/script/registration/verifications/verifyAttestationFIDOU2F.d.ts +5 -0
- package/{dist → script}/registration/verifications/verifyAttestationFIDOU2F.js +12 -13
- package/script/registration/verifications/verifyAttestationPacked.d.ts +5 -0
- package/{dist → script}/registration/verifications/verifyAttestationPacked.js +17 -18
- package/script/registration/verifyRegistrationResponse.d.ts +85 -0
- package/{dist → script}/registration/verifyRegistrationResponse.js +39 -38
- package/script/services/defaultRootCerts/android-key.d.ts +24 -0
- package/{dist → script}/services/defaultRootCerts/android-key.js +0 -1
- package/script/services/defaultRootCerts/android-safetynet.d.ts +11 -0
- package/{dist → script}/services/defaultRootCerts/android-safetynet.js +0 -1
- package/script/services/defaultRootCerts/apple.d.ts +11 -0
- package/{dist → script}/services/defaultRootCerts/apple.js +0 -1
- package/script/services/defaultRootCerts/mds.d.ts +11 -0
- package/{dist → script}/services/defaultRootCerts/mds.js +0 -1
- package/script/services/metadataService.d.ts +53 -0
- package/script/services/metadataService.js +277 -0
- package/script/services/settingsService.d.ts +25 -0
- package/{dist → script}/services/settingsService.js +21 -13
- package/dist/authentication/generateAuthenticationOptions.js.map +0 -1
- package/dist/authentication/verifyAuthenticationResponse.js.map +0 -1
- package/dist/helpers/convertAAGUIDToString.js.map +0 -1
- package/dist/helpers/convertCOSEtoPKCS.js.map +0 -1
- package/dist/helpers/convertCertBufferToPEM.js.map +0 -1
- package/dist/helpers/convertPEMToBytes.js.map +0 -1
- package/dist/helpers/convertX509PublicKeyToCOSE.js.map +0 -1
- package/dist/helpers/cose.js.map +0 -1
- package/dist/helpers/decodeAttestationObject.js +0 -14
- package/dist/helpers/decodeAttestationObject.js.map +0 -1
- package/dist/helpers/decodeAuthenticatorExtensions.js.map +0 -1
- package/dist/helpers/decodeClientDataJSON.js +0 -14
- package/dist/helpers/decodeClientDataJSON.js.map +0 -1
- package/dist/helpers/decodeCredentialPublicKey.d.ts +0 -2
- package/dist/helpers/decodeCredentialPublicKey.js +0 -9
- package/dist/helpers/decodeCredentialPublicKey.js.map +0 -1
- package/dist/helpers/generateChallenge.d.ts +0 -4
- package/dist/helpers/generateChallenge.js.map +0 -1
- package/dist/helpers/getCertificateInfo.js.map +0 -1
- package/dist/helpers/index.d.ts +0 -22
- package/dist/helpers/index.js +0 -60
- package/dist/helpers/index.js.map +0 -1
- package/dist/helpers/isCertRevoked.js.map +0 -1
- package/dist/helpers/iso/index.js.map +0 -1
- package/dist/helpers/iso/isoBase64URL.js.map +0 -1
- package/dist/helpers/iso/isoCBOR.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/digest.js +0 -21
- package/dist/helpers/iso/isoCrypto/digest.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/getRandomValues.js +0 -18
- package/dist/helpers/iso/isoCrypto/getRandomValues.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/importKey.js +0 -13
- package/dist/helpers/iso/isoCrypto/importKey.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/index.d.ts +0 -3
- package/dist/helpers/iso/isoCrypto/index.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/structs.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/unwrapEC2Signature.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/verify.js +0 -28
- package/dist/helpers/iso/isoCrypto/verify.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/verifyEC2.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/verifyOKP.js.map +0 -1
- package/dist/helpers/iso/isoCrypto/verifyRSA.js.map +0 -1
- package/dist/helpers/iso/isoUint8Array.js.map +0 -1
- package/dist/helpers/logging.js.map +0 -1
- package/dist/helpers/mapX509SignatureAlgToCOSEAlg.js.map +0 -1
- package/dist/helpers/matchExpectedRPID.js.map +0 -1
- package/dist/helpers/parseAuthenticatorData.js.map +0 -1
- package/dist/helpers/parseBackupFlags.js.map +0 -1
- package/dist/helpers/toHash.js.map +0 -1
- package/dist/helpers/validateCertificatePath.js.map +0 -1
- package/dist/helpers/verifySignature.js +0 -33
- package/dist/helpers/verifySignature.js.map +0 -1
- package/dist/index.d.ts +0 -17
- package/dist/index.js +0 -20
- package/dist/index.js.map +0 -1
- package/dist/metadata/mdsTypes.js.map +0 -1
- package/dist/metadata/parseJWT.js.map +0 -1
- package/dist/metadata/verifyAttestationWithMetadata.js.map +0 -1
- package/dist/metadata/verifyJWT.js +0 -42
- package/dist/metadata/verifyJWT.js.map +0 -1
- package/dist/registration/generateRegistrationOptions.js.map +0 -1
- package/dist/registration/verifications/tpm/constants.js.map +0 -1
- package/dist/registration/verifications/tpm/parseCertInfo.js.map +0 -1
- package/dist/registration/verifications/tpm/parsePubArea.js.map +0 -1
- package/dist/registration/verifications/tpm/verifyAttestationTPM.js.map +0 -1
- package/dist/registration/verifications/verifyAttestationAndroidKey.js.map +0 -1
- package/dist/registration/verifications/verifyAttestationAndroidSafetyNet.js.map +0 -1
- package/dist/registration/verifications/verifyAttestationApple.js.map +0 -1
- package/dist/registration/verifications/verifyAttestationFIDOU2F.js.map +0 -1
- package/dist/registration/verifications/verifyAttestationPacked.js.map +0 -1
- package/dist/registration/verifyRegistrationResponse.js.map +0 -1
- package/dist/services/defaultRootCerts/android-key.js.map +0 -1
- package/dist/services/defaultRootCerts/android-safetynet.js.map +0 -1
- package/dist/services/defaultRootCerts/apple.js.map +0 -1
- package/dist/services/defaultRootCerts/mds.js.map +0 -1
- package/dist/services/metadataService.js.map +0 -1
- package/dist/services/settingsService.js.map +0 -1
- /package/{dist → esm}/helpers/convertAAGUIDToString.d.ts +0 -0
- /package/{dist → esm}/helpers/convertCOSEtoPKCS.d.ts +0 -0
- /package/{dist → esm}/helpers/convertPEMToBytes.d.ts +0 -0
- /package/{dist → esm}/helpers/decodeAuthenticatorExtensions.d.ts +0 -0
- /package/{dist → esm}/helpers/iso/isoBase64URL.d.ts +0 -0
- /package/{dist → esm}/helpers/iso/isoCrypto/importKey.d.ts +0 -0
- /package/{dist → esm}/helpers/iso/isoCrypto/structs.d.ts +0 -0
- /package/{dist → esm}/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts +0 -0
- /package/{dist → esm}/helpers/iso/isoUint8Array.d.ts +0 -0
- /package/{dist → esm}/helpers/matchExpectedRPID.d.ts +0 -0
- /package/{dist → esm}/helpers/validateCertificatePath.d.ts +0 -0
- /package/{dist → esm}/metadata/parseJWT.d.ts +0 -0
- /package/{dist → esm}/metadata/verifyJWT.d.ts +0 -0
- /package/{dist → esm}/registration/verifications/tpm/constants.d.ts +0 -0
- /package/{dist → esm}/registration/verifications/tpm/parseCertInfo.d.ts +0 -0
- /package/{dist → esm}/registration/verifications/tpm/parsePubArea.d.ts +0 -0
- /package/{dist → esm}/services/defaultRootCerts/android-key.d.ts +0 -0
- /package/{dist → esm}/services/defaultRootCerts/android-safetynet.d.ts +0 -0
- /package/{dist → esm}/services/defaultRootCerts/apple.d.ts +0 -0
- /package/{dist → esm}/services/defaultRootCerts/mds.d.ts +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Hardware Attestation Root 1
|
|
3
|
+
*
|
|
4
|
+
* Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
|
|
5
|
+
* (first entry)
|
|
6
|
+
*
|
|
7
|
+
* Valid until 2026-05-24 @ 09:28 PST
|
|
8
|
+
*
|
|
9
|
+
* SHA256 Fingerprint
|
|
10
|
+
* C1:98:4A:3E:F4:5C:1E:2A:91:85:51:DE:10:60:3C:86:F7:05:1B:22:49:C4:89:1C:AE:32:30:EA:BD:0C:97:D5
|
|
11
|
+
*/
|
|
12
|
+
export const Google_Hardware_Attestation_Root_1 = `-----BEGIN CERTIFICATE-----
|
|
13
|
+
MIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
|
|
14
|
+
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyW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+
* Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
|
|
48
|
+
* (second entry)
|
|
49
|
+
*
|
|
50
|
+
* Valid until 2034-11-18 @ 12:37 PST
|
|
51
|
+
*
|
|
52
|
+
* SHA256 Fingerprint
|
|
53
|
+
* 1E:F1:A0:4B:8B:A5:8A:B9:45:89:AC:49:8C:89:82:A7:83:F2:4E:A7:30:7E:01:59:A0:C3:A7:3B:37:7D:87:CC
|
|
54
|
+
*/
|
|
55
|
+
export const Google_Hardware_Attestation_Root_2 = `-----BEGIN CERTIFICATE-----
|
|
56
|
+
MIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
|
|
57
|
+
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz
|
|
58
|
+
NzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
|
|
59
|
+
AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
|
|
60
|
+
Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
|
|
61
|
+
tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
|
|
62
|
+
nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
|
|
63
|
+
C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
|
|
64
|
+
oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
|
|
65
|
+
JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
|
|
66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eLm2UHOq6wn3esB4r2EIQKb6jTVGu5sYCcdWpXr0AUVqcABPdgL+H7qJguBw09o
|
|
81
|
+
jm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB
|
|
82
|
+
ZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH
|
|
83
|
+
ex0SdDrx+tWUDqG8At2JHA==
|
|
84
|
+
-----END CERTIFICATE-----
|
|
85
|
+
`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GlobalSign Root CA
|
|
3
|
+
*
|
|
4
|
+
* Downloaded from https://pki.goog/roots.pem
|
|
5
|
+
*
|
|
6
|
+
* Valid until 2028-01-28 @ 04:00 PST
|
|
7
|
+
*
|
|
8
|
+
* SHA256 Fingerprint
|
|
9
|
+
* EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99
|
|
10
|
+
*/
|
|
11
|
+
export const GlobalSign_Root_CA = `-----BEGIN CERTIFICATE-----
|
|
12
|
+
MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
|
|
13
|
+
A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
|
|
14
|
+
b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
|
|
15
|
+
MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
|
|
16
|
+
YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
|
|
17
|
+
aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB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|
|
3
|
+
*
|
|
4
|
+
* Downloaded from https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem
|
|
5
|
+
*
|
|
6
|
+
* Valid until 2045-03-14 @ 17:00 PST
|
|
7
|
+
*
|
|
8
|
+
* SHA256 Fingerprint
|
|
9
|
+
* 09:15:DD:5C:07:A2:8D:B5:49:D1:F6:77:BB:5A:75:D4:BF:BE:95:61:A7:73:42:43:27:76:2E:9E:02:F9:BB:29
|
|
10
|
+
*/
|
|
11
|
+
export const Apple_WebAuthn_Root_CA = `-----BEGIN CERTIFICATE-----
|
|
12
|
+
MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w
|
|
13
|
+
HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ
|
|
14
|
+
bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx
|
|
15
|
+
NTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG
|
|
16
|
+
A1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49
|
|
17
|
+
AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k
|
|
18
|
+
xu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/
|
|
19
|
+
pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk
|
|
20
|
+
2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA
|
|
21
|
+
MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3
|
|
22
|
+
jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B
|
|
23
|
+
1bWeT0vT
|
|
24
|
+
-----END CERTIFICATE-----
|
|
25
|
+
`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GlobalSign Root CA - R3
|
|
3
|
+
*
|
|
4
|
+
* Downloaded from https://valid.r3.roots.globalsign.com/
|
|
5
|
+
*
|
|
6
|
+
* Valid until 2029-03-18 @ 00:00 PST
|
|
7
|
+
*
|
|
8
|
+
* SHA256 Fingerprint
|
|
9
|
+
* CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B
|
|
10
|
+
*/
|
|
11
|
+
export const GlobalSign_Root_CA_R3 = `-----BEGIN CERTIFICATE-----
|
|
12
|
+
MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
|
|
13
|
+
A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
|
|
14
|
+
Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
|
|
15
|
+
MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
|
|
16
|
+
A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
|
|
17
|
+
hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
|
|
18
|
+
RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
|
|
19
|
+
gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
|
|
20
|
+
KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
|
|
21
|
+
QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
|
|
22
|
+
XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
|
|
23
|
+
DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
|
|
24
|
+
LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
|
|
25
|
+
RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
|
|
26
|
+
jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
|
|
27
|
+
6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
|
|
28
|
+
mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
|
|
29
|
+
Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
|
|
30
|
+
WD9f
|
|
31
|
+
-----END CERTIFICATE-----
|
|
32
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MetadataStatement } from '../metadata/mdsTypes';
|
|
1
|
+
import type { MetadataStatement } from '../metadata/mdsTypes.js';
|
|
2
2
|
type VerificationMode = 'permissive' | 'strict';
|
|
3
3
|
/**
|
|
4
4
|
* A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const convertAAGUIDToString_1 = require("../helpers/convertAAGUIDToString");
|
|
11
|
-
const settingsService_1 = require("../services/settingsService");
|
|
12
|
-
const logging_1 = require("../helpers/logging");
|
|
13
|
-
const convertPEMToBytes_1 = require("../helpers/convertPEMToBytes");
|
|
14
|
-
const parseJWT_1 = require("../metadata/parseJWT");
|
|
15
|
-
const verifyJWT_1 = require("../metadata/verifyJWT");
|
|
1
|
+
import { validateCertificatePath } from '../helpers/validateCertificatePath.js';
|
|
2
|
+
import { convertCertBufferToPEM } from '../helpers/convertCertBufferToPEM.js';
|
|
3
|
+
import { convertAAGUIDToString } from '../helpers/convertAAGUIDToString.js';
|
|
4
|
+
import { SettingsService } from './settingsService.js';
|
|
5
|
+
import { getLogger } from '../helpers/logging.js';
|
|
6
|
+
import { convertPEMToBytes } from '../helpers/convertPEMToBytes.js';
|
|
7
|
+
import { fetch } from '../helpers/fetch.js';
|
|
8
|
+
import { parseJWT } from '../metadata/parseJWT.js';
|
|
9
|
+
import { verifyJWT } from '../metadata/verifyJWT.js';
|
|
16
10
|
const defaultURLMDS = 'https://mds.fidoalliance.org/'; // v3
|
|
17
11
|
var SERVICE_STATE;
|
|
18
12
|
(function (SERVICE_STATE) {
|
|
@@ -20,19 +14,39 @@ var SERVICE_STATE;
|
|
|
20
14
|
SERVICE_STATE[SERVICE_STATE["REFRESHING"] = 1] = "REFRESHING";
|
|
21
15
|
SERVICE_STATE[SERVICE_STATE["READY"] = 2] = "READY";
|
|
22
16
|
})(SERVICE_STATE || (SERVICE_STATE = {}));
|
|
23
|
-
const log =
|
|
17
|
+
const log = getLogger('MetadataService');
|
|
24
18
|
/**
|
|
25
19
|
* A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
|
|
26
20
|
* download and parsing, and on-demand requesting and caching of individual metadata statements.
|
|
27
21
|
*
|
|
28
22
|
* https://fidoalliance.org/metadata/
|
|
29
23
|
*/
|
|
30
|
-
class BaseMetadataService {
|
|
24
|
+
export class BaseMetadataService {
|
|
31
25
|
constructor() {
|
|
32
|
-
this
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
Object.defineProperty(this, "mdsCache", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true,
|
|
30
|
+
value: {}
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(this, "statementCache", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: {}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(this, "state", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
configurable: true,
|
|
41
|
+
writable: true,
|
|
42
|
+
value: SERVICE_STATE.DISABLED
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(this, "verificationMode", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true,
|
|
47
|
+
writable: true,
|
|
48
|
+
value: 'strict'
|
|
49
|
+
});
|
|
36
50
|
}
|
|
37
51
|
/**
|
|
38
52
|
* Prepare the service to handle remote MDS servers and/or cache local metadata statements.
|
|
@@ -51,9 +65,9 @@ class BaseMetadataService {
|
|
|
51
65
|
const { mdsServers = [defaultURLMDS], statements, verificationMode } = opts;
|
|
52
66
|
this.setState(SERVICE_STATE.REFRESHING);
|
|
53
67
|
// If metadata statements are provided, load them into the cache first
|
|
54
|
-
if (statements
|
|
68
|
+
if (statements?.length) {
|
|
55
69
|
let statementsAdded = 0;
|
|
56
|
-
statements.forEach(statement => {
|
|
70
|
+
statements.forEach((statement) => {
|
|
57
71
|
// Only cache statements that are for FIDO2-compatible authenticators
|
|
58
72
|
if (statement.aaguid) {
|
|
59
73
|
this.statementCache[statement.aaguid] = {
|
|
@@ -70,7 +84,7 @@ class BaseMetadataService {
|
|
|
70
84
|
log(`Cached ${statementsAdded} local statements`);
|
|
71
85
|
}
|
|
72
86
|
// If MDS servers are provided, then process them and add their statements to the cache
|
|
73
|
-
if (mdsServers
|
|
87
|
+
if (mdsServers?.length) {
|
|
74
88
|
// Get a current count so we know how many new statements we've added from MDS servers
|
|
75
89
|
const currentCacheCount = Object.keys(this.statementCache).length;
|
|
76
90
|
let numServers = mdsServers.length;
|
|
@@ -112,7 +126,7 @@ class BaseMetadataService {
|
|
|
112
126
|
return;
|
|
113
127
|
}
|
|
114
128
|
if (aaguid instanceof Uint8Array) {
|
|
115
|
-
aaguid =
|
|
129
|
+
aaguid = convertAAGUIDToString(aaguid);
|
|
116
130
|
}
|
|
117
131
|
// If a cache refresh is in progress then pause this until the service is ready
|
|
118
132
|
await this.pauseUntilReady();
|
|
@@ -159,10 +173,10 @@ class BaseMetadataService {
|
|
|
159
173
|
async downloadBlob(mds) {
|
|
160
174
|
const { url, no } = mds;
|
|
161
175
|
// Get latest "BLOB" (FIDO's terminology, not mine)
|
|
162
|
-
const resp = await (
|
|
176
|
+
const resp = await fetch(url);
|
|
163
177
|
const data = await resp.text();
|
|
164
178
|
// Parse the JWT
|
|
165
|
-
const parsedJWT =
|
|
179
|
+
const parsedJWT = parseJWT(data);
|
|
166
180
|
const header = parsedJWT[0];
|
|
167
181
|
const payload = parsedJWT[1];
|
|
168
182
|
if (payload.no <= no) {
|
|
@@ -170,11 +184,13 @@ class BaseMetadataService {
|
|
|
170
184
|
// number of the last BLOB cached locally."
|
|
171
185
|
throw new Error(`Latest BLOB no. "${payload.no}" is not greater than previous ${no}`);
|
|
172
186
|
}
|
|
173
|
-
const headerCertsPEM = header.x5c.map(
|
|
187
|
+
const headerCertsPEM = header.x5c.map(convertCertBufferToPEM);
|
|
174
188
|
try {
|
|
175
189
|
// Validate the certificate chain
|
|
176
|
-
const rootCerts =
|
|
177
|
-
|
|
190
|
+
const rootCerts = SettingsService.getRootCertificates({
|
|
191
|
+
identifier: 'mds',
|
|
192
|
+
});
|
|
193
|
+
await validateCertificatePath(headerCertsPEM, rootCerts);
|
|
178
194
|
}
|
|
179
195
|
catch (error) {
|
|
180
196
|
const _error = error;
|
|
@@ -184,7 +200,7 @@ class BaseMetadataService {
|
|
|
184
200
|
}
|
|
185
201
|
// Verify the BLOB JWT signature
|
|
186
202
|
const leafCert = headerCertsPEM[0];
|
|
187
|
-
const verified = await
|
|
203
|
+
const verified = await verifyJWT(data, convertPEMToBytes(leafCert));
|
|
188
204
|
if (!verified) {
|
|
189
205
|
// From FIDO MDS docs: "The FIDO Server SHOULD ignore the file if the signature is invalid."
|
|
190
206
|
throw new Error('BLOB signature could not be verified');
|
|
@@ -211,9 +227,11 @@ class BaseMetadataService {
|
|
|
211
227
|
/**
|
|
212
228
|
* A helper method to pause execution until the service is ready
|
|
213
229
|
*/
|
|
214
|
-
|
|
230
|
+
pauseUntilReady() {
|
|
215
231
|
if (this.state === SERVICE_STATE.READY) {
|
|
216
|
-
return
|
|
232
|
+
return new Promise((resolve) => {
|
|
233
|
+
resolve();
|
|
234
|
+
});
|
|
217
235
|
}
|
|
218
236
|
// State isn't ready, so set up polling
|
|
219
237
|
const readyPromise = new Promise((resolve, reject) => {
|
|
@@ -251,7 +269,5 @@ class BaseMetadataService {
|
|
|
251
269
|
}
|
|
252
270
|
}
|
|
253
271
|
}
|
|
254
|
-
exports.BaseMetadataService = BaseMetadataService;
|
|
255
272
|
// Export a service singleton
|
|
256
|
-
|
|
257
|
-
//# sourceMappingURL=metadataService.js.map
|
|
273
|
+
export const MetadataService = new BaseMetadataService();
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { convertCertBufferToPEM } from '../helpers/convertCertBufferToPEM.js';
|
|
2
|
+
import { GlobalSign_Root_CA } from './defaultRootCerts/android-safetynet.js';
|
|
3
|
+
import { Google_Hardware_Attestation_Root_1, Google_Hardware_Attestation_Root_2, } from './defaultRootCerts/android-key.js';
|
|
4
|
+
import { Apple_WebAuthn_Root_CA } from './defaultRootCerts/apple.js';
|
|
5
|
+
import { GlobalSign_Root_CA_R3 } from './defaultRootCerts/mds.js';
|
|
6
|
+
class BaseSettingsService {
|
|
7
|
+
constructor() {
|
|
8
|
+
// Certificates are stored as PEM-formatted strings
|
|
9
|
+
Object.defineProperty(this, "pemCertificates", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: void 0
|
|
14
|
+
});
|
|
15
|
+
this.pemCertificates = new Map();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Set potential root certificates for attestation formats that use them. Root certs will be tried
|
|
19
|
+
* one-by-one when validating a certificate path.
|
|
20
|
+
*
|
|
21
|
+
* Certificates can be specified as a raw `Buffer`, or as a PEM-formatted string. If a
|
|
22
|
+
* `Buffer` is passed in it will be converted to PEM format.
|
|
23
|
+
*/
|
|
24
|
+
setRootCertificates(opts) {
|
|
25
|
+
const { identifier, certificates } = opts;
|
|
26
|
+
const newCertificates = [];
|
|
27
|
+
for (const cert of certificates) {
|
|
28
|
+
if (cert instanceof Uint8Array) {
|
|
29
|
+
newCertificates.push(convertCertBufferToPEM(cert));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
newCertificates.push(cert);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
this.pemCertificates.set(identifier, newCertificates);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get any registered root certificates for the specified attestation format
|
|
39
|
+
*/
|
|
40
|
+
getRootCertificates(opts) {
|
|
41
|
+
const { identifier } = opts;
|
|
42
|
+
return this.pemCertificates.get(identifier) ?? [];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export const SettingsService = new BaseSettingsService();
|
|
46
|
+
// Initialize default certificates
|
|
47
|
+
SettingsService.setRootCertificates({
|
|
48
|
+
identifier: 'android-key',
|
|
49
|
+
certificates: [
|
|
50
|
+
Google_Hardware_Attestation_Root_1,
|
|
51
|
+
Google_Hardware_Attestation_Root_2,
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
SettingsService.setRootCertificates({
|
|
55
|
+
identifier: 'android-safetynet',
|
|
56
|
+
certificates: [GlobalSign_Root_CA],
|
|
57
|
+
});
|
|
58
|
+
SettingsService.setRootCertificates({
|
|
59
|
+
identifier: 'apple',
|
|
60
|
+
certificates: [Apple_WebAuthn_Root_CA],
|
|
61
|
+
});
|
|
62
|
+
SettingsService.setRootCertificates({
|
|
63
|
+
identifier: 'mds',
|
|
64
|
+
certificates: [GlobalSign_Root_CA_R3],
|
|
65
|
+
});
|
package/package.json
CHANGED
|
@@ -1,44 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
+
"module": "./esm/index.js",
|
|
3
|
+
"main": "./script/index.js",
|
|
2
4
|
"name": "@simplewebauthn/server",
|
|
3
|
-
"version": "
|
|
5
|
+
"version": "8.0.0-alpha.0",
|
|
4
6
|
"description": "SimpleWebAuthn for Servers",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": "./dist/index.js",
|
|
9
|
-
"./helpers": "./dist/helpers/index.js"
|
|
10
|
-
},
|
|
11
|
-
"typesVersions": {
|
|
12
|
-
"*": {
|
|
13
|
-
"./dist/index.d.ts": [
|
|
14
|
-
"./dist/index.d.ts"
|
|
15
|
-
],
|
|
16
|
-
"helpers": [
|
|
17
|
-
"./dist/helpers/index.d.ts"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"author": "Matthew Miller <matthew@millerti.me>",
|
|
22
7
|
"license": "MIT",
|
|
8
|
+
"author": "Matthew Miller <matthew@millerti.me>",
|
|
23
9
|
"repository": {
|
|
24
10
|
"type": "git",
|
|
25
|
-
"url": "https://github.com/MasterKale/SimpleWebAuthn.git",
|
|
11
|
+
"url": "git+https://github.com/MasterKale/SimpleWebAuthn.git",
|
|
26
12
|
"directory": "packages/server"
|
|
27
13
|
},
|
|
28
14
|
"homepage": "https://github.com/MasterKale/SimpleWebAuthn/tree/master/packages/server#readme",
|
|
29
15
|
"publishConfig": {
|
|
30
16
|
"access": "public"
|
|
31
17
|
},
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
},
|
|
35
|
-
"scripts": {
|
|
36
|
-
"build": "rimraf dist && tsc",
|
|
37
|
-
"build:lerna-debug": "rimraf dist && tsc > output.txt; cat output.txt; rm output.txt",
|
|
38
|
-
"test": "jest",
|
|
39
|
-
"test:watch": "jest --watch",
|
|
40
|
-
"test:coverage": "npm test -- --coverage",
|
|
41
|
-
"prepublish": "npm run build"
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/MasterKale/SimpleWebAuthn/issues"
|
|
42
20
|
},
|
|
43
21
|
"keywords": [
|
|
44
22
|
"typescript",
|
|
@@ -47,20 +25,37 @@
|
|
|
47
25
|
"fido",
|
|
48
26
|
"node"
|
|
49
27
|
],
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"@types/debug": "^4.1.7",
|
|
60
|
-
"@types/node": "^18.11.9",
|
|
61
|
-
"cbor-x": "^1.4.1",
|
|
62
|
-
"cross-fetch": "^3.1.5",
|
|
63
|
-
"debug": "^4.3.2"
|
|
28
|
+
"typesVersions": {
|
|
29
|
+
"*": {
|
|
30
|
+
".": [
|
|
31
|
+
"esm/index.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"helpers": [
|
|
34
|
+
"esm/helpers/index.d.ts"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
64
37
|
},
|
|
65
|
-
"
|
|
66
|
-
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"import": "./esm/index.js",
|
|
41
|
+
"require": "./script/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./helpers": {
|
|
44
|
+
"import": "./esm/helpers/index.js",
|
|
45
|
+
"require": "./script/helpers/index.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@hexagon/base64": "^1.1.27",
|
|
50
|
+
"@peculiar/asn1-android": "^2.3.6",
|
|
51
|
+
"@peculiar/asn1-ecc": "^2.3.6",
|
|
52
|
+
"@peculiar/asn1-rsa": "^2.3.6",
|
|
53
|
+
"@peculiar/asn1-schema": "^2.3.6",
|
|
54
|
+
"@peculiar/asn1-x509": "^2.3.6",
|
|
55
|
+
"@simplewebauthn/typescript-types": "^8.0.0-alpha.0",
|
|
56
|
+
"@types/debug": "^4.1.8",
|
|
57
|
+
"cbor-x": "^1.5.2",
|
|
58
|
+
"cross-fetch": "^4.0.0",
|
|
59
|
+
"debug": "^4.3.4"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AuthenticationExtensionsClientInputs, PublicKeyCredentialDescriptorFuture, PublicKeyCredentialRequestOptionsJSON, UserVerificationRequirement } from '../deps.js';
|
|
2
|
+
export type GenerateAuthenticationOptionsOpts = {
|
|
3
|
+
allowCredentials?: PublicKeyCredentialDescriptorFuture[];
|
|
4
|
+
challenge?: string | Uint8Array;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
userVerification?: UserVerificationRequirement;
|
|
7
|
+
extensions?: AuthenticationExtensionsClientInputs;
|
|
8
|
+
rpID?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Prepare a value to pass into navigator.credentials.get(...) for authenticator "login"
|
|
12
|
+
*
|
|
13
|
+
* @param allowCredentials Authenticators previously registered by the user, if any. If undefined
|
|
14
|
+
* the client will ask the user which credential they want to use
|
|
15
|
+
* @param challenge Random value the authenticator needs to sign and pass back
|
|
16
|
+
* user for authentication
|
|
17
|
+
* @param timeout How long (in ms) the user can take to complete authentication
|
|
18
|
+
* @param userVerification Set to `'discouraged'` when asserting as part of a 2FA flow, otherwise
|
|
19
|
+
* set to `'preferred'` or `'required'` as desired.
|
|
20
|
+
* @param extensions Additional plugins the authenticator or browser should use during authentication
|
|
21
|
+
* @param rpID Valid domain name (after `https://`)
|
|
22
|
+
*/
|
|
23
|
+
export declare function generateAuthenticationOptions(options?: GenerateAuthenticationOptionsOpts): Promise<PublicKeyCredentialRequestOptionsJSON>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateAuthenticationOptions = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const index_js_1 = require("../helpers/iso/index.js");
|
|
5
|
+
const generateChallenge_js_1 = require("../helpers/generateChallenge.js");
|
|
6
6
|
/**
|
|
7
7
|
* Prepare a value to pass into navigator.credentials.get(...) for authenticator "login"
|
|
8
8
|
*
|
|
@@ -16,20 +16,20 @@ const generateChallenge_1 = require("../helpers/generateChallenge");
|
|
|
16
16
|
* @param extensions Additional plugins the authenticator or browser should use during authentication
|
|
17
17
|
* @param rpID Valid domain name (after `https://`)
|
|
18
18
|
*/
|
|
19
|
-
function generateAuthenticationOptions(options = {}) {
|
|
20
|
-
const { allowCredentials, challenge = (0,
|
|
19
|
+
async function generateAuthenticationOptions(options = {}) {
|
|
20
|
+
const { allowCredentials, challenge = await (0, generateChallenge_js_1.generateChallenge)(), timeout = 60000, userVerification = 'preferred', extensions, rpID, } = options;
|
|
21
21
|
/**
|
|
22
22
|
* Preserve ability to specify `string` values for challenges
|
|
23
23
|
*/
|
|
24
24
|
let _challenge = challenge;
|
|
25
25
|
if (typeof _challenge === 'string') {
|
|
26
|
-
_challenge =
|
|
26
|
+
_challenge = index_js_1.isoUint8Array.fromUTF8String(_challenge);
|
|
27
27
|
}
|
|
28
28
|
return {
|
|
29
|
-
challenge:
|
|
30
|
-
allowCredentials: allowCredentials
|
|
29
|
+
challenge: index_js_1.isoBase64URL.fromBuffer(_challenge),
|
|
30
|
+
allowCredentials: allowCredentials?.map((cred) => ({
|
|
31
31
|
...cred,
|
|
32
|
-
id:
|
|
32
|
+
id: index_js_1.isoBase64URL.fromBuffer(cred.id),
|
|
33
33
|
})),
|
|
34
34
|
timeout,
|
|
35
35
|
userVerification,
|
|
@@ -38,4 +38,3 @@ function generateAuthenticationOptions(options = {}) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
exports.generateAuthenticationOptions = generateAuthenticationOptions;
|
|
41
|
-
//# sourceMappingURL=generateAuthenticationOptions.js.map
|