@simplewebauthn/server 11.0.0 → 12.0.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/README.md +12 -13
- package/esm/authentication/generateAuthenticationOptions.d.ts +2 -1
- package/esm/authentication/generateAuthenticationOptions.d.ts.map +1 -0
- package/esm/authentication/verifyAuthenticationResponse.d.ts +2 -1
- package/esm/authentication/verifyAuthenticationResponse.d.ts.map +1 -0
- 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 +1 -0
- 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 +2 -1
- package/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts.map +1 -0
- package/esm/helpers/validateExtFIDOGenCEAAGUID.js +1 -1
- 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 +4 -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 +2 -1
- 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/verifyRegistrationResponse.d.ts +2 -1
- package/esm/registration/verifyRegistrationResponse.d.ts.map +1 -0
- 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 +2 -1
- package/script/authentication/verifyAuthenticationResponse.d.ts.map +1 -0
- package/script/authentication/verifyAuthenticationResponse.js +1 -2
- 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 +1 -0
- 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 +2 -1
- package/script/helpers/validateExtFIDOGenCEAAGUID.d.ts.map +1 -0
- package/script/helpers/validateExtFIDOGenCEAAGUID.js +3 -4
- 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 +4 -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 +8 -8
- 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 +1 -2
- package/script/registration/verifyRegistrationResponse.d.ts +2 -1
- package/script/registration/verifyRegistrationResponse.d.ts.map +1 -0
- package/script/registration/verifyRegistrationResponse.js +1 -2
- 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 -70
package/package.json
CHANGED
|
@@ -1,33 +1,43 @@
|
|
|
1
1
|
{
|
|
2
|
-
"module": "./esm/index.js",
|
|
3
|
-
"main": "./script/index.js",
|
|
4
2
|
"name": "@simplewebauthn/server",
|
|
5
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
6
4
|
"description": "SimpleWebAuthn for Servers",
|
|
7
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"typescript",
|
|
7
|
+
"webauthn",
|
|
8
|
+
"passkeys",
|
|
9
|
+
"fido",
|
|
10
|
+
"node"
|
|
11
|
+
],
|
|
8
12
|
"author": "Matthew Miller <matthew@millerti.me>",
|
|
13
|
+
"homepage": "https://github.com/MasterKale/SimpleWebAuthn/tree/master/packages/server#readme",
|
|
9
14
|
"repository": {
|
|
10
15
|
"type": "git",
|
|
11
16
|
"url": "git+https://github.com/MasterKale/SimpleWebAuthn.git",
|
|
12
17
|
"directory": "packages/server"
|
|
13
18
|
},
|
|
14
|
-
"
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/MasterKale/SimpleWebAuthn/issues"
|
|
22
|
+
},
|
|
23
|
+
"main": "./script/index.js",
|
|
24
|
+
"module": "./esm/index.js",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"import": "./esm/index.js",
|
|
28
|
+
"require": "./script/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./helpers": {
|
|
31
|
+
"import": "./esm/helpers/index.js",
|
|
32
|
+
"require": "./script/helpers/index.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
15
35
|
"publishConfig": {
|
|
16
36
|
"access": "public"
|
|
17
37
|
},
|
|
18
38
|
"engines": {
|
|
19
39
|
"node": ">=20.0.0"
|
|
20
40
|
},
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/MasterKale/SimpleWebAuthn/issues"
|
|
23
|
-
},
|
|
24
|
-
"keywords": [
|
|
25
|
-
"typescript",
|
|
26
|
-
"webauthn",
|
|
27
|
-
"passkeys",
|
|
28
|
-
"fido",
|
|
29
|
-
"node"
|
|
30
|
-
],
|
|
31
41
|
"typesVersions": {
|
|
32
42
|
"*": {
|
|
33
43
|
".": [
|
|
@@ -38,16 +48,6 @@
|
|
|
38
48
|
]
|
|
39
49
|
}
|
|
40
50
|
},
|
|
41
|
-
"exports": {
|
|
42
|
-
".": {
|
|
43
|
-
"import": "./esm/index.js",
|
|
44
|
-
"require": "./script/index.js"
|
|
45
|
-
},
|
|
46
|
-
"./helpers": {
|
|
47
|
-
"import": "./esm/helpers/index.js",
|
|
48
|
-
"require": "./script/helpers/index.js"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@hexagon/base64": "^1.1.27",
|
|
53
53
|
"@levischuck/tiny-cbor": "^0.2.2",
|
|
@@ -56,15 +56,11 @@
|
|
|
56
56
|
"@peculiar/asn1-rsa": "^2.3.8",
|
|
57
57
|
"@peculiar/asn1-schema": "^2.3.8",
|
|
58
58
|
"@peculiar/asn1-x509": "^2.3.8",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
59
|
+
"cross-fetch": "^4.0.0",
|
|
60
|
+
"@simplewebauthn/types": "^12.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@types/node": "^
|
|
64
|
-
"picocolors": "^1.0.0",
|
|
65
|
-
"@deno/shim-deno-test": "~0.4.0"
|
|
63
|
+
"@types/node": "^20.9.0"
|
|
66
64
|
},
|
|
67
|
-
"
|
|
68
|
-
"test": "node test_runner.js"
|
|
69
|
-
}
|
|
65
|
+
"_generatedBy": "dnt@dev"
|
|
70
66
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthenticationExtensionsClientInputs, AuthenticatorTransportFuture, Base64URLString, PublicKeyCredentialRequestOptionsJSON, UserVerificationRequirement } from '
|
|
1
|
+
import type { AuthenticationExtensionsClientInputs, AuthenticatorTransportFuture, Base64URLString, PublicKeyCredentialRequestOptionsJSON, UserVerificationRequirement } from '@simplewebauthn/types';
|
|
2
2
|
export type GenerateAuthenticationOptionsOpts = {
|
|
3
3
|
rpID: string;
|
|
4
4
|
allowCredentials?: {
|
|
@@ -23,3 +23,4 @@ export type GenerateAuthenticationOptionsOpts = {
|
|
|
23
23
|
* @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during authentication
|
|
24
24
|
*/
|
|
25
25
|
export declare function generateAuthenticationOptions(options: GenerateAuthenticationOptionsOpts): Promise<PublicKeyCredentialRequestOptionsJSON>;
|
|
26
|
+
//# sourceMappingURL=generateAuthenticationOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateAuthenticationOptions.d.ts","sourceRoot":"","sources":["../../src/authentication/generateAuthenticationOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oCAAoC,EACpC,4BAA4B,EAC5B,eAAe,EACf,qCAAqC,EACrC,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAK/B,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE;QACjB,EAAE,EAAE,eAAe,CAAC;QACpB,UAAU,CAAC,EAAE,4BAA4B,EAAE,CAAC;KAC7C,EAAE,CAAC;IACJ,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;IAC/C,UAAU,CAAC,EAAE,oCAAoC,CAAC;CACnD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC,qCAAqC,CAAC,CAoChD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateAuthenticationOptions =
|
|
3
|
+
exports.generateAuthenticationOptions = generateAuthenticationOptions;
|
|
4
4
|
const index_js_1 = require("../helpers/iso/index.js");
|
|
5
5
|
const generateChallenge_js_1 = require("../helpers/generateChallenge.js");
|
|
6
6
|
/**
|
|
@@ -42,4 +42,3 @@ async function generateAuthenticationOptions(options) {
|
|
|
42
42
|
extensions,
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
exports.generateAuthenticationOptions = generateAuthenticationOptions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthenticationResponseJSON, Base64URLString, CredentialDeviceType, UserVerificationRequirement, WebAuthnCredential } from '
|
|
1
|
+
import type { AuthenticationResponseJSON, Base64URLString, CredentialDeviceType, UserVerificationRequirement, WebAuthnCredential } from '@simplewebauthn/types';
|
|
2
2
|
import { AuthenticationExtensionsAuthenticatorOutputs } from '../helpers/decodeAuthenticatorExtensions.js';
|
|
3
3
|
export type VerifyAuthenticationResponseOpts = {
|
|
4
4
|
response: AuthenticationResponseJSON;
|
|
@@ -61,3 +61,4 @@ export type VerifiedAuthenticationResponse = {
|
|
|
61
61
|
authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs;
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
+
//# sourceMappingURL=verifyAuthenticationResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyAuthenticationResponse.d.ts","sourceRoot":"","sources":["../../src/authentication/verifyAuthenticationResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,eAAe,EACf,oBAAoB,EACpB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAAE,4CAA4C,EAAE,MAAM,6CAA6C,CAAC;AAI3G,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,EAAE,0BAA0B,CAAC;IACrC,iBAAiB,EAAE,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAChF,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,kBAAkB,CAAC,EAAE;QACnB,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;KAChD,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,gCAAgC,GACxC,OAAO,CAAC,8BAA8B,CAAC,CAmNzC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE;QAClB,YAAY,EAAE,eAAe,CAAC;QAC9B,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,OAAO,CAAC;QACtB,oBAAoB,EAAE,oBAAoB,CAAC;QAC3C,kBAAkB,EAAE,OAAO,CAAC;QAC5B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,6BAA6B,CAAC,EAAE,4CAA4C,CAAC;KAC9E,CAAC;CACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verifyAuthenticationResponse =
|
|
3
|
+
exports.verifyAuthenticationResponse = verifyAuthenticationResponse;
|
|
4
4
|
const decodeClientDataJSON_js_1 = require("../helpers/decodeClientDataJSON.js");
|
|
5
5
|
const toHash_js_1 = require("../helpers/toHash.js");
|
|
6
6
|
const verifySignature_js_1 = require("../helpers/verifySignature.js");
|
|
@@ -172,4 +172,3 @@ async function verifyAuthenticationResponse(options) {
|
|
|
172
172
|
};
|
|
173
173
|
return toReturn;
|
|
174
174
|
}
|
|
175
|
-
exports.verifyAuthenticationResponse = verifyAuthenticationResponse;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertAAGUIDToString.d.ts","sourceRoot":"","sources":["../../src/helpers/convertAAGUIDToString.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAchE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertAAGUIDToString =
|
|
3
|
+
exports.convertAAGUIDToString = convertAAGUIDToString;
|
|
4
4
|
const index_js_1 = require("./iso/index.js");
|
|
5
5
|
/**
|
|
6
6
|
* Convert the aaguid buffer in authData into a UUID string
|
|
@@ -9,13 +9,12 @@ function convertAAGUIDToString(aaguid) {
|
|
|
9
9
|
// Raw Hex: adce000235bcc60a648b0b25f1f05503
|
|
10
10
|
const hex = index_js_1.isoUint8Array.toHex(aaguid);
|
|
11
11
|
const segments = [
|
|
12
|
-
hex.slice(0, 8),
|
|
13
|
-
hex.slice(8, 12),
|
|
14
|
-
hex.slice(12, 16),
|
|
15
|
-
hex.slice(16, 20),
|
|
12
|
+
hex.slice(0, 8), // 8
|
|
13
|
+
hex.slice(8, 12), // 4
|
|
14
|
+
hex.slice(12, 16), // 4
|
|
15
|
+
hex.slice(16, 20), // 4
|
|
16
16
|
hex.slice(20, 32), // 8
|
|
17
17
|
];
|
|
18
18
|
// Formatted: adce0002-35bc-c60a-648b-0b25f1f05503
|
|
19
19
|
return segments.join('-');
|
|
20
20
|
}
|
|
21
|
-
exports.convertAAGUIDToString = convertAAGUIDToString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertCOSEtoPKCS.d.ts","sourceRoot":"","sources":["../../src/helpers/convertCOSEtoPKCS.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,CAmBvE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertCOSEtoPKCS =
|
|
3
|
+
exports.convertCOSEtoPKCS = convertCOSEtoPKCS;
|
|
4
4
|
const index_js_1 = require("./iso/index.js");
|
|
5
5
|
const cose_js_1 = require("./cose.js");
|
|
6
6
|
/**
|
|
@@ -22,4 +22,3 @@ function convertCOSEtoPKCS(cosePublicKey) {
|
|
|
22
22
|
}
|
|
23
23
|
return index_js_1.isoUint8Array.concat([tag, x]);
|
|
24
24
|
}
|
|
25
|
-
exports.convertCOSEtoPKCS = convertCOSEtoPKCS;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Base64URLString } from '
|
|
1
|
+
import type { Base64URLString } from '@simplewebauthn/types';
|
|
2
2
|
/**
|
|
3
3
|
* Convert buffer to an OpenSSL-compatible PEM text format.
|
|
4
4
|
*/
|
|
5
5
|
export declare function convertCertBufferToPEM(certBuffer: Uint8Array | Base64URLString): string;
|
|
6
|
+
//# sourceMappingURL=convertCertBufferToPEM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertCertBufferToPEM.d.ts","sourceRoot":"","sources":["../../src/helpers/convertCertBufferToPEM.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,UAAU,GAAG,eAAe,GACvC,MAAM,CA4BR"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertCertBufferToPEM =
|
|
3
|
+
exports.convertCertBufferToPEM = convertCertBufferToPEM;
|
|
4
4
|
const index_js_1 = require("./iso/index.js");
|
|
5
5
|
/**
|
|
6
6
|
* Convert buffer to an OpenSSL-compatible PEM text format.
|
|
@@ -32,4 +32,3 @@ function convertCertBufferToPEM(certBuffer) {
|
|
|
32
32
|
PEMKey = `-----BEGIN CERTIFICATE-----\n${PEMKey}-----END CERTIFICATE-----\n`;
|
|
33
33
|
return PEMKey;
|
|
34
34
|
}
|
|
35
|
-
exports.convertCertBufferToPEM = convertCertBufferToPEM;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertPEMToBytes.d.ts","sourceRoot":"","sources":["../../src/helpers/convertPEMToBytes.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAOzD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertPEMToBytes =
|
|
3
|
+
exports.convertPEMToBytes = convertPEMToBytes;
|
|
4
4
|
const index_js_1 = require("./iso/index.js");
|
|
5
5
|
/**
|
|
6
6
|
* Take a certificate in PEM format and convert it to bytes
|
|
@@ -12,4 +12,3 @@ function convertPEMToBytes(pem) {
|
|
|
12
12
|
.replace(/[\n ]/g, '');
|
|
13
13
|
return index_js_1.isoBase64URL.toBuffer(certBase64, 'base64');
|
|
14
14
|
}
|
|
15
|
-
exports.convertPEMToBytes = convertPEMToBytes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertX509PublicKeyToCOSE.d.ts","sourceRoot":"","sources":["../../src/helpers/convertX509PublicKeyToCOSE.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,aAAa,EAGd,MAAM,WAAW,CAAC;AAKnB,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,UAAU,GAC1B,aAAa,CA+Ff"}
|
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertX509PublicKeyToCOSE =
|
|
4
|
-
const
|
|
3
|
+
exports.convertX509PublicKeyToCOSE = convertX509PublicKeyToCOSE;
|
|
4
|
+
const asn1_schema_1 = require("@peculiar/asn1-schema");
|
|
5
|
+
const asn1_x509_1 = require("@peculiar/asn1-x509");
|
|
6
|
+
const asn1_ecc_1 = require("@peculiar/asn1-ecc");
|
|
5
7
|
const cose_js_1 = require("./cose.js");
|
|
8
|
+
const asn1_rsa_1 = require("@peculiar/asn1-rsa");
|
|
6
9
|
const mapX509SignatureAlgToCOSEAlg_js_1 = require("./mapX509SignatureAlgToCOSEAlg.js");
|
|
7
10
|
function convertX509PublicKeyToCOSE(x509Certificate) {
|
|
8
11
|
let cosePublicKey = new Map();
|
|
9
12
|
/**
|
|
10
13
|
* Time to extract the public key from an X.509 certificate
|
|
11
14
|
*/
|
|
12
|
-
const x509 =
|
|
15
|
+
const x509 = asn1_schema_1.AsnParser.parse(x509Certificate, asn1_x509_1.Certificate);
|
|
13
16
|
const { tbsCertificate } = x509;
|
|
14
17
|
const { subjectPublicKeyInfo, signature: _tbsSignature } = tbsCertificate;
|
|
15
18
|
const signatureAlgorithm = _tbsSignature.algorithm;
|
|
16
19
|
const publicKeyAlgorithmID = subjectPublicKeyInfo.algorithm.algorithm;
|
|
17
|
-
if (publicKeyAlgorithmID ===
|
|
20
|
+
if (publicKeyAlgorithmID === asn1_ecc_1.id_ecPublicKey) {
|
|
18
21
|
/**
|
|
19
22
|
* EC2 Public Key
|
|
20
23
|
*/
|
|
21
24
|
if (!subjectPublicKeyInfo.algorithm.parameters) {
|
|
22
25
|
throw new Error('Certificate public key was missing parameters (EC2)');
|
|
23
26
|
}
|
|
24
|
-
const ecParameters =
|
|
27
|
+
const ecParameters = asn1_schema_1.AsnParser.parse(new Uint8Array(subjectPublicKeyInfo.algorithm.parameters), asn1_ecc_1.ECParameters);
|
|
25
28
|
let crv = -999;
|
|
26
29
|
const { namedCurve } = ecParameters;
|
|
27
|
-
if (namedCurve ===
|
|
30
|
+
if (namedCurve === asn1_ecc_1.id_secp256r1) {
|
|
28
31
|
crv = cose_js_1.COSECRV.P256;
|
|
29
32
|
}
|
|
30
|
-
else if (namedCurve ===
|
|
33
|
+
else if (namedCurve === asn1_ecc_1.id_secp384r1) {
|
|
31
34
|
crv = cose_js_1.COSECRV.P384;
|
|
32
35
|
}
|
|
33
36
|
else {
|
|
@@ -58,7 +61,7 @@ function convertX509PublicKeyToCOSE(x509Certificate) {
|
|
|
58
61
|
/**
|
|
59
62
|
* RSA public key
|
|
60
63
|
*/
|
|
61
|
-
const rsaPublicKey =
|
|
64
|
+
const rsaPublicKey = asn1_schema_1.AsnParser.parse(subjectPublicKeyInfo.subjectPublicKey, asn1_rsa_1.RSAPublicKey);
|
|
62
65
|
const coseRSAPubKey = new Map();
|
|
63
66
|
coseRSAPubKey.set(cose_js_1.COSEKEYS.kty, cose_js_1.COSEKTY.RSA);
|
|
64
67
|
coseRSAPubKey.set(cose_js_1.COSEKEYS.alg, (0, mapX509SignatureAlgToCOSEAlg_js_1.mapX509SignatureAlgToCOSEAlg)(signatureAlgorithm));
|
|
@@ -71,4 +74,3 @@ function convertX509PublicKeyToCOSE(x509Certificate) {
|
|
|
71
74
|
}
|
|
72
75
|
return cosePublicKey;
|
|
73
76
|
}
|
|
74
|
-
exports.convertX509PublicKeyToCOSE = convertX509PublicKeyToCOSE;
|
package/script/helpers/cose.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cose.d.ts","sourceRoot":"","sources":["../../src/helpers/cose.ts"],"names":[],"mappings":"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"}
|
package/script/helpers/cose.js
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.COSEALG = exports.COSECRV = exports.COSEKTY = exports.COSEKEYS = void 0;
|
|
4
|
+
exports.isCOSEPublicKeyOKP = isCOSEPublicKeyOKP;
|
|
5
|
+
exports.isCOSEPublicKeyEC2 = isCOSEPublicKeyEC2;
|
|
6
|
+
exports.isCOSEPublicKeyRSA = isCOSEPublicKeyRSA;
|
|
7
|
+
exports.isCOSEKty = isCOSEKty;
|
|
8
|
+
exports.isCOSECrv = isCOSECrv;
|
|
9
|
+
exports.isCOSEAlg = isCOSEAlg;
|
|
4
10
|
function isCOSEPublicKeyOKP(cosePublicKey) {
|
|
5
11
|
const kty = cosePublicKey.get(COSEKEYS.kty);
|
|
6
12
|
return isCOSEKty(kty) && kty === COSEKTY.OKP;
|
|
7
13
|
}
|
|
8
|
-
exports.isCOSEPublicKeyOKP = isCOSEPublicKeyOKP;
|
|
9
14
|
function isCOSEPublicKeyEC2(cosePublicKey) {
|
|
10
15
|
const kty = cosePublicKey.get(COSEKEYS.kty);
|
|
11
16
|
return isCOSEKty(kty) && kty === COSEKTY.EC2;
|
|
12
17
|
}
|
|
13
|
-
exports.isCOSEPublicKeyEC2 = isCOSEPublicKeyEC2;
|
|
14
18
|
function isCOSEPublicKeyRSA(cosePublicKey) {
|
|
15
19
|
const kty = cosePublicKey.get(COSEKEYS.kty);
|
|
16
20
|
return isCOSEKty(kty) && kty === COSEKTY.RSA;
|
|
17
21
|
}
|
|
18
|
-
exports.isCOSEPublicKeyRSA = isCOSEPublicKeyRSA;
|
|
19
22
|
/**
|
|
20
23
|
* COSE Keys
|
|
21
24
|
*
|
|
@@ -31,7 +34,7 @@ var COSEKEYS;
|
|
|
31
34
|
COSEKEYS[COSEKEYS["y"] = -3] = "y";
|
|
32
35
|
COSEKEYS[COSEKEYS["n"] = -1] = "n";
|
|
33
36
|
COSEKEYS[COSEKEYS["e"] = -2] = "e";
|
|
34
|
-
})(COSEKEYS
|
|
37
|
+
})(COSEKEYS || (exports.COSEKEYS = COSEKEYS = {}));
|
|
35
38
|
/**
|
|
36
39
|
* COSE Key Types
|
|
37
40
|
*
|
|
@@ -42,11 +45,10 @@ var COSEKTY;
|
|
|
42
45
|
COSEKTY[COSEKTY["OKP"] = 1] = "OKP";
|
|
43
46
|
COSEKTY[COSEKTY["EC2"] = 2] = "EC2";
|
|
44
47
|
COSEKTY[COSEKTY["RSA"] = 3] = "RSA";
|
|
45
|
-
})(COSEKTY
|
|
48
|
+
})(COSEKTY || (exports.COSEKTY = COSEKTY = {}));
|
|
46
49
|
function isCOSEKty(kty) {
|
|
47
50
|
return Object.values(COSEKTY).indexOf(kty) >= 0;
|
|
48
51
|
}
|
|
49
|
-
exports.isCOSEKty = isCOSEKty;
|
|
50
52
|
/**
|
|
51
53
|
* COSE Curves
|
|
52
54
|
*
|
|
@@ -59,11 +61,10 @@ var COSECRV;
|
|
|
59
61
|
COSECRV[COSECRV["P521"] = 3] = "P521";
|
|
60
62
|
COSECRV[COSECRV["ED25519"] = 6] = "ED25519";
|
|
61
63
|
COSECRV[COSECRV["SECP256K1"] = 8] = "SECP256K1";
|
|
62
|
-
})(COSECRV
|
|
64
|
+
})(COSECRV || (exports.COSECRV = COSECRV = {}));
|
|
63
65
|
function isCOSECrv(crv) {
|
|
64
66
|
return Object.values(COSECRV).indexOf(crv) >= 0;
|
|
65
67
|
}
|
|
66
|
-
exports.isCOSECrv = isCOSECrv;
|
|
67
68
|
/**
|
|
68
69
|
* COSE Algorithms
|
|
69
70
|
*
|
|
@@ -83,8 +84,7 @@ var COSEALG;
|
|
|
83
84
|
COSEALG[COSEALG["RS384"] = -258] = "RS384";
|
|
84
85
|
COSEALG[COSEALG["RS512"] = -259] = "RS512";
|
|
85
86
|
COSEALG[COSEALG["RS1"] = -65535] = "RS1";
|
|
86
|
-
})(COSEALG
|
|
87
|
+
})(COSEALG || (exports.COSEALG = COSEALG = {}));
|
|
87
88
|
function isCOSEAlg(alg) {
|
|
88
89
|
return Object.values(COSEALG).indexOf(alg) >= 0;
|
|
89
90
|
}
|
|
90
|
-
exports.isCOSEAlg = isCOSEAlg;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decodeAttestationObject.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeAttestationObject.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,iBAAiB,EAAE,UAAU,GAC5B,iBAAiB,CAInB;AAED,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,QAAQ,GACR,mBAAmB,GACnB,aAAa,GACb,KAAK,GACL,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,iBAAiB,CAAC;IACnC,GAAG,CAAC,GAAG,EAAE,SAAS,GAAG,oBAAoB,CAAC;IAC1C,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;IACxC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,UAAU,EAAE,GAAG,SAAS,CAAC;IAC1C,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,GAAG,CAAC,GAAG,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAE5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAGF,eAAO,MAAM,iCAAiC;sBAC1B,iBAAiB;CACpC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._decodeAttestationObjectInternals =
|
|
3
|
+
exports._decodeAttestationObjectInternals = void 0;
|
|
4
|
+
exports.decodeAttestationObject = decodeAttestationObject;
|
|
4
5
|
const index_js_1 = require("./iso/index.js");
|
|
5
6
|
/**
|
|
6
7
|
* Convert an AttestationObject buffer to a proper object
|
|
@@ -10,7 +11,6 @@ const index_js_1 = require("./iso/index.js");
|
|
|
10
11
|
function decodeAttestationObject(attestationObject) {
|
|
11
12
|
return exports._decodeAttestationObjectInternals.stubThis(index_js_1.isoCBOR.decodeFirst(attestationObject));
|
|
12
13
|
}
|
|
13
|
-
exports.decodeAttestationObject = decodeAttestationObject;
|
|
14
14
|
// Make it possible to stub the return value during testing
|
|
15
15
|
exports._decodeAttestationObjectInternals = {
|
|
16
16
|
stubThis: (value) => value,
|
|
@@ -8,3 +8,4 @@ export declare function decodeAuthenticatorExtensions(extensionData: Uint8Array)
|
|
|
8
8
|
* Attempt to support authenticator extensions we might not know about in WebAuthn
|
|
9
9
|
*/
|
|
10
10
|
export type AuthenticationExtensionsAuthenticatorOutputs = unknown;
|
|
11
|
+
//# sourceMappingURL=decodeAuthenticatorExtensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decodeAuthenticatorExtensions.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeAuthenticatorExtensions.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,EAAE,UAAU,GACxB,4CAA4C,GAAG,SAAS,CAU1D;AAED;;GAEG;AACH,MAAM,MAAM,4CAA4C,GAAG,OAAO,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decodeAuthenticatorExtensions =
|
|
3
|
+
exports.decodeAuthenticatorExtensions = decodeAuthenticatorExtensions;
|
|
4
4
|
const index_js_1 = require("./iso/index.js");
|
|
5
5
|
/**
|
|
6
6
|
* Convert authenticator extension data buffer to a proper object
|
|
@@ -18,7 +18,6 @@ function decodeAuthenticatorExtensions(extensionData) {
|
|
|
18
18
|
}
|
|
19
19
|
return convertMapToObjectDeep(toCBOR);
|
|
20
20
|
}
|
|
21
|
-
exports.decodeAuthenticatorExtensions = decodeAuthenticatorExtensions;
|
|
22
21
|
/**
|
|
23
22
|
* CBOR-encoded extensions can be deeply-nested Maps, which are too deep for a simple
|
|
24
23
|
* `Object.entries()`. This method will recursively make sure that all Maps are converted into
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Base64URLString } from '
|
|
1
|
+
import type { Base64URLString } from '@simplewebauthn/types';
|
|
2
2
|
/**
|
|
3
3
|
* Decode an authenticator's base64url-encoded clientDataJSON to JSON
|
|
4
4
|
*/
|
|
@@ -16,3 +16,4 @@ export type ClientDataJSON = {
|
|
|
16
16
|
export declare const _decodeClientDataJSONInternals: {
|
|
17
17
|
stubThis: (value: ClientDataJSON) => ClientDataJSON;
|
|
18
18
|
};
|
|
19
|
+
//# sourceMappingURL=decodeClientDataJSON.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decodeClientDataJSON.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeClientDataJSON.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,eAAe,GAAG,cAAc,CAK1E;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE;QACb,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,eAAe,CAAC;KACnD,CAAC;CACH,CAAC;AAGF,eAAO,MAAM,8BAA8B;sBACvB,cAAc;CACjC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._decodeClientDataJSONInternals =
|
|
3
|
+
exports._decodeClientDataJSONInternals = void 0;
|
|
4
|
+
exports.decodeClientDataJSON = decodeClientDataJSON;
|
|
4
5
|
const index_js_1 = require("./iso/index.js");
|
|
5
6
|
/**
|
|
6
7
|
* Decode an authenticator's base64url-encoded clientDataJSON to JSON
|
|
@@ -10,7 +11,6 @@ function decodeClientDataJSON(data) {
|
|
|
10
11
|
const clientData = JSON.parse(toString);
|
|
11
12
|
return exports._decodeClientDataJSONInternals.stubThis(clientData);
|
|
12
13
|
}
|
|
13
|
-
exports.decodeClientDataJSON = decodeClientDataJSON;
|
|
14
14
|
// Make it possible to stub the return value during testing
|
|
15
15
|
exports._decodeClientDataJSONInternals = {
|
|
16
16
|
stubThis: (value) => value,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decodeCredentialPublicKey.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeCredentialPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,UAAU,GACpB,aAAa,CAIf;AAGD,eAAO,MAAM,mCAAmC;sBAC5B,aAAa;CAChC,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._decodeCredentialPublicKeyInternals =
|
|
3
|
+
exports._decodeCredentialPublicKeyInternals = void 0;
|
|
4
|
+
exports.decodeCredentialPublicKey = decodeCredentialPublicKey;
|
|
4
5
|
const index_js_1 = require("./iso/index.js");
|
|
5
6
|
function decodeCredentialPublicKey(publicKey) {
|
|
6
7
|
return exports._decodeCredentialPublicKeyInternals.stubThis(index_js_1.isoCBOR.decodeFirst(publicKey));
|
|
7
8
|
}
|
|
8
|
-
exports.decodeCredentialPublicKey = decodeCredentialPublicKey;
|
|
9
9
|
// Make it possible to stub the return value during testing
|
|
10
10
|
exports._decodeCredentialPublicKeyInternals = {
|
|
11
11
|
stubThis: (value) => value,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/helpers/fetch.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEpD;AAGD,eAAO,MAAM,eAAe;oBACV,MAAM;CACvB,CAAC"}
|
package/script/helpers/fetch.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._fetchInternals =
|
|
4
|
-
|
|
3
|
+
exports._fetchInternals = void 0;
|
|
4
|
+
exports.fetch = fetch;
|
|
5
|
+
const cross_fetch_1 = require("cross-fetch");
|
|
5
6
|
/**
|
|
6
7
|
* A simple method for requesting data via standard `fetch`. Should work
|
|
7
8
|
* across multiple runtimes.
|
|
@@ -9,8 +10,7 @@ const deps_js_1 = require("../deps.js");
|
|
|
9
10
|
function fetch(url) {
|
|
10
11
|
return exports._fetchInternals.stubThis(url);
|
|
11
12
|
}
|
|
12
|
-
exports.fetch = fetch;
|
|
13
13
|
// Make it possible to stub the return value during testing
|
|
14
14
|
exports._fetchInternals = {
|
|
15
|
-
stubThis: (url) => (0,
|
|
15
|
+
stubThis: (url) => (0, cross_fetch_1.fetch)(url),
|
|
16
16
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateChallenge.d.ts","sourceRoot":"","sources":["../../src/helpers/generateChallenge.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,UAAU,CAAC,CAc7D;AAGD,eAAO,MAAM,2BAA2B;sBACpB,UAAU;CAC7B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._generateChallengeInternals =
|
|
3
|
+
exports._generateChallengeInternals = void 0;
|
|
4
|
+
exports.generateChallenge = generateChallenge;
|
|
4
5
|
const index_js_1 = require("./iso/index.js");
|
|
5
6
|
/**
|
|
6
7
|
* Generate a suitably random value to be used as an attestation or assertion challenge
|
|
@@ -18,7 +19,6 @@ async function generateChallenge() {
|
|
|
18
19
|
await index_js_1.isoCrypto.getRandomValues(challenge);
|
|
19
20
|
return exports._generateChallengeInternals.stubThis(challenge);
|
|
20
21
|
}
|
|
21
|
-
exports.generateChallenge = generateChallenge;
|
|
22
22
|
// Make it possible to stub the return value during testing
|
|
23
23
|
exports._generateChallengeInternals = {
|
|
24
24
|
stubThis: (value) => value,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateUserID.d.ts","sourceRoot":"","sources":["../../src/helpers/generateUserID.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC,CAU1D;AAGD,eAAO,MAAM,wBAAwB;sBACjB,UAAU;CAC7B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._generateUserIDInternals =
|
|
3
|
+
exports._generateUserIDInternals = void 0;
|
|
4
|
+
exports.generateUserID = generateUserID;
|
|
4
5
|
const index_js_1 = require("./iso/index.js");
|
|
5
6
|
/**
|
|
6
7
|
* Generate a suitably random value to be used as user ID
|
|
@@ -14,7 +15,6 @@ async function generateUserID() {
|
|
|
14
15
|
await index_js_1.isoCrypto.getRandomValues(newUserID);
|
|
15
16
|
return exports._generateUserIDInternals.stubThis(newUserID);
|
|
16
17
|
}
|
|
17
|
-
exports.generateUserID = generateUserID;
|
|
18
18
|
// Make it possible to stub the return value during testing
|
|
19
19
|
exports._generateUserIDInternals = {
|
|
20
20
|
stubThis: (value) => value,
|