@simplewebauthn/server 10.0.0 → 11.0.0-alpha3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/README.md +14 -6
  2. package/esm/authentication/generateAuthenticationOptions.d.ts +2 -1
  3. package/esm/authentication/generateAuthenticationOptions.d.ts.map +1 -0
  4. package/esm/authentication/verifyAuthenticationResponse.d.ts +4 -3
  5. package/esm/authentication/verifyAuthenticationResponse.d.ts.map +1 -0
  6. package/esm/authentication/verifyAuthenticationResponse.js +7 -7
  7. package/esm/helpers/convertAAGUIDToString.d.ts +1 -0
  8. package/esm/helpers/convertAAGUIDToString.d.ts.map +1 -0
  9. package/esm/helpers/convertAAGUIDToString.js +4 -4
  10. package/esm/helpers/convertCOSEtoPKCS.d.ts +1 -0
  11. package/esm/helpers/convertCOSEtoPKCS.d.ts.map +1 -0
  12. package/esm/helpers/convertCertBufferToPEM.d.ts +2 -1
  13. package/esm/helpers/convertCertBufferToPEM.d.ts.map +1 -0
  14. package/esm/helpers/convertPEMToBytes.d.ts +1 -0
  15. package/esm/helpers/convertPEMToBytes.d.ts.map +1 -0
  16. package/esm/helpers/convertX509PublicKeyToCOSE.d.ts +1 -0
  17. package/esm/helpers/convertX509PublicKeyToCOSE.d.ts.map +1 -0
  18. package/esm/helpers/convertX509PublicKeyToCOSE.js +4 -1
  19. package/esm/helpers/cose.d.ts +1 -0
  20. package/esm/helpers/cose.d.ts.map +1 -0
  21. package/esm/helpers/decodeAttestationObject.d.ts +1 -0
  22. package/esm/helpers/decodeAttestationObject.d.ts.map +1 -0
  23. package/esm/helpers/decodeAuthenticatorExtensions.d.ts +5 -14
  24. package/esm/helpers/decodeAuthenticatorExtensions.d.ts.map +1 -0
  25. package/esm/helpers/decodeClientDataJSON.d.ts +2 -1
  26. package/esm/helpers/decodeClientDataJSON.d.ts.map +1 -0
  27. package/esm/helpers/decodeCredentialPublicKey.d.ts +1 -0
  28. package/esm/helpers/decodeCredentialPublicKey.d.ts.map +1 -0
  29. package/esm/helpers/fetch.d.ts +1 -0
  30. package/esm/helpers/fetch.d.ts.map +1 -0
  31. package/esm/helpers/fetch.js +1 -1
  32. package/esm/helpers/generateChallenge.d.ts +1 -0
  33. package/esm/helpers/generateChallenge.d.ts.map +1 -0
  34. package/esm/helpers/generateUserID.d.ts +1 -0
  35. package/esm/helpers/generateUserID.d.ts.map +1 -0
  36. package/esm/helpers/getCertificateInfo.d.ts +2 -1
  37. package/esm/helpers/getCertificateInfo.d.ts.map +1 -0
  38. package/esm/helpers/getCertificateInfo.js +2 -1
  39. package/esm/helpers/index.d.ts +1 -0
  40. package/esm/helpers/index.d.ts.map +1 -0
  41. package/esm/helpers/isCertRevoked.d.ts +2 -1
  42. package/esm/helpers/isCertRevoked.d.ts.map +1 -0
  43. package/esm/helpers/isCertRevoked.js +2 -1
  44. package/esm/helpers/iso/index.d.ts +1 -0
  45. package/esm/helpers/iso/index.d.ts.map +1 -0
  46. package/esm/helpers/iso/isoBase64URL.d.ts +2 -1
  47. package/esm/helpers/iso/isoBase64URL.d.ts.map +1 -0
  48. package/esm/helpers/iso/isoBase64URL.js +1 -1
  49. package/esm/helpers/iso/isoCBOR.d.ts +2 -1
  50. package/esm/helpers/iso/isoCBOR.d.ts.map +1 -0
  51. package/esm/helpers/iso/isoCBOR.js +1 -1
  52. package/esm/helpers/iso/isoCrypto/digest.d.ts +1 -0
  53. package/esm/helpers/iso/isoCrypto/digest.d.ts.map +1 -0
  54. package/esm/helpers/iso/isoCrypto/getRandomValues.d.ts +1 -0
  55. package/esm/helpers/iso/isoCrypto/getRandomValues.d.ts.map +1 -0
  56. package/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts +2 -1
  57. package/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts.map +1 -0
  58. package/esm/helpers/iso/isoCrypto/importKey.d.ts +1 -0
  59. package/esm/helpers/iso/isoCrypto/importKey.d.ts.map +1 -0
  60. package/esm/helpers/iso/isoCrypto/index.d.ts +1 -0
  61. package/esm/helpers/iso/isoCrypto/index.d.ts.map +1 -0
  62. package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts +1 -0
  63. package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map +1 -0
  64. package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts +1 -0
  65. package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map +1 -0
  66. package/esm/helpers/iso/isoCrypto/structs.d.ts +1 -0
  67. package/esm/helpers/iso/isoCrypto/structs.d.ts.map +1 -0
  68. package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts +3 -1
  69. package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map +1 -0
  70. package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js +60 -17
  71. package/esm/helpers/iso/isoCrypto/verify.d.ts +1 -0
  72. package/esm/helpers/iso/isoCrypto/verify.d.ts.map +1 -0
  73. package/esm/helpers/iso/isoCrypto/verify.js +6 -2
  74. package/esm/helpers/iso/isoCrypto/verifyEC2.d.ts +1 -0
  75. package/esm/helpers/iso/isoCrypto/verifyEC2.d.ts.map +1 -0
  76. package/esm/helpers/iso/isoCrypto/verifyOKP.d.ts +1 -0
  77. package/esm/helpers/iso/isoCrypto/verifyOKP.d.ts.map +1 -0
  78. package/esm/helpers/iso/isoCrypto/verifyRSA.d.ts +1 -0
  79. package/esm/helpers/iso/isoCrypto/verifyRSA.d.ts.map +1 -0
  80. package/esm/helpers/iso/isoUint8Array.d.ts +1 -0
  81. package/esm/helpers/iso/isoUint8Array.d.ts.map +1 -0
  82. package/esm/helpers/logging.d.ts +1 -0
  83. package/esm/helpers/logging.d.ts.map +1 -0
  84. package/esm/helpers/logging.js +0 -1
  85. package/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts +1 -0
  86. package/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map +1 -0
  87. package/esm/helpers/matchExpectedRPID.d.ts +1 -0
  88. package/esm/helpers/matchExpectedRPID.d.ts.map +1 -0
  89. package/esm/helpers/parseAuthenticatorData.d.ts +1 -0
  90. package/esm/helpers/parseAuthenticatorData.d.ts.map +1 -0
  91. package/esm/helpers/parseAuthenticatorData.js +6 -6
  92. package/esm/helpers/parseBackupFlags.d.ts +2 -1
  93. package/esm/helpers/parseBackupFlags.d.ts.map +1 -0
  94. package/esm/helpers/toHash.d.ts +1 -0
  95. package/esm/helpers/toHash.d.ts.map +1 -0
  96. package/esm/helpers/validateCertificatePath.d.ts +1 -0
  97. package/esm/helpers/validateCertificatePath.d.ts.map +1 -0
  98. package/esm/helpers/validateCertificatePath.js +1 -1
  99. package/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts +7 -0
  100. package/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts.map +1 -0
  101. package/esm/helpers/validateExtFIDOGenCEAAGUID.js +34 -0
  102. package/esm/helpers/verifySignature.d.ts +1 -0
  103. package/esm/helpers/verifySignature.d.ts.map +1 -0
  104. package/esm/index.d.ts +1 -0
  105. package/esm/index.d.ts.map +1 -0
  106. package/esm/metadata/mdsTypes.d.ts +2 -1
  107. package/esm/metadata/mdsTypes.d.ts.map +1 -0
  108. package/esm/metadata/parseJWT.d.ts +1 -0
  109. package/esm/metadata/parseJWT.d.ts.map +1 -0
  110. package/esm/metadata/verifyAttestationWithMetadata.d.ts +2 -1
  111. package/esm/metadata/verifyAttestationWithMetadata.d.ts.map +1 -0
  112. package/esm/metadata/verifyJWT.d.ts +1 -0
  113. package/esm/metadata/verifyJWT.d.ts.map +1 -0
  114. package/esm/registration/generateRegistrationOptions.d.ts +2 -1
  115. package/esm/registration/generateRegistrationOptions.d.ts.map +1 -0
  116. package/esm/registration/verifications/tpm/constants.d.ts +1 -0
  117. package/esm/registration/verifications/tpm/constants.d.ts.map +1 -0
  118. package/esm/registration/verifications/tpm/constants.js +8 -4
  119. package/esm/registration/verifications/tpm/parseCertInfo.d.ts +1 -0
  120. package/esm/registration/verifications/tpm/parseCertInfo.d.ts.map +1 -0
  121. package/esm/registration/verifications/tpm/parsePubArea.d.ts +1 -0
  122. package/esm/registration/verifications/tpm/parsePubArea.d.ts.map +1 -0
  123. package/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts +1 -0
  124. package/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts.map +1 -0
  125. package/esm/registration/verifications/tpm/verifyAttestationTPM.js +11 -3
  126. package/esm/registration/verifications/verifyAttestationAndroidKey.d.ts +1 -0
  127. package/esm/registration/verifications/verifyAttestationAndroidKey.d.ts.map +1 -0
  128. package/esm/registration/verifications/verifyAttestationAndroidKey.js +3 -1
  129. package/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts +1 -0
  130. package/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map +1 -0
  131. package/esm/registration/verifications/verifyAttestationApple.d.ts +1 -0
  132. package/esm/registration/verifications/verifyAttestationApple.d.ts.map +1 -0
  133. package/esm/registration/verifications/verifyAttestationApple.js +2 -1
  134. package/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts +1 -0
  135. package/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts.map +1 -0
  136. package/esm/registration/verifications/verifyAttestationPacked.d.ts +1 -0
  137. package/esm/registration/verifications/verifyAttestationPacked.d.ts.map +1 -0
  138. package/esm/registration/verifications/verifyAttestationPacked.js +10 -3
  139. package/esm/registration/verifyRegistrationResponse.d.ts +5 -4
  140. package/esm/registration/verifyRegistrationResponse.d.ts.map +1 -0
  141. package/esm/registration/verifyRegistrationResponse.js +11 -7
  142. package/esm/services/defaultRootCerts/android-key.d.ts +1 -0
  143. package/esm/services/defaultRootCerts/android-key.d.ts.map +1 -0
  144. package/esm/services/defaultRootCerts/android-safetynet.d.ts +1 -0
  145. package/esm/services/defaultRootCerts/android-safetynet.d.ts.map +1 -0
  146. package/esm/services/defaultRootCerts/apple.d.ts +1 -0
  147. package/esm/services/defaultRootCerts/apple.d.ts.map +1 -0
  148. package/esm/services/defaultRootCerts/mds.d.ts +1 -0
  149. package/esm/services/defaultRootCerts/mds.d.ts.map +1 -0
  150. package/esm/services/metadataService.d.ts +19 -4
  151. package/esm/services/metadataService.d.ts.map +1 -0
  152. package/esm/services/metadataService.js +8 -3
  153. package/esm/services/settingsService.d.ts +17 -14
  154. package/esm/services/settingsService.d.ts.map +1 -0
  155. package/esm/services/settingsService.js +14 -0
  156. package/package.json +29 -33
  157. package/script/authentication/generateAuthenticationOptions.d.ts +2 -1
  158. package/script/authentication/generateAuthenticationOptions.d.ts.map +1 -0
  159. package/script/authentication/generateAuthenticationOptions.js +1 -2
  160. package/script/authentication/verifyAuthenticationResponse.d.ts +4 -3
  161. package/script/authentication/verifyAuthenticationResponse.d.ts.map +1 -0
  162. package/script/authentication/verifyAuthenticationResponse.js +8 -9
  163. package/script/helpers/convertAAGUIDToString.d.ts +1 -0
  164. package/script/helpers/convertAAGUIDToString.d.ts.map +1 -0
  165. package/script/helpers/convertAAGUIDToString.js +5 -6
  166. package/script/helpers/convertCOSEtoPKCS.d.ts +1 -0
  167. package/script/helpers/convertCOSEtoPKCS.d.ts.map +1 -0
  168. package/script/helpers/convertCOSEtoPKCS.js +1 -2
  169. package/script/helpers/convertCertBufferToPEM.d.ts +2 -1
  170. package/script/helpers/convertCertBufferToPEM.d.ts.map +1 -0
  171. package/script/helpers/convertCertBufferToPEM.js +1 -2
  172. package/script/helpers/convertPEMToBytes.d.ts +1 -0
  173. package/script/helpers/convertPEMToBytes.d.ts.map +1 -0
  174. package/script/helpers/convertPEMToBytes.js +1 -2
  175. package/script/helpers/convertX509PublicKeyToCOSE.d.ts +1 -0
  176. package/script/helpers/convertX509PublicKeyToCOSE.d.ts.map +1 -0
  177. package/script/helpers/convertX509PublicKeyToCOSE.js +11 -9
  178. package/script/helpers/cose.d.ts +1 -0
  179. package/script/helpers/cose.d.ts.map +1 -0
  180. package/script/helpers/cose.js +11 -11
  181. package/script/helpers/decodeAttestationObject.d.ts +1 -0
  182. package/script/helpers/decodeAttestationObject.d.ts.map +1 -0
  183. package/script/helpers/decodeAttestationObject.js +2 -2
  184. package/script/helpers/decodeAuthenticatorExtensions.d.ts +5 -14
  185. package/script/helpers/decodeAuthenticatorExtensions.d.ts.map +1 -0
  186. package/script/helpers/decodeAuthenticatorExtensions.js +1 -2
  187. package/script/helpers/decodeClientDataJSON.d.ts +2 -1
  188. package/script/helpers/decodeClientDataJSON.d.ts.map +1 -0
  189. package/script/helpers/decodeClientDataJSON.js +2 -2
  190. package/script/helpers/decodeCredentialPublicKey.d.ts +1 -0
  191. package/script/helpers/decodeCredentialPublicKey.d.ts.map +1 -0
  192. package/script/helpers/decodeCredentialPublicKey.js +2 -2
  193. package/script/helpers/fetch.d.ts +1 -0
  194. package/script/helpers/fetch.d.ts.map +1 -0
  195. package/script/helpers/fetch.js +4 -4
  196. package/script/helpers/generateChallenge.d.ts +1 -0
  197. package/script/helpers/generateChallenge.d.ts.map +1 -0
  198. package/script/helpers/generateChallenge.js +2 -2
  199. package/script/helpers/generateUserID.d.ts +1 -0
  200. package/script/helpers/generateUserID.d.ts.map +1 -0
  201. package/script/helpers/generateUserID.js +2 -2
  202. package/script/helpers/getCertificateInfo.d.ts +2 -1
  203. package/script/helpers/getCertificateInfo.d.ts.map +1 -0
  204. package/script/helpers/getCertificateInfo.js +6 -6
  205. package/script/helpers/index.d.ts +1 -0
  206. package/script/helpers/index.d.ts.map +1 -0
  207. package/script/helpers/isCertRevoked.d.ts +2 -1
  208. package/script/helpers/isCertRevoked.d.ts.map +1 -0
  209. package/script/helpers/isCertRevoked.js +10 -10
  210. package/script/helpers/iso/index.d.ts +1 -0
  211. package/script/helpers/iso/index.d.ts.map +1 -0
  212. package/script/helpers/iso/isoBase64URL.d.ts +2 -1
  213. package/script/helpers/iso/isoBase64URL.d.ts.map +1 -0
  214. package/script/helpers/iso/isoBase64URL.js +20 -18
  215. package/script/helpers/iso/isoCBOR.d.ts +2 -1
  216. package/script/helpers/iso/isoCBOR.d.ts.map +1 -0
  217. package/script/helpers/iso/isoCBOR.js +28 -6
  218. package/script/helpers/iso/isoCrypto/digest.d.ts +1 -0
  219. package/script/helpers/iso/isoCrypto/digest.d.ts.map +1 -0
  220. package/script/helpers/iso/isoCrypto/digest.js +1 -2
  221. package/script/helpers/iso/isoCrypto/getRandomValues.d.ts +1 -0
  222. package/script/helpers/iso/isoCrypto/getRandomValues.d.ts.map +1 -0
  223. package/script/helpers/iso/isoCrypto/getRandomValues.js +1 -2
  224. package/script/helpers/iso/isoCrypto/getWebCrypto.d.ts +2 -1
  225. package/script/helpers/iso/isoCrypto/getWebCrypto.d.ts.map +1 -0
  226. package/script/helpers/iso/isoCrypto/getWebCrypto.js +2 -2
  227. package/script/helpers/iso/isoCrypto/importKey.d.ts +1 -0
  228. package/script/helpers/iso/isoCrypto/importKey.d.ts.map +1 -0
  229. package/script/helpers/iso/isoCrypto/importKey.js +1 -2
  230. package/script/helpers/iso/isoCrypto/index.d.ts +1 -0
  231. package/script/helpers/iso/isoCrypto/index.d.ts.map +1 -0
  232. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts +1 -0
  233. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map +1 -0
  234. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js +1 -2
  235. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts +1 -0
  236. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map +1 -0
  237. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js +1 -2
  238. package/script/helpers/iso/isoCrypto/structs.d.ts +1 -0
  239. package/script/helpers/iso/isoCrypto/structs.d.ts.map +1 -0
  240. package/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts +3 -1
  241. package/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map +1 -0
  242. package/script/helpers/iso/isoCrypto/unwrapEC2Signature.js +62 -20
  243. package/script/helpers/iso/isoCrypto/verify.d.ts +1 -0
  244. package/script/helpers/iso/isoCrypto/verify.d.ts.map +1 -0
  245. package/script/helpers/iso/isoCrypto/verify.js +6 -3
  246. package/script/helpers/iso/isoCrypto/verifyEC2.d.ts +1 -0
  247. package/script/helpers/iso/isoCrypto/verifyEC2.d.ts.map +1 -0
  248. package/script/helpers/iso/isoCrypto/verifyEC2.js +1 -2
  249. package/script/helpers/iso/isoCrypto/verifyOKP.d.ts +1 -0
  250. package/script/helpers/iso/isoCrypto/verifyOKP.d.ts.map +1 -0
  251. package/script/helpers/iso/isoCrypto/verifyOKP.js +1 -2
  252. package/script/helpers/iso/isoCrypto/verifyRSA.d.ts +1 -0
  253. package/script/helpers/iso/isoCrypto/verifyRSA.d.ts.map +1 -0
  254. package/script/helpers/iso/isoCrypto/verifyRSA.js +1 -2
  255. package/script/helpers/iso/isoUint8Array.d.ts +1 -0
  256. package/script/helpers/iso/isoUint8Array.d.ts.map +1 -0
  257. package/script/helpers/iso/isoUint8Array.js +8 -9
  258. package/script/helpers/logging.d.ts +1 -0
  259. package/script/helpers/logging.d.ts.map +1 -0
  260. package/script/helpers/logging.js +2 -4
  261. package/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts +1 -0
  262. package/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map +1 -0
  263. package/script/helpers/mapX509SignatureAlgToCOSEAlg.js +1 -2
  264. package/script/helpers/matchExpectedRPID.d.ts +1 -0
  265. package/script/helpers/matchExpectedRPID.d.ts.map +1 -0
  266. package/script/helpers/matchExpectedRPID.js +1 -2
  267. package/script/helpers/parseAuthenticatorData.d.ts +1 -0
  268. package/script/helpers/parseAuthenticatorData.d.ts.map +1 -0
  269. package/script/helpers/parseAuthenticatorData.js +8 -8
  270. package/script/helpers/parseBackupFlags.d.ts +2 -1
  271. package/script/helpers/parseBackupFlags.d.ts.map +1 -0
  272. package/script/helpers/parseBackupFlags.js +2 -2
  273. package/script/helpers/toHash.d.ts +1 -0
  274. package/script/helpers/toHash.d.ts.map +1 -0
  275. package/script/helpers/toHash.js +1 -2
  276. package/script/helpers/validateCertificatePath.d.ts +1 -0
  277. package/script/helpers/validateCertificatePath.d.ts.map +1 -0
  278. package/script/helpers/validateCertificatePath.js +3 -4
  279. package/script/helpers/validateExtFIDOGenCEAAGUID.d.ts +7 -0
  280. package/script/helpers/validateExtFIDOGenCEAAGUID.d.ts.map +1 -0
  281. package/script/helpers/validateExtFIDOGenCEAAGUID.js +37 -0
  282. package/script/helpers/verifySignature.d.ts +1 -0
  283. package/script/helpers/verifySignature.d.ts.map +1 -0
  284. package/script/helpers/verifySignature.js +2 -2
  285. package/script/index.d.ts +1 -0
  286. package/script/index.d.ts.map +1 -0
  287. package/script/metadata/mdsTypes.d.ts +2 -1
  288. package/script/metadata/mdsTypes.d.ts.map +1 -0
  289. package/script/metadata/parseJWT.d.ts +1 -0
  290. package/script/metadata/parseJWT.d.ts.map +1 -0
  291. package/script/metadata/parseJWT.js +1 -2
  292. package/script/metadata/verifyAttestationWithMetadata.d.ts +2 -1
  293. package/script/metadata/verifyAttestationWithMetadata.d.ts.map +1 -0
  294. package/script/metadata/verifyAttestationWithMetadata.js +2 -2
  295. package/script/metadata/verifyJWT.d.ts +1 -0
  296. package/script/metadata/verifyJWT.d.ts.map +1 -0
  297. package/script/metadata/verifyJWT.js +1 -2
  298. package/script/registration/generateRegistrationOptions.d.ts +2 -1
  299. package/script/registration/generateRegistrationOptions.d.ts.map +1 -0
  300. package/script/registration/generateRegistrationOptions.js +2 -2
  301. package/script/registration/verifications/tpm/constants.d.ts +1 -0
  302. package/script/registration/verifications/tpm/constants.d.ts.map +1 -0
  303. package/script/registration/verifications/tpm/constants.js +8 -4
  304. package/script/registration/verifications/tpm/parseCertInfo.d.ts +1 -0
  305. package/script/registration/verifications/tpm/parseCertInfo.d.ts.map +1 -0
  306. package/script/registration/verifications/tpm/parseCertInfo.js +1 -2
  307. package/script/registration/verifications/tpm/parsePubArea.d.ts +1 -0
  308. package/script/registration/verifications/tpm/parsePubArea.d.ts.map +1 -0
  309. package/script/registration/verifications/tpm/parsePubArea.js +1 -2
  310. package/script/registration/verifications/tpm/verifyAttestationTPM.d.ts +1 -0
  311. package/script/registration/verifications/tpm/verifyAttestationTPM.d.ts.map +1 -0
  312. package/script/registration/verifications/tpm/verifyAttestationTPM.js +17 -10
  313. package/script/registration/verifications/verifyAttestationAndroidKey.d.ts +1 -0
  314. package/script/registration/verifications/verifyAttestationAndroidKey.d.ts.map +1 -0
  315. package/script/registration/verifications/verifyAttestationAndroidKey.js +7 -6
  316. package/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts +1 -0
  317. package/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map +1 -0
  318. package/script/registration/verifications/verifyAttestationAndroidSafetyNet.js +1 -2
  319. package/script/registration/verifications/verifyAttestationApple.d.ts +1 -0
  320. package/script/registration/verifications/verifyAttestationApple.d.ts.map +1 -0
  321. package/script/registration/verifications/verifyAttestationApple.js +4 -4
  322. package/script/registration/verifications/verifyAttestationFIDOU2F.d.ts +1 -0
  323. package/script/registration/verifications/verifyAttestationFIDOU2F.d.ts.map +1 -0
  324. package/script/registration/verifications/verifyAttestationFIDOU2F.js +1 -2
  325. package/script/registration/verifications/verifyAttestationPacked.d.ts +1 -0
  326. package/script/registration/verifications/verifyAttestationPacked.d.ts.map +1 -0
  327. package/script/registration/verifications/verifyAttestationPacked.js +11 -5
  328. package/script/registration/verifyRegistrationResponse.d.ts +5 -4
  329. package/script/registration/verifyRegistrationResponse.d.ts.map +1 -0
  330. package/script/registration/verifyRegistrationResponse.js +12 -9
  331. package/script/services/defaultRootCerts/android-key.d.ts +1 -0
  332. package/script/services/defaultRootCerts/android-key.d.ts.map +1 -0
  333. package/script/services/defaultRootCerts/android-safetynet.d.ts +1 -0
  334. package/script/services/defaultRootCerts/android-safetynet.d.ts.map +1 -0
  335. package/script/services/defaultRootCerts/apple.d.ts +1 -0
  336. package/script/services/defaultRootCerts/apple.d.ts.map +1 -0
  337. package/script/services/defaultRootCerts/mds.d.ts +1 -0
  338. package/script/services/defaultRootCerts/mds.d.ts.map +1 -0
  339. package/script/services/metadataService.d.ts +19 -4
  340. package/script/services/metadataService.d.ts.map +1 -0
  341. package/script/services/metadataService.js +8 -3
  342. package/script/services/settingsService.d.ts +17 -14
  343. package/script/services/settingsService.d.ts.map +1 -0
  344. package/script/services/settingsService.js +14 -0
  345. package/esm/deps.d.ts +0 -9
  346. package/esm/deps.js +0 -12
  347. package/script/deps.d.ts +0 -9
  348. package/script/deps.js +0 -68
