@simplewebauthn/server 10.0.1 → 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 +1 -0
- package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map +1 -0
- package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js +2 -1
- 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/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 +1 -0
- package/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map +1 -0
- package/script/helpers/iso/isoCrypto/unwrapEC2Signature.js +4 -4
- 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 +1 -2
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRandomValues.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/getRandomValues.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAM5E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRandomValues =
|
|
3
|
+
exports.getRandomValues = getRandomValues;
|
|
4
4
|
const getWebCrypto_js_1 = require("./getWebCrypto.js");
|
|
5
5
|
/**
|
|
6
6
|
* Fill up the provided bytes array with random bytes equal to its length.
|
|
@@ -12,4 +12,3 @@ async function getRandomValues(array) {
|
|
|
12
12
|
WebCrypto.getRandomValues(array);
|
|
13
13
|
return array;
|
|
14
14
|
}
|
|
15
|
-
exports.getRandomValues = getRandomValues;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Crypto } from '
|
|
1
|
+
import type { Crypto } from '@simplewebauthn/types';
|
|
2
2
|
/**
|
|
3
3
|
* Try to get an instance of the Crypto API from the current runtime. Should support Node,
|
|
4
4
|
* as well as others, like Deno, that implement Web APIs.
|
|
@@ -11,3 +11,4 @@ export declare const _getWebCryptoInternals: {
|
|
|
11
11
|
stubThisGlobalThisCrypto: () => globalThis.Crypto;
|
|
12
12
|
setCachedCrypto: (newCrypto: Crypto | undefined) => void;
|
|
13
13
|
};
|
|
14
|
+
//# sourceMappingURL=getWebCrypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWebCrypto.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/getWebCrypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAgC9C;AAED,qBAAa,gBAAiB,SAAQ,KAAK;;CAM1C;AAGD,eAAO,MAAM,sBAAsB;;iCAGJ,MAAM,GAAG,SAAS;CAGhD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._getWebCryptoInternals = exports.MissingWebCrypto =
|
|
3
|
+
exports._getWebCryptoInternals = exports.MissingWebCrypto = void 0;
|
|
4
|
+
exports.getWebCrypto = getWebCrypto;
|
|
4
5
|
let webCrypto = undefined;
|
|
5
6
|
/**
|
|
6
7
|
* Try to get an instance of the Crypto API from the current runtime. Should support Node,
|
|
@@ -35,7 +36,6 @@ function getWebCrypto() {
|
|
|
35
36
|
});
|
|
36
37
|
return toResolve;
|
|
37
38
|
}
|
|
38
|
-
exports.getWebCrypto = getWebCrypto;
|
|
39
39
|
class MissingWebCrypto extends Error {
|
|
40
40
|
constructor() {
|
|
41
41
|
const message = 'An instance of the Crypto API could not be located';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importKey.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/importKey.ts"],"names":[],"mappings":"AAEA,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,OAAO,EAAE,UAAU,CAAC;IACpB,SAAS,EAAE,mBAAmB,GAAG,qBAAqB,GAAG,iBAAiB,CAAC;CAC5E,GAAG,OAAO,CAAC,SAAS,CAAC,CAQrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.importKey =
|
|
3
|
+
exports.importKey = importKey;
|
|
4
4
|
const getWebCrypto_js_1 = require("./getWebCrypto.js");
|
|
5
5
|
async function importKey(opts) {
|
|
6
6
|
const WebCrypto = await (0, getWebCrypto_js_1.getWebCrypto)();
|
|
@@ -9,4 +9,3 @@ async function importKey(opts) {
|
|
|
9
9
|
'verify',
|
|
10
10
|
]);
|
|
11
11
|
}
|
|
12
|
-
exports.importKey = importKey;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapCoseAlgToWebCryptoAlg.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAetE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapCoseAlgToWebCryptoAlg =
|
|
3
|
+
exports.mapCoseAlgToWebCryptoAlg = mapCoseAlgToWebCryptoAlg;
|
|
4
4
|
const cose_js_1 = require("../../cose.js");
|
|
5
5
|
/**
|
|
6
6
|
* Convert a COSE alg ID into a corresponding string value that WebCrypto APIs expect
|
|
@@ -21,4 +21,3 @@ function mapCoseAlgToWebCryptoAlg(alg) {
|
|
|
21
21
|
}
|
|
22
22
|
throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto alg`);
|
|
23
23
|
}
|
|
24
|
-
exports.mapCoseAlgToWebCryptoAlg = mapCoseAlgToWebCryptoAlg;
|
|
@@ -4,3 +4,4 @@ import { SubtleCryptoKeyAlgName } from './structs.js';
|
|
|
4
4
|
* Convert a COSE alg ID into a corresponding key algorithm string value that WebCrypto APIs expect
|
|
5
5
|
*/
|
|
6
6
|
export declare function mapCoseAlgToWebCryptoKeyAlgName(alg: COSEALG): SubtleCryptoKeyAlgName;
|
|
7
|
+
//# sourceMappingURL=mapCoseAlgToWebCryptoKeyAlgName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapCoseAlgToWebCryptoKeyAlgName.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,OAAO,GACX,sBAAsB,CAoBxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapCoseAlgToWebCryptoKeyAlgName =
|
|
3
|
+
exports.mapCoseAlgToWebCryptoKeyAlgName = mapCoseAlgToWebCryptoKeyAlgName;
|
|
4
4
|
const cose_js_1 = require("../../cose.js");
|
|
5
5
|
/**
|
|
6
6
|
* Convert a COSE alg ID into a corresponding key algorithm string value that WebCrypto APIs expect
|
|
@@ -20,4 +20,3 @@ function mapCoseAlgToWebCryptoKeyAlgName(alg) {
|
|
|
20
20
|
}
|
|
21
21
|
throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto key alg name`);
|
|
22
22
|
}
|
|
23
|
-
exports.mapCoseAlgToWebCryptoKeyAlgName = mapCoseAlgToWebCryptoKeyAlgName;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type SubtleCryptoAlg = 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
|
|
2
2
|
export type SubtleCryptoCrv = 'P-256' | 'P-384' | 'P-521' | 'Ed25519';
|
|
3
3
|
export type SubtleCryptoKeyAlgName = 'ECDSA' | 'Ed25519' | 'RSASSA-PKCS1-v1_5' | 'RSA-PSS';
|
|
4
|
+
//# sourceMappingURL=structs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structs.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/structs.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AACtE,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,SAAS,GACT,mBAAmB,GACnB,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unwrapEC2Signature.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/unwrapEC2Signature.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,GAAG,UAAU,CAelF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unwrapEC2Signature =
|
|
4
|
-
const
|
|
3
|
+
exports.unwrapEC2Signature = unwrapEC2Signature;
|
|
4
|
+
const asn1_schema_1 = require("@peculiar/asn1-schema");
|
|
5
|
+
const asn1_ecc_1 = require("@peculiar/asn1-ecc");
|
|
5
6
|
const cose_js_1 = require("../../cose.js");
|
|
6
7
|
const index_js_1 = require("../index.js");
|
|
7
8
|
/**
|
|
@@ -10,7 +11,7 @@ const index_js_1 = require("../index.js");
|
|
|
10
11
|
* See https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types
|
|
11
12
|
*/
|
|
12
13
|
function unwrapEC2Signature(signature, crv) {
|
|
13
|
-
const parsedSignature =
|
|
14
|
+
const parsedSignature = asn1_schema_1.AsnParser.parse(signature, asn1_ecc_1.ECDSASigValue);
|
|
14
15
|
const rBytes = new Uint8Array(parsedSignature.r);
|
|
15
16
|
const sBytes = new Uint8Array(parsedSignature.s);
|
|
16
17
|
const componentLength = getSignatureComponentLength(crv);
|
|
@@ -22,7 +23,6 @@ function unwrapEC2Signature(signature, crv) {
|
|
|
22
23
|
]);
|
|
23
24
|
return finalSignature;
|
|
24
25
|
}
|
|
25
|
-
exports.unwrapEC2Signature = unwrapEC2Signature;
|
|
26
26
|
/**
|
|
27
27
|
* The SubtleCrypto Web Crypto API expects ECDSA signatures with `r` and `s` values to be encoded
|
|
28
28
|
* to a specific length depending on the order of the curve. This function returns the expected
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verify =
|
|
3
|
+
exports.verify = verify;
|
|
4
4
|
const cose_js_1 = require("../../cose.js");
|
|
5
5
|
const verifyEC2_js_1 = require("./verifyEC2.js");
|
|
6
6
|
const verifyRSA_js_1 = require("./verifyRSA.js");
|
|
@@ -33,4 +33,3 @@ function verify(opts) {
|
|
|
33
33
|
const kty = cosePublicKey.get(cose_js_1.COSEKEYS.kty);
|
|
34
34
|
throw new Error(`Signature verification with public key of kty ${kty} is not supported by this method`);
|
|
35
35
|
}
|
|
36
|
-
exports.verify = verify;
|
|
@@ -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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verifyEC2 =
|
|
3
|
+
exports.verifyEC2 = verifyEC2;
|
|
4
4
|
const cose_js_1 = require("../../cose.js");
|
|
5
5
|
const mapCoseAlgToWebCryptoAlg_js_1 = require("./mapCoseAlgToWebCryptoAlg.js");
|
|
6
6
|
const importKey_js_1 = require("./importKey.js");
|
|
@@ -74,4 +74,3 @@ async function verifyEC2(opts) {
|
|
|
74
74
|
};
|
|
75
75
|
return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);
|
|
76
76
|
}
|
|
77
|
-
exports.verifyEC2 = verifyEC2;
|
|
@@ -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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verifyOKP =
|
|
3
|
+
exports.verifyOKP = verifyOKP;
|
|
4
4
|
const cose_js_1 = require("../../cose.js");
|
|
5
5
|
const index_js_1 = require("../../index.js");
|
|
6
6
|
const importKey_js_1 = require("./importKey.js");
|
|
@@ -52,4 +52,3 @@ async function verifyOKP(opts) {
|
|
|
52
52
|
};
|
|
53
53
|
return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);
|
|
54
54
|
}
|
|
55
|
-
exports.verifyOKP = verifyOKP;
|
|
@@ -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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verifyRSA =
|
|
3
|
+
exports.verifyRSA = verifyRSA;
|
|
4
4
|
const cose_js_1 = require("../../cose.js");
|
|
5
5
|
const mapCoseAlgToWebCryptoAlg_js_1 = require("./mapCoseAlgToWebCryptoAlg.js");
|
|
6
6
|
const importKey_js_1 = require("./importKey.js");
|
|
@@ -92,4 +92,3 @@ async function verifyRSA(opts) {
|
|
|
92
92
|
});
|
|
93
93
|
return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);
|
|
94
94
|
}
|
|
95
|
-
exports.verifyRSA = verifyRSA;
|
|
@@ -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"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.areEqual = areEqual;
|
|
4
|
+
exports.toHex = toHex;
|
|
5
|
+
exports.fromHex = fromHex;
|
|
6
|
+
exports.concat = concat;
|
|
7
|
+
exports.toUTF8String = toUTF8String;
|
|
8
|
+
exports.fromUTF8String = fromUTF8String;
|
|
9
|
+
exports.fromASCIIString = fromASCIIString;
|
|
10
|
+
exports.toDataView = toDataView;
|
|
4
11
|
/**
|
|
5
12
|
* Make sure two Uint8Arrays are deeply equivalent
|
|
6
13
|
*/
|
|
@@ -10,7 +17,6 @@ function areEqual(array1, array2) {
|
|
|
10
17
|
}
|
|
11
18
|
return array1.every((val, i) => val === array2[i]);
|
|
12
19
|
}
|
|
13
|
-
exports.areEqual = areEqual;
|
|
14
20
|
/**
|
|
15
21
|
* Convert a Uint8Array to Hexadecimal.
|
|
16
22
|
*
|
|
@@ -21,7 +27,6 @@ function toHex(array) {
|
|
|
21
27
|
// adce000235bcc60a648b0b25f1f05503
|
|
22
28
|
return hexParts.join('');
|
|
23
29
|
}
|
|
24
|
-
exports.toHex = toHex;
|
|
25
30
|
/**
|
|
26
31
|
* Convert a hexadecimal string to isoUint8Array.
|
|
27
32
|
*
|
|
@@ -39,7 +44,6 @@ function fromHex(hex) {
|
|
|
39
44
|
const byteStrings = hex.match(/.{1,2}/g) ?? [];
|
|
40
45
|
return Uint8Array.from(byteStrings.map((byte) => parseInt(byte, 16)));
|
|
41
46
|
}
|
|
42
|
-
exports.fromHex = fromHex;
|
|
43
47
|
/**
|
|
44
48
|
* Combine multiple Uint8Arrays into a single Uint8Array
|
|
45
49
|
*/
|
|
@@ -53,7 +57,6 @@ function concat(arrays) {
|
|
|
53
57
|
});
|
|
54
58
|
return toReturn;
|
|
55
59
|
}
|
|
56
|
-
exports.concat = concat;
|
|
57
60
|
/**
|
|
58
61
|
* Convert bytes into a UTF-8 string
|
|
59
62
|
*/
|
|
@@ -61,7 +64,6 @@ function toUTF8String(array) {
|
|
|
61
64
|
const decoder = new globalThis.TextDecoder('utf-8');
|
|
62
65
|
return decoder.decode(array);
|
|
63
66
|
}
|
|
64
|
-
exports.toUTF8String = toUTF8String;
|
|
65
67
|
/**
|
|
66
68
|
* Convert a UTF-8 string back into bytes
|
|
67
69
|
*/
|
|
@@ -69,18 +71,15 @@ function fromUTF8String(utf8String) {
|
|
|
69
71
|
const encoder = new globalThis.TextEncoder();
|
|
70
72
|
return encoder.encode(utf8String);
|
|
71
73
|
}
|
|
72
|
-
exports.fromUTF8String = fromUTF8String;
|
|
73
74
|
/**
|
|
74
75
|
* Convert an ASCII string to Uint8Array
|
|
75
76
|
*/
|
|
76
77
|
function fromASCIIString(value) {
|
|
77
78
|
return Uint8Array.from(value.split('').map((x) => x.charCodeAt(0)));
|
|
78
79
|
}
|
|
79
|
-
exports.fromASCIIString = fromASCIIString;
|
|
80
80
|
/**
|
|
81
81
|
* Prepare a DataView we can slice our way around in as we parse the bytes in a Uint8Array
|
|
82
82
|
*/
|
|
83
83
|
function toDataView(array) {
|
|
84
84
|
return new DataView(array.buffer, array.byteOffset, array.length);
|
|
85
85
|
}
|
|
86
|
-
exports.toDataView = toDataView;
|
|
@@ -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"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// import { debug, Debugger } from '../deps.ts';
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getLogger = void 0;
|
|
5
2
|
// const defaultLogger = debug('SimpleWebAuthn');
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getLogger = getLogger;
|
|
6
5
|
/**
|
|
7
6
|
* Generate an instance of a `debug` logger that extends off of the "simplewebauthn" namespace for
|
|
8
7
|
* consistent naming.
|
|
@@ -21,4 +20,3 @@ function getLogger(_name) {
|
|
|
21
20
|
// This is a noop for now while I search for a better debug logger technique
|
|
22
21
|
return (_message, ..._rest) => { };
|
|
23
22
|
}
|
|
24
|
-
exports.getLogger = getLogger;
|
|
@@ -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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapX509SignatureAlgToCOSEAlg =
|
|
3
|
+
exports.mapX509SignatureAlgToCOSEAlg = mapX509SignatureAlgToCOSEAlg;
|
|
4
4
|
const cose_js_1 = require("./cose.js");
|
|
5
5
|
/**
|
|
6
6
|
* Map X.509 signature algorithm OIDs to COSE algorithm IDs
|
|
@@ -36,4 +36,3 @@ function mapX509SignatureAlgToCOSEAlg(signatureAlgorithm) {
|
|
|
36
36
|
}
|
|
37
37
|
return alg;
|
|
38
38
|
}
|
|
39
|
-
exports.mapX509SignatureAlgToCOSEAlg = mapX509SignatureAlgToCOSEAlg;
|
|
@@ -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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.matchExpectedRPID =
|
|
3
|
+
exports.matchExpectedRPID = matchExpectedRPID;
|
|
4
4
|
const toHash_js_1 = require("./toHash.js");
|
|
5
5
|
const index_js_1 = require("./iso/index.js");
|
|
6
6
|
/**
|
|
@@ -35,7 +35,6 @@ async function matchExpectedRPID(rpIDHash, expectedRPIDs) {
|
|
|
35
35
|
throw err;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
exports.matchExpectedRPID = matchExpectedRPID;
|
|
39
38
|
class UnexpectedRPIDHash extends Error {
|
|
40
39
|
constructor() {
|
|
41
40
|
const message = 'Unexpected RP ID hash';
|
|
@@ -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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._parseAuthenticatorDataInternals =
|
|
3
|
+
exports._parseAuthenticatorDataInternals = void 0;
|
|
4
|
+
exports.parseAuthenticatorData = parseAuthenticatorData;
|
|
4
5
|
const decodeAuthenticatorExtensions_js_1 = require("./decodeAuthenticatorExtensions.js");
|
|
5
6
|
const index_js_1 = require("./iso/index.js");
|
|
6
7
|
/**
|
|
@@ -18,12 +19,12 @@ function parseAuthenticatorData(authData) {
|
|
|
18
19
|
// Bit positions can be referenced here:
|
|
19
20
|
// https://www.w3.org/TR/webauthn-2/#flags
|
|
20
21
|
const flags = {
|
|
21
|
-
up: !!(flagsInt & (1 << 0)),
|
|
22
|
-
uv: !!(flagsInt & (1 << 2)),
|
|
23
|
-
be: !!(flagsInt & (1 << 3)),
|
|
24
|
-
bs: !!(flagsInt & (1 << 4)),
|
|
25
|
-
at: !!(flagsInt & (1 << 6)),
|
|
26
|
-
ed: !!(flagsInt & (1 << 7)),
|
|
22
|
+
up: !!(flagsInt & (1 << 0)), // User Presence
|
|
23
|
+
uv: !!(flagsInt & (1 << 2)), // User Verified
|
|
24
|
+
be: !!(flagsInt & (1 << 3)), // Backup Eligibility
|
|
25
|
+
bs: !!(flagsInt & (1 << 4)), // Backup State
|
|
26
|
+
at: !!(flagsInt & (1 << 6)), // Attested Credential Data Present
|
|
27
|
+
ed: !!(flagsInt & (1 << 7)), // Extension Data Present
|
|
27
28
|
flagsInt,
|
|
28
29
|
};
|
|
29
30
|
const counterBuf = authData.slice(pointer, pointer + 4);
|
|
@@ -100,7 +101,6 @@ function parseAuthenticatorData(authData) {
|
|
|
100
101
|
extensionsDataBuffer,
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
|
-
exports.parseAuthenticatorData = parseAuthenticatorData;
|
|
104
104
|
// Make it possible to stub the return value during testing
|
|
105
105
|
exports._parseAuthenticatorDataInternals = {
|
|
106
106
|
stubThis: (value) => value,
|
|
@@ -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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InvalidBackupFlags =
|
|
3
|
+
exports.InvalidBackupFlags = void 0;
|
|
4
|
+
exports.parseBackupFlags = parseBackupFlags;
|
|
4
5
|
/**
|
|
5
6
|
* Make sense of Bits 3 and 4 in authenticator indicating:
|
|
6
7
|
*
|
|
@@ -20,7 +21,6 @@ function parseBackupFlags({ be, bs }) {
|
|
|
20
21
|
}
|
|
21
22
|
return { credentialDeviceType, credentialBackedUp };
|
|
22
23
|
}
|
|
23
|
-
exports.parseBackupFlags = parseBackupFlags;
|
|
24
24
|
class InvalidBackupFlags extends Error {
|
|
25
25
|
constructor(message) {
|
|
26
26
|
super(message);
|
|
@@ -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"}
|
package/script/helpers/toHash.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toHash =
|
|
3
|
+
exports.toHash = toHash;
|
|
4
4
|
const index_js_1 = require("./iso/index.js");
|
|
5
5
|
/**
|
|
6
6
|
* Returns hash digest of the given data, using the given algorithm when provided. Defaults to using
|
|
@@ -13,4 +13,3 @@ function toHash(data, algorithm = -7) {
|
|
|
13
13
|
const digest = index_js_1.isoCrypto.digest(data, algorithm);
|
|
14
14
|
return digest;
|
|
15
15
|
}
|
|
16
|
-
exports.toHash = toHash;
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateCertificatePath =
|
|
4
|
-
const
|
|
3
|
+
exports.validateCertificatePath = validateCertificatePath;
|
|
4
|
+
const asn1_schema_1 = require("@peculiar/asn1-schema");
|
|
5
5
|
const isCertRevoked_js_1 = require("./isCertRevoked.js");
|
|
6
6
|
const verifySignature_js_1 = require("./verifySignature.js");
|
|
7
7
|
const mapX509SignatureAlgToCOSEAlg_js_1 = require("./mapX509SignatureAlgToCOSEAlg.js");
|
|
@@ -51,7 +51,6 @@ async function validateCertificatePath(certificates, rootCertificates = []) {
|
|
|
51
51
|
}
|
|
52
52
|
return true;
|
|
53
53
|
}
|
|
54
|
-
exports.validateCertificatePath = validateCertificatePath;
|
|
55
54
|
async function _validatePath(certificates) {
|
|
56
55
|
if (new Set(certificates).size !== certificates.length) {
|
|
57
56
|
throw new Error('Invalid certificate path: found duplicate certificates');
|
|
@@ -94,7 +93,7 @@ async function _validatePath(certificates) {
|
|
|
94
93
|
throw new InvalidSubjectAndIssuer();
|
|
95
94
|
}
|
|
96
95
|
// Verify the subject certificate's signature with the issuer cert's public key
|
|
97
|
-
const data =
|
|
96
|
+
const data = asn1_schema_1.AsnSerializer.serialize(x509Subject.tbsCertificate);
|
|
98
97
|
const signature = x509Subject.signatureValue;
|
|
99
98
|
const signatureAlgorithm = (0, mapX509SignatureAlgToCOSEAlg_js_1.mapX509SignatureAlgToCOSEAlg)(x509Subject.signatureAlgorithm.algorithm);
|
|
100
99
|
const issuerCertBytes = (0, convertPEMToBytes_js_1.convertPEMToBytes)(issuerPem);
|
|
@@ -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"}
|