@@ -4,6 +4,7 @@ import { validateCertificatePath } from '../../helpers/validateCertificatePath.j
4
4
  import { getCertificateInfo } from '../../helpers/getCertificateInfo.js';
5
5
  import { verifySignature } from '../../helpers/verifySignature.js';
6
6
  import { isoUint8Array } from '../../helpers/iso/index.js';
7
+ import { validateExtFIDOGenCEAAGUID } from '../../helpers/validateExtFIDOGenCEAAGUID.js';
7
8
  import { MetadataService } from '../../services/metadataService.js';
8
9
  import { verifyAttestationWithMetadata } from '../../metadata/verifyAttestationWithMetadata.js';
9
10
  /**
@@ -26,7 +27,7 @@ export async function verifyAttestationPacked(options) {
26
27
  const signatureBase = isoUint8Array.concat([authData, clientDataHash]);
27
28
  let verified = false;
28
29
  if (x5c) {
29
- const { subject, basicConstraintsCA, version, notBefore, notAfter } = getCertificateInfo(x5c[0]);
30
+ const { subject, basicConstraintsCA, version, notBefore, notAfter, parsedCertificate, } = getCertificateInfo(x5c[0]);
30
31
  const { OU, CN, O, C } = subject;
31
32
  if (OU !== 'Authenticator Attestation') {
32
33
  throw new Error('Certificate OU was not "Authenticator Attestation" (Packed|Full)');
@@ -54,8 +55,14 @@ export async function verifyAttestationPacked(options) {
54
55
  if (notAfter < now) {
55
56
  throw new Error(`Certificate not good after "${notAfter.toString()}" (Packed|Full)`);
56
57
  }
57
- // TODO: If certificate contains id-fido-gen-ce-aaguid(1.3.6.1.4.1.45724.1.1.4) extension, check
58
- // that it’s value is set to the same AAGUID as in authData.
58
+ // Validate attestation statement AAGUID against leaf cert AAGUID
59
+ try {
60
+ await validateExtFIDOGenCEAAGUID(parsedCertificate.tbsCertificate.extensions, aaguid);
61
+ }
62
+ catch (err) {
63
+ const _err = err;
64
+ throw new Error(`${_err.message} (Packed|Full)`);
65
+ }
59
66
  // If available, validate attestation alg and x5c with info in the metadata statement
60
67
  const statement = await MetadataService.getStatement(aaguid);
61
68
  if (statement) {
@@ -1,4 +1,4 @@
1
- import type { Base64URLString, COSEAlgorithmIdentifier, CredentialDeviceType, RegistrationResponseJSON } from '../deps.js';
1
+ import type { COSEAlgorithmIdentifier, CredentialDeviceType, RegistrationResponseJSON, WebAuthnCredential } from '@simplewebauthn/types';
2
2
  import { AttestationFormat, AttestationStatement } from '../helpers/decodeAttestationObject.js';
3
3
  import { AuthenticationExtensionsAuthenticatorOutputs } from '../helpers/decodeAuthenticatorExtensions.js';
4
4
  export type VerifyRegistrationResponseOpts = {
@@ -7,6 +7,7 @@ export type VerifyRegistrationResponseOpts = {
7
7
  expectedOrigin: string | string[];
8
8
  expectedRPID?: string | string[];
9
9
  expectedType?: string | string[];
10
+ requireUserPresence?: boolean;
10
11
  requireUserVerification?: boolean;
11
12
  supportedAlgorithmIDs?: COSEAlgorithmIdentifier[];
12
13
  };
@@ -20,6 +21,7 @@ export type VerifyRegistrationResponseOpts = {
20
21
  * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
21
22
  * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
22
23
  * @param expectedType **(Optional)** - The response type expected ('webauthn.create')
24
+ * @param requireUserPresence **(Optional)** - Enforce user presence by the authenticator (or skip it during auto registration) Defaults to `true`
23
25
  * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
24
26
  * @param supportedAlgorithmIDs **(Optional)** - Array of numeric COSE algorithm identifiers supported for attestation by this RP. See https://www.iana.org/assignments/cose/cose.xhtml#algorithms. Defaults to all supported algorithm IDs
25
27
  */
@@ -54,10 +56,8 @@ export type VerifiedRegistrationResponse = {
54
56
  verified: boolean;
55
57
  registrationInfo?: {
56
58
  fmt: AttestationFormat;
57
- counter: number;
58
59
  aaguid: string;
59
- credentialID: Base64URLString;
60
- credentialPublicKey: Uint8Array;
60
+ credential: WebAuthnCredential;
61
61
  credentialType: 'public-key';
62
62
  attestationObject: Uint8Array;
63
63
  userVerified: boolean;
@@ -82,3 +82,4 @@ export type AttestationFormatVerifierOpts = {
82
82
  rpIdHash: Uint8Array;
83
83
  verifyTimestampMS?: boolean;
84
84
  };
85
+ //# sourceMappingURL=verifyRegistrationResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyRegistrationResponse.d.ts","sourceRoot":"","sources":["../../src/registration/verifyRegistrationResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EAErB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,4CAA4C,EAAE,MAAM,6CAA6C,CAAC;AAoB3G,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,wBAAwB,CAAC;IACnC,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,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,qBAAqB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACnD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,4BAA4B,CAAC,CAsPvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE;QACjB,GAAG,EAAE,iBAAiB,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,kBAAkB,CAAC;QAC/B,cAAc,EAAE,YAAY,CAAC;QAC7B,iBAAiB,EAAE,UAAU,CAAC;QAC9B,YAAY,EAAE,OAAO,CAAC;QACtB,oBAAoB,EAAE,oBAAoB,CAAC;QAC3C,kBAAkB,EAAE,OAAO,CAAC;QAC5B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,6BAA6B,CAAC,EAAE,4CAA4C,CAAC;KAC9E,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,EAAE,UAAU,CAAC;IACrB,cAAc,EAAE,UAAU,CAAC;IAC3B,YAAY,EAAE,UAAU,CAAC;IACzB,mBAAmB,EAAE,UAAU,CAAC;IAChC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,EAAE,UAAU,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC"}
@@ -26,11 +26,12 @@ import { verifyAttestationApple } from './verifications/verifyAttestationApple.j
26
26
  * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
27
27
  * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
28
28
  * @param expectedType **(Optional)** - The response type expected ('webauthn.create')
29
+ * @param requireUserPresence **(Optional)** - Enforce user presence by the authenticator (or skip it during auto registration) Defaults to `true`
29
30
  * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
30
31
  * @param supportedAlgorithmIDs **(Optional)** - Array of numeric COSE algorithm identifiers supported for attestation by this RP. See https://www.iana.org/assignments/cose/cose.xhtml#algorithms. Defaults to all supported algorithm IDs
31
32
  */
32
33
  export async function verifyRegistrationResponse(options) {
33
- const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, requireUserVerification = true, supportedAlgorithmIDs = supportedCOSEAlgorithmIdentifiers, } = options;
34
+ const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, requireUserPresence = true, requireUserVerification = true, supportedAlgorithmIDs = supportedCOSEAlgorithmIdentifiers, } = options;
34
35
  const { id, rawId, type: credentialType, response: attestationResponse } = response;
35
36
  // Ensure credential specified an ID
36
37
  if (!id) {
@@ -109,12 +110,12 @@ export async function verifyRegistrationResponse(options) {
109
110
  matchedRPID = await matchExpectedRPID(rpIdHash, expectedRPIDs);
110
111
  }
111
112
  // Make sure someone was physically present
112
- if (!flags.up) {
113
- throw new Error('User not present during registration');
113
+ if (requireUserPresence && !flags.up) {
114
+ throw new Error('User presence was required, but user was not present');
114
115
  }
115
116
  // Enforce user verification if specified
116
117
  if (requireUserVerification && !flags.uv) {
117
- throw new Error('User verification required, but user could not be verified');
118
+ throw new Error('User verification was required, but user could not be verified');
118
119
  }
119
120
  if (!credentialID) {
120
121
  throw new Error('No credential ID was provided by authenticator');
@@ -189,11 +190,14 @@ export async function verifyRegistrationResponse(options) {
189
190
  const { credentialDeviceType, credentialBackedUp } = parseBackupFlags(flags);
190
191
  toReturn.registrationInfo = {
191
192
  fmt,
192
- counter,
193
193
  aaguid: convertAAGUIDToString(aaguid),
194
- credentialID: isoBase64URL.fromBuffer(credentialID),
195
- credentialPublicKey,
196
194
  credentialType,
195
+ credential: {
196
+ id: isoBase64URL.fromBuffer(credentialID),
197
+ publicKey: credentialPublicKey,
198
+ counter,
199
+ transports: response.response.transports,
200
+ },
197
201
  attestationObject,
198
202
  userVerified: flags.uv,
199
203
  credentialDeviceType,
@@ -22,3 +22,4 @@ export declare const Google_Hardware_Attestation_Root_1 = "-----BEGIN CERTIFICAT
22
22
  * 1E:F1:A0:4B:8B:A5:8A:B9:45:89:AC:49:8C:89:82:A7:83:F2:4E:A7:30:7E:01:59:A0:C3:A7:3B:37:7D:87:CC
23
23
  */
24
24
  export declare const Google_Hardware_Attestation_Root_2 = "-----BEGIN CERTIFICATE-----\nMIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz\nNzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7\ntv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj\nnar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq\nC4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ\noVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O\nJtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg\nsTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi\nigHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M\nRPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E\naDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um\nAGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud\nIwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD\nVR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBOMaBc8oumXb2voc7XCWnu\nXKhBBK3e2KMGz39t7lA3XXRe2ZLLAkLM5y3J7tURkf5a1SutfdOyXAmeE6SRo83U\nh6WszodmMkxK5GM4JGrnt4pBisu5igXEydaW7qq2CdC6DOGjG+mEkN8/TA6p3cno\nL/sPyz6evdjLlSeJ8rFBH6xWyIZCbrcpYEJzXaUOEaxxXxgYz5/cTiVKN2M1G2ok\nQBUIYSY6bjEL4aUN5cfo7ogP3UvliEo3Eo0YgwuzR2v0KR6C1cZqZJSTnghIC/vA\nD32KdNQ+c3N+vl2OTsUVMC1GiWkngNx1OO1+kXW+YTnnTUOtOIswUP/Vqd5SYgAI\nmMAfY8U9/iIgkQj6T2W6FsScy94IN9fFhE1UtzmLoBIuUFsVXJMTz+Jucth+IqoW\nFua9v1R93/k98p41pjtFX+H8DslVgfP097vju4KDlqN64xV1grw3ZLl4CiOe/A91\noeLm2UHOq6wn3esB4r2EIQKb6jTVGu5sYCcdWpXr0AUVqcABPdgL+H7qJguBw09o\njm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB\nZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH\nex0SdDrx+tWUDqG8At2JHA==\n-----END CERTIFICATE-----\n";
25
+ //# sourceMappingURL=android-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android-key.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/android-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,u6DA+B9C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,60DA8B9C,CAAC"}
@@ -9,3 +9,4 @@
9
9
  * EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99
10
10
  */
11
11
  export declare const GlobalSign_Root_CA = "-----BEGIN CERTIFICATE-----\nMIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG\nA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv\nb3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw\nMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i\nYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT\naWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ\njc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp\nxy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp\n1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG\nsnUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ\nU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8\n9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E\nBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B\nAQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz\nyj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE\n38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP\nAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad\nDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME\nHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n-----END CERTIFICATE-----\n";
12
+ //# sourceMappingURL=android-safetynet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android-safetynet.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/android-safetynet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,uwCAqB9B,CAAC"}
@@ -9,3 +9,4 @@
9
9
  * 09:15:DD:5C:07:A2:8D:B5:49:D1:F6:77:BB:5A:75:D4:BF:BE:95:61:A7:73:42:43:27:76:2E:9E:02:F9:BB:29
10
10
  */
11
11
  export declare const Apple_WebAuthn_Root_CA = "-----BEGIN CERTIFICATE-----\nMIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w\nHQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ\nbmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx\nNTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG\nA1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49\nAgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k\nxu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/\npcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk\n2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA\nMGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3\njAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B\n1bWeT0vT\n-----END CERTIFICATE-----\n";
12
+ //# sourceMappingURL=apple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apple.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/apple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,6xBAclC,CAAC"}
@@ -9,3 +9,4 @@
9
9
  * CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B
10
10
  */
11
11
  export declare const GlobalSign_Root_CA_R3 = "-----BEGIN CERTIFICATE-----\n MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G\n A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp\n Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4\n MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG\n A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI\n hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8\n RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT\n gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm\n KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd\n QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ\n XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw\n DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o\n LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU\n RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp\n jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK\n 6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX\n mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs\n Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH\n WD9f\n -----END CERTIFICATE-----\n ";
12
+ //# sourceMappingURL=mds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mds.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/mds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,4vCAqBhC,CAAC"}
@@ -1,12 +1,20 @@
1
1
  import type { MetadataStatement } from '../metadata/mdsTypes.js';
2
2
  type VerificationMode = 'permissive' | 'strict';
3
+ interface MetadataService {
4
+ initialize(opts?: {
5
+ mdsServers?: string[];
6
+ statements?: MetadataStatement[];
7
+ verificationMode?: VerificationMode;
8
+ }): Promise<void>;
9
+ getStatement(aaguid: string | Uint8Array): Promise<MetadataStatement | undefined>;
10
+ }
3
11
  /**
4
- * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
5
- * download and parsing, and on-demand requesting and caching of individual metadata statements.
12
+ * An implementation of `MetadataService` that can download and parse BLOBs, and support on-demand
13
+ * requesting and caching of individual metadata statements.
6
14
  *
7
15
  * https://fidoalliance.org/metadata/
8
16
  */
9
- export declare class BaseMetadataService {
17
+ export declare class BaseMetadataService implements MetadataService {
10
18
  private mdsCache;
11
19
  private statementCache;
12
20
  private state;
@@ -49,5 +57,12 @@ export declare class BaseMetadataService {
49
57
  */
50
58
  private setState;
51
59
  }
52
- export declare const MetadataService: BaseMetadataService;
60
+ /**
61
+ * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
62
+ * download and parsing, and on-demand requesting and caching of individual metadata statements.
63
+ *
64
+ * https://fidoalliance.org/metadata/
65
+ */
66
+ export declare const MetadataService: MetadataService;
53
67
  export {};
68
+ //# sourceMappingURL=metadataService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadataService.d.ts","sourceRoot":"","sources":["../../src/services/metadataService.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AA+BjC,KAAK,gBAAgB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAIhD,UAAU,eAAe;IACvB,UAAU,CAAC,IAAI,CAAC,EAAE;QAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;QACjC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;KACrC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;CACnF;AAED;;;;;GAKG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACzD,OAAO,CAAC,QAAQ,CAAoC;IACpD,OAAO,CAAC,cAAc,CAA6C;IACnE,OAAO,CAAC,KAAK,CAAyC;IACtD,OAAO,CAAC,gBAAgB,CAA8B;IAEtD;;;;;;;;;;;;OAYG;IACG,UAAU,CACd,IAAI,GAAE;QACJ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;QACjC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;KAChC,GACL,OAAO,CAAC,IAAI,CAAC;IA+DhB;;;;;OAKG;IACG,YAAY,CAChB,MAAM,EAAE,MAAM,GAAG,UAAU,GAC1B,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IA6DzC;;OAEG;YACW,YAAY;IAoE1B;;OAEG;IACH,OAAO,CAAC,eAAe;IAgCvB;;OAEG;IACH,OAAO,CAAC,QAAQ;CAWjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,eAA2C,CAAC"}
@@ -16,8 +16,8 @@ var SERVICE_STATE;
16
16
  })(SERVICE_STATE || (SERVICE_STATE = {}));
17
17
  const log = getLogger('MetadataService');
18
18
  /**
19
- * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
20
- * download and parsing, and on-demand requesting and caching of individual metadata statements.
19
+ * An implementation of `MetadataService` that can download and parse BLOBs, and support on-demand
20
+ * requesting and caching of individual metadata statements.
21
21
  *
22
22
  * https://fidoalliance.org/metadata/
23
23
  */
@@ -269,5 +269,10 @@ export class BaseMetadataService {
269
269
  }
270
270
  }
271
271
  }
272
- // Export a service singleton
272
+ /**
273
+ * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
274
+ * download and parsing, and on-demand requesting and caching of individual metadata statements.
275
+ *
276
+ * https://fidoalliance.org/metadata/
277
+ */
273
278
  export const MetadataService = new BaseMetadataService();
@@ -1,25 +1,28 @@
1
1
  import { AttestationFormat } from '../helpers/decodeAttestationObject.js';
2
2
  type RootCertIdentifier = AttestationFormat | 'mds';
3
- declare class BaseSettingsService {
4
- private pemCertificates;
5
- constructor();
6
- /**
7
- * Set potential root certificates for attestation formats that use them. Root certs will be tried
8
- * one-by-one when validating a certificate path.
9
- *
10
- * Certificates can be specified as a raw `Buffer`, or as a PEM-formatted string. If a
11
- * `Buffer` is passed in it will be converted to PEM format.
12
- */
3
+ interface SettingsService {
13
4
  setRootCertificates(opts: {
14
5
  identifier: RootCertIdentifier;
15
6
  certificates: (Uint8Array | string)[];
16
7
  }): void;
17
- /**
18
- * Get any registered root certificates for the specified attestation format
19
- */
20
8
  getRootCertificates(opts: {
21
9
  identifier: RootCertIdentifier;
22
10
  }): string[];
23
11
  }
24
- export declare const SettingsService: BaseSettingsService;
12
+ /**
13
+ * A basic service for specifying acceptable root certificates for all supported attestation
14
+ * statement formats.
15
+ *
16
+ * In addition, default root certificates are included for the following statement formats:
17
+ *
18
+ * - `'android-key'`
19
+ * - `'android-safetynet'`
20
+ * - `'apple'`
21
+ * - `'android-mds'`
22
+ *
23
+ * These can be overwritten as needed by setting alternative root certificates for their format
24
+ * identifier using `setRootCertificates()`.
25
+ */
26
+ export declare const SettingsService: SettingsService;
25
27
  export {};
28
+ //# sourceMappingURL=settingsService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsService.d.ts","sourceRoot":"","sources":["../../src/services/settingsService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAW1E,KAAK,kBAAkB,GAAG,iBAAiB,GAAG,KAAK,CAAC;AAEpD,UAAU,eAAe;IACvB,mBAAmB,CAAC,IAAI,EAAE;QACxB,UAAU,EAAE,kBAAkB,CAAC;QAC/B,YAAY,EAAE,CAAC,UAAU,GAAG,MAAM,CAAC,EAAE,CAAC;KACvC,GAAG,IAAI,CAAC;IACT,mBAAmB,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,kBAAkB,CAAA;KAAE,GAAG,MAAM,EAAE,CAAC;CACzE;AA4CD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,eAA2C,CAAC"}
@@ -42,6 +42,20 @@ class BaseSettingsService {
42
42
  return this.pemCertificates.get(identifier) ?? [];
43
43
  }
44
44
  }
45
+ /**
46
+ * A basic service for specifying acceptable root certificates for all supported attestation
47
+ * statement formats.
48
+ *
49
+ * In addition, default root certificates are included for the following statement formats:
50
+ *
51
+ * - `'android-key'`
52
+ * - `'android-safetynet'`
53
+ * - `'apple'`
54
+ * - `'android-mds'`
55
+ *
56
+ * These can be overwritten as needed by setting alternative root certificates for their format
57
+ * identifier using `setRootCertificates()`.
58
+ */
45
59
  export const SettingsService = new BaseSettingsService();
46
60
  // Initialize default certificates
47
61
  SettingsService.setRootCertificates({
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": "10.0.0",
3
+ "version": "11.0.0-alpha3",
6
4
  "description": "SimpleWebAuthn for Servers",
7
- "license": "MIT",
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
- "homepage": "https://github.com/MasterKale/SimpleWebAuthn/tree/master/packages/server#readme",
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
- "@simplewebauthn/types": "^10.0.0",
60
- "cross-fetch": "^4.0.0"
59
+ "cross-fetch": "^4.0.0",
60
+ "@simplewebauthn/types": "^11.0.0-alpha3"
61
61
  },
62
62
  "devDependencies": {
63
- "@types/node": "^18.11.9",
64
- "picocolors": "^1.0.0",
65
- "@deno/shim-deno-test": "~0.4.0"
63
+ "@types/node": "^20.9.0"
66
64
  },
67
- "scripts": {
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 '../deps.js';
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 = void 0;
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,11 +1,11 @@
1
- import type { AuthenticationResponseJSON, AuthenticatorDevice, Base64URLString, CredentialDeviceType, UserVerificationRequirement } from '../deps.js';
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;
5
5
  expectedChallenge: string | ((challenge: string) => boolean | Promise<boolean>);
6
6
  expectedOrigin: string | string[];
7
7
  expectedRPID: string | string[];
8
- authenticator: AuthenticatorDevice;
8
+ credential: WebAuthnCredential;
9
9
  expectedType?: string | string[];
10
10
  requireUserVerification?: boolean;
11
11
  advancedFIDOConfig?: {
@@ -21,7 +21,7 @@ export type VerifyAuthenticationResponseOpts = {
21
21
  * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateAuthenticationOptions()`
22
22
  * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
23
23
  * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
24
- * @param authenticator - An internal {@link AuthenticatorDevice} matching the credential's ID
24
+ * @param credential - An internal {@link WebAuthnCredential} corresponding to `id` in the authentication response
25
25
  * @param expectedType **(Optional)** - The response type expected ('webauthn.get')
26
26
  * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
27
27
  * @param advancedFIDOConfig **(Optional)** - Options for satisfying more stringent FIDO RP feature requirements
@@ -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 = void 0;
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");
@@ -17,14 +17,14 @@ const index_js_1 = require("../helpers/iso/index.js");
17
17
  * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateAuthenticationOptions()`
18
18
  * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
19
19
  * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
20
- * @param authenticator - An internal {@link AuthenticatorDevice} matching the credential's ID
20
+ * @param credential - An internal {@link WebAuthnCredential} corresponding to `id` in the authentication response
21
21
  * @param expectedType **(Optional)** - The response type expected ('webauthn.get')
22
22
  * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
23
23
  * @param advancedFIDOConfig **(Optional)** - Options for satisfying more stringent FIDO RP feature requirements
24
24
  * @param advancedFIDOConfig.userVerification **(Optional)** - Enable alternative rules for evaluating the User Presence and User Verified flags in authenticator data: UV (and UP) flags are optional unless this value is `"required"`
25
25
  */
26
26
  async function verifyAuthenticationResponse(options) {
27
- const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, authenticator, requireUserVerification = true, advancedFIDOConfig, } = options;
27
+ const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, credential, requireUserVerification = true, advancedFIDOConfig, } = options;
28
28
  const { id, rawId, type: credentialType, response: assertionResponse } = response;
29
29
  // Ensure credential specified an ID
30
30
  if (!id) {
@@ -144,24 +144,24 @@ async function verifyAuthenticationResponse(options) {
144
144
  const clientDataHash = await (0, toHash_js_1.toHash)(index_js_1.isoBase64URL.toBuffer(assertionResponse.clientDataJSON));
145
145
  const signatureBase = index_js_1.isoUint8Array.concat([authDataBuffer, clientDataHash]);
146
146
  const signature = index_js_1.isoBase64URL.toBuffer(assertionResponse.signature);
147
- if ((counter > 0 || authenticator.counter > 0) &&
148
- counter <= authenticator.counter) {
147
+ if ((counter > 0 || credential.counter > 0) &&
148
+ counter <= credential.counter) {
149
149
  // Error out when the counter in the DB is greater than or equal to the counter in the
150
150
  // dataStruct. It's related to how the authenticator maintains the number of times its been
151
151
  // used for this client. If this happens, then someone's somehow increased the counter
152
152
  // on the device without going through this site
153
- throw new Error(`Response counter value ${counter} was lower than expected ${authenticator.counter}`);
153
+ throw new Error(`Response counter value ${counter} was lower than expected ${credential.counter}`);
154
154
  }
155
155
  const { credentialDeviceType, credentialBackedUp } = (0, parseBackupFlags_js_1.parseBackupFlags)(flags);
156
156
  const toReturn = {
157
157
  verified: await (0, verifySignature_js_1.verifySignature)({
158
158
  signature,
159
159
  data: signatureBase,
160
- credentialPublicKey: authenticator.credentialPublicKey,
160
+ credentialPublicKey: credential.publicKey,
161
161
  }),
162
162
  authenticationInfo: {
163
163
  newCounter: counter,
164
- credentialID: authenticator.credentialID,
164
+ credentialID: credential.id,
165
165
  userVerified: flags.uv,
166
166
  credentialDeviceType,
167
167
  credentialBackedUp,
@@ -172,4 +172,3 @@ async function verifyAuthenticationResponse(options) {
172
172
  };
173
173
  return toReturn;
174
174
  }
175
- exports.verifyAuthenticationResponse = verifyAuthenticationResponse;
@@ -2,3 +2,4 @@
2
2
  * Convert the aaguid buffer in authData into a UUID string
3
3
  */
4
4
  export declare function convertAAGUIDToString(aaguid: Uint8Array): string;
5
+ //# sourceMappingURL=convertAAGUIDToString.d.ts.map
@@ -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 = void 0;
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;
@@ -2,3 +2,4 @@
2
2
  * Takes COSE-encoded public key and converts it to PKCS key
3
3
  */
4
4
  export declare function convertCOSEtoPKCS(cosePublicKey: Uint8Array): Uint8Array;
5
+ //# sourceMappingURL=convertCOSEtoPKCS.d.ts.map
@@ -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 = void 0;
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 '../deps.js';
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 = void 0;
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;
@@ -2,3 +2,4 @@
2
2
  * Take a certificate in PEM format and convert it to bytes
3
3
  */
4
4
  export declare function convertPEMToBytes(pem: string): Uint8Array;
5
+ //# sourceMappingURL=convertPEMToBytes.d.ts.map