@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
@@ -13,3 +13,4 @@
13
13
  * ```
14
14
  */
15
15
  export declare function getLogger(_name: string): (message: string, ..._rest: unknown[]) => void;
16
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/helpers/logging.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,CAGvF"}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
- // import { debug, Debugger } from '../deps.ts';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getLogger = void 0;
5
2
  // const defaultLogger = debug('SimpleWebAuthn');
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.getLogger = getLogger;
6
5
  /**
7
6
  * Generate an instance of a `debug` logger that extends off of the "simplewebauthn" namespace for
8
7
  * consistent naming.
@@ -21,4 +20,3 @@ function getLogger(_name) {
21
20
  // This is a noop for now while I search for a better debug logger technique
22
21
  return (_message, ..._rest) => { };
23
22
  }
24
- exports.getLogger = getLogger;
@@ -6,3 +6,4 @@ import { COSEALG } from './cose.js';
6
6
  * - RSA OIDs: https://oidref.com/1.2.840.113549.1.1
7
7
  */
8
8
  export declare function mapX509SignatureAlgToCOSEAlg(signatureAlgorithm: string): COSEALG;
9
+ //# sourceMappingURL=mapX509SignatureAlgToCOSEAlg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapX509SignatureAlgToCOSEAlg.d.ts","sourceRoot":"","sources":["../../src/helpers/mapX509SignatureAlgToCOSEAlg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAwBT"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapX509SignatureAlgToCOSEAlg = void 0;
3
+ exports.mapX509SignatureAlgToCOSEAlg = mapX509SignatureAlgToCOSEAlg;
4
4
  const cose_js_1 = require("./cose.js");
5
5
  /**
6
6
  * Map X.509 signature algorithm OIDs to COSE algorithm IDs
@@ -36,4 +36,3 @@ function mapX509SignatureAlgToCOSEAlg(signatureAlgorithm) {
36
36
  }
37
37
  return alg;
38
38
  }
39
- exports.mapX509SignatureAlgToCOSEAlg = mapX509SignatureAlgToCOSEAlg;
@@ -5,3 +5,4 @@
5
5
  * Raises an `UnexpectedRPIDHash` error if no match is found
6
6
  */
7
7
  export declare function matchExpectedRPID(rpIDHash: Uint8Array, expectedRPIDs: string[]): Promise<string>;
8
+ //# sourceMappingURL=matchExpectedRPID.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchExpectedRPID.d.ts","sourceRoot":"","sources":["../../src/helpers/matchExpectedRPID.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,UAAU,EACpB,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,MAAM,CAAC,CA8BjB"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.matchExpectedRPID = void 0;
3
+ exports.matchExpectedRPID = matchExpectedRPID;
4
4
  const toHash_js_1 = require("./toHash.js");
5
5
  const index_js_1 = require("./iso/index.js");
6
6
  /**
@@ -35,7 +35,6 @@ async function matchExpectedRPID(rpIDHash, expectedRPIDs) {
35
35
  throw err;
36
36
  }
37
37
  }
38
- exports.matchExpectedRPID = matchExpectedRPID;
39
38
  class UnexpectedRPIDHash extends Error {
40
39
  constructor() {
41
40
  const message = 'Unexpected RP ID hash';
@@ -26,3 +26,4 @@ export type ParsedAuthenticatorData = {
26
26
  export declare const _parseAuthenticatorDataInternals: {
27
27
  stubThis: (value: ParsedAuthenticatorData) => ParsedAuthenticatorData;
28
28
  };
29
+ //# sourceMappingURL=parseAuthenticatorData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseAuthenticatorData.d.ts","sourceRoot":"","sources":["../../src/helpers/parseAuthenticatorData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4CAA4C,EAE7C,MAAM,oCAAoC,CAAC;AAI5C;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,UAAU,GACnB,uBAAuB,CAwHzB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,UAAU,CAAC;IACrB,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE;QACL,EAAE,EAAE,OAAO,CAAC;QACZ,EAAE,EAAE,OAAO,CAAC;QACZ,EAAE,EAAE,OAAO,CAAC;QACZ,EAAE,EAAE,OAAO,CAAC;QACZ,EAAE,EAAE,OAAO,CAAC;QACZ,EAAE,EAAE,OAAO,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,cAAc,CAAC,EAAE,4CAA4C,CAAC;IAC9D,oBAAoB,CAAC,EAAE,UAAU,CAAC;CACnC,CAAC;AAGF,eAAO,MAAM,gCAAgC;sBACzB,uBAAuB;CAC1C,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._parseAuthenticatorDataInternals = exports.parseAuthenticatorData = void 0;
3
+ exports._parseAuthenticatorDataInternals = void 0;
4
+ exports.parseAuthenticatorData = parseAuthenticatorData;
4
5
  const decodeAuthenticatorExtensions_js_1 = require("./decodeAuthenticatorExtensions.js");
5
6
  const index_js_1 = require("./iso/index.js");
6
7
  /**
@@ -18,12 +19,12 @@ function parseAuthenticatorData(authData) {
18
19
  // Bit positions can be referenced here:
19
20
  // https://www.w3.org/TR/webauthn-2/#flags
20
21
  const flags = {
21
- up: !!(flagsInt & (1 << 0)),
22
- uv: !!(flagsInt & (1 << 2)),
23
- be: !!(flagsInt & (1 << 3)),
24
- bs: !!(flagsInt & (1 << 4)),
25
- at: !!(flagsInt & (1 << 6)),
26
- ed: !!(flagsInt & (1 << 7)),
22
+ up: !!(flagsInt & (1 << 0)), // User Presence
23
+ uv: !!(flagsInt & (1 << 2)), // User Verified
24
+ be: !!(flagsInt & (1 << 3)), // Backup Eligibility
25
+ bs: !!(flagsInt & (1 << 4)), // Backup State
26
+ at: !!(flagsInt & (1 << 6)), // Attested Credential Data Present
27
+ ed: !!(flagsInt & (1 << 7)), // Extension Data Present
27
28
  flagsInt,
28
29
  };
29
30
  const counterBuf = authData.slice(pointer, pointer + 4);
@@ -100,7 +101,6 @@ function parseAuthenticatorData(authData) {
100
101
  extensionsDataBuffer,
101
102
  });
102
103
  }
103
- exports.parseAuthenticatorData = parseAuthenticatorData;
104
104
  // Make it possible to stub the return value during testing
105
105
  exports._parseAuthenticatorDataInternals = {
106
106
  stubThis: (value) => value,
@@ -1,4 +1,4 @@
1
- import type { CredentialDeviceType } from '../deps.js';
1
+ import type { CredentialDeviceType } from '@simplewebauthn/types';
2
2
  /**
3
3
  * Make sense of Bits 3 and 4 in authenticator indicating:
4
4
  *
@@ -17,3 +17,4 @@ export declare function parseBackupFlags({ be, bs }: {
17
17
  export declare class InvalidBackupFlags extends Error {
18
18
  constructor(message: string);
19
19
  }
20
+ //# sourceMappingURL=parseBackupFlags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseBackupFlags.d.ts","sourceRoot":"","sources":["../../src/helpers/parseBackupFlags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,OAAO,CAAA;CAAE,GAAG;IAC1E,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAeA;AAED,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InvalidBackupFlags = exports.parseBackupFlags = void 0;
3
+ exports.InvalidBackupFlags = void 0;
4
+ exports.parseBackupFlags = parseBackupFlags;
4
5
  /**
5
6
  * Make sense of Bits 3 and 4 in authenticator indicating:
6
7
  *
@@ -20,7 +21,6 @@ function parseBackupFlags({ be, bs }) {
20
21
  }
21
22
  return { credentialDeviceType, credentialBackedUp };
22
23
  }
23
- exports.parseBackupFlags = parseBackupFlags;
24
24
  class InvalidBackupFlags extends Error {
25
25
  constructor(message) {
26
26
  super(message);
@@ -4,3 +4,4 @@ import { COSEALG } from './cose.js';
4
4
  * SHA-256.
5
5
  */
6
6
  export declare function toHash(data: Uint8Array | string, algorithm?: COSEALG): Promise<Uint8Array>;
7
+ //# sourceMappingURL=toHash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toHash.d.ts","sourceRoot":"","sources":["../../src/helpers/toHash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;;GAGG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,UAAU,GAAG,MAAM,EACzB,SAAS,GAAE,OAAY,GACtB,OAAO,CAAC,UAAU,CAAC,CAQrB"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toHash = void 0;
3
+ exports.toHash = toHash;
4
4
  const index_js_1 = require("./iso/index.js");
5
5
  /**
6
6
  * Returns hash digest of the given data, using the given algorithm when provided. Defaults to using
@@ -13,4 +13,3 @@ function toHash(data, algorithm = -7) {
13
13
  const digest = index_js_1.isoCrypto.digest(data, algorithm);
14
14
  return digest;
15
15
  }
16
- exports.toHash = toHash;
@@ -4,3 +4,4 @@
4
4
  * @param rootCertificates Possible root certificates to complete the path
5
5
  */
6
6
  export declare function validateCertificatePath(certificates: string[], rootCertificates?: string[]): Promise<boolean>;
7
+ //# sourceMappingURL=validateCertificatePath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateCertificatePath.d.ts","sourceRoot":"","sources":["../../src/helpers/validateCertificatePath.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,EAAE,EACtB,gBAAgB,GAAE,MAAM,EAAO,GAC9B,OAAO,CAAC,OAAO,CAAC,CAuClB"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateCertificatePath = void 0;
4
- const deps_js_1 = require("../deps.js");
3
+ exports.validateCertificatePath = validateCertificatePath;
4
+ const asn1_schema_1 = require("@peculiar/asn1-schema");
5
5
  const isCertRevoked_js_1 = require("./isCertRevoked.js");
6
6
  const verifySignature_js_1 = require("./verifySignature.js");
7
7
  const mapX509SignatureAlgToCOSEAlg_js_1 = require("./mapX509SignatureAlgToCOSEAlg.js");
@@ -51,7 +51,6 @@ async function validateCertificatePath(certificates, rootCertificates = []) {
51
51
  }
52
52
  return true;
53
53
  }
54
- exports.validateCertificatePath = validateCertificatePath;
55
54
  async function _validatePath(certificates) {
56
55
  if (new Set(certificates).size !== certificates.length) {
57
56
  throw new Error('Invalid certificate path: found duplicate certificates');
@@ -94,7 +93,7 @@ async function _validatePath(certificates) {
94
93
  throw new InvalidSubjectAndIssuer();
95
94
  }
96
95
  // Verify the subject certificate's signature with the issuer cert's public key
97
- const data = deps_js_1.AsnSerializer.serialize(x509Subject.tbsCertificate);
96
+ const data = asn1_schema_1.AsnSerializer.serialize(x509Subject.tbsCertificate);
98
97
  const signature = x509Subject.signatureValue;
99
98
  const signatureAlgorithm = (0, mapX509SignatureAlgToCOSEAlg_js_1.mapX509SignatureAlgToCOSEAlg)(x509Subject.signatureAlgorithm.algorithm);
100
99
  const issuerCertBytes = (0, convertPEMToBytes_js_1.convertPEMToBytes)(issuerPem);
@@ -0,0 +1,7 @@
1
+ import { Extensions } from '@peculiar/asn1-x509';
2
+ /**
3
+ * Look for the id-fido-gen-ce-aaguid certificate extension. If it's present then check it against
4
+ * the attestation statement AAGUID.
5
+ */
6
+ export declare function validateExtFIDOGenCEAAGUID(certExtensions: Extensions | undefined, aaguid: Uint8Array): boolean;
7
+ //# sourceMappingURL=validateExtFIDOGenCEAAGUID.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateExtFIDOGenCEAAGUID.d.ts","sourceRoot":"","sources":["../../src/helpers/validateExtFIDOGenCEAAGUID.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAWjD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,UAAU,GAAG,SAAS,EACtC,MAAM,EAAE,UAAU,GACjB,OAAO,CA6BT"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateExtFIDOGenCEAAGUID = validateExtFIDOGenCEAAGUID;
4
+ const asn1_schema_1 = require("@peculiar/asn1-schema");
5
+ const index_js_1 = require("./iso/index.js");
6
+ /**
7
+ * Attestation Certificate Extension OID: `id-fido-gen-ce-aaguid`
8
+ *
9
+ * Sourced from https://fidoalliance.org/specs/fido-v2.0-ps-20150904/fido-key-attestation-v2.0-ps-20150904.html#verifying-an-attestation-statement
10
+ */
11
+ const id_fido_gen_ce_aaguid = '1.3.6.1.4.1.45724.1.1.4';
12
+ /**
13
+ * Look for the id-fido-gen-ce-aaguid certificate extension. If it's present then check it against
14
+ * the attestation statement AAGUID.
15
+ */
16
+ function validateExtFIDOGenCEAAGUID(certExtensions, aaguid) {
17
+ // The certificate had no extensions so there's nothing to validate
18
+ if (!certExtensions) {
19
+ return true;
20
+ }
21
+ const extFIDOGenCEAAGUID = certExtensions.find((ext) => ext.extnID === id_fido_gen_ce_aaguid);
22
+ // The extension isn't present so there's nothing to validate
23
+ if (!extFIDOGenCEAAGUID) {
24
+ return true;
25
+ }
26
+ // Parse the extension value
27
+ const parsedExtFIDOGenCEAAGUID = asn1_schema_1.AsnParser.parse(extFIDOGenCEAAGUID.extnValue, asn1_schema_1.OctetString);
28
+ const extValue = new Uint8Array(parsedExtFIDOGenCEAAGUID.buffer);
29
+ // Compare the two values
30
+ const aaguidAndExtAreEqual = index_js_1.isoUint8Array.areEqual(aaguid, extValue);
31
+ if (!aaguidAndExtAreEqual) {
32
+ const _debugExtHex = index_js_1.isoUint8Array.toHex(extValue);
33
+ const _debugAAGUIDHex = index_js_1.isoUint8Array.toHex(aaguid);
34
+ throw new Error(`Certificate extension id-fido-gen-ce-aaguid (${id_fido_gen_ce_aaguid}) value of "${_debugExtHex}" was present but not equal to attestation statement AAGUID value of "${_debugAAGUIDHex}"`);
35
+ }
36
+ return true;
37
+ }
@@ -12,3 +12,4 @@ export declare function verifySignature(opts: {
12
12
  export declare const _verifySignatureInternals: {
13
13
  stubThis: (value: Promise<boolean>) => Promise<boolean>;
14
14
  };
15
+ //# sourceMappingURL=verifySignature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifySignature.d.ts","sourceRoot":"","sources":["../../src/helpers/verifySignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,MAAM,WAAW,CAAC;AAKnD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,SAAS,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,OAAO,CAAC,CAmCnB;AAGD,eAAO,MAAM,yBAAyB;sBAClB,OAAO,CAAC,OAAO,CAAC;CACnC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._verifySignatureInternals = exports.verifySignature = void 0;
3
+ exports._verifySignatureInternals = void 0;
4
+ exports.verifySignature = verifySignature;
4
5
  const index_js_1 = require("./iso/index.js");
5
6
  const decodeCredentialPublicKey_js_1 = require("./decodeCredentialPublicKey.js");
6
7
  const convertX509PublicKeyToCOSE_js_1 = require("./convertX509PublicKeyToCOSE.js");
@@ -29,7 +30,6 @@ function verifySignature(opts) {
29
30
  shaHashOverride: hashAlgorithm,
30
31
  }));
31
32
  }
32
- exports.verifySignature = verifySignature;
33
33
  // Make it possible to stub the return value during testing
34
34
  exports._verifySignatureInternals = {
35
35
  stubThis: (value) => value,
package/script/index.d.ts CHANGED
@@ -15,3 +15,4 @@ import type { MetadataStatement } from './metadata/mdsTypes.js';
15
15
  import type { VerifiedRegistrationResponse, VerifyRegistrationResponseOpts } from './registration/verifyRegistrationResponse.js';
16
16
  import type { VerifiedAuthenticationResponse, VerifyAuthenticationResponseOpts } from './authentication/verifyAuthenticationResponse.js';
17
17
  export type { GenerateAuthenticationOptionsOpts, GenerateRegistrationOptionsOpts, MetadataStatement, VerifiedAuthenticationResponse, VerifiedRegistrationResponse, VerifyAuthenticationResponseOpts, VerifyRegistrationResponseOpts, };
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,4BAA4B,EAC5B,0BAA0B,GAC3B,CAAC;AAEF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,mDAAmD,CAAC;AAC3G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EACV,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,kDAAkD,CAAC;AAE1D,YAAY,EACV,iCAAiC,EACjC,+BAA+B,EAC/B,iBAAiB,EACjB,8BAA8B,EAC9B,4BAA4B,EAC5B,gCAAgC,EAChC,8BAA8B,GAC/B,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Base64URLString } from '../deps.js';
1
+ import type { Base64URLString } from '@simplewebauthn/types';
2
2
  /**
3
3
  * Metadata Service structures
4
4
  * https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html
@@ -214,3 +214,4 @@ export type AuthenticatorGetInfo = {
214
214
  }[];
215
215
  };
216
216
  export {};
217
+ //# sourceMappingURL=mdsTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdsTypes.d.ts","sourceRoot":"","sources":["../../src/metadata/mdsTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,eAAe,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,wBAAwB,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC,CAAC,EAAE,MAAM,EAAE,CAAC;IAChD,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACjD,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM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C,QAAQ,EAAE,CAAC,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,EAAE,CAAC,EAAE,OAAO,CAAC;QACb,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,EAAE,CAAC,EAAE,OAAO,CAAC;QACb,EAAE,CAAC,EAAE,OAAO,CAAC;KACd,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACpD,CAAC"}
@@ -2,3 +2,4 @@
2
2
  * Process a JWT into Javascript-friendly data structures
3
3
  */
4
4
  export declare function parseJWT<T1, T2>(jwt: string): [T1, T2, string];
5
+ //# sourceMappingURL=parseJWT.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseJWT.d.ts","sourceRoot":"","sources":["../../src/metadata/parseJWT.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,CAO9D"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseJWT = void 0;
3
+ exports.parseJWT = parseJWT;
4
4
  const index_js_1 = require("../helpers/iso/index.js");
5
5
  /**
6
6
  * Process a JWT into Javascript-friendly data structures
@@ -13,4 +13,3 @@ function parseJWT(jwt) {
13
13
  parts[2],
14
14
  ];
15
15
  }
16
- exports.parseJWT = parseJWT;
@@ -1,4 +1,4 @@
1
- import type { Base64URLString } from '../deps.js';
1
+ import type { Base64URLString } from '@simplewebauthn/types';
2
2
  import type { AlgSign, MetadataStatement } from './mdsTypes.js';
3
3
  import { COSEALG, COSECRV, COSEKTY } from '../helpers/cose.js';
4
4
  /**
@@ -27,3 +27,4 @@ export declare const algSignToCOSEInfoMap: {
27
27
  [key in AlgSign]: COSEInfo;
28
28
  };
29
29
  export {};
30
+ //# sourceMappingURL=verifyAttestationWithMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyAttestationWithMetadata.d.ts","sourceRoot":"","sources":["../../src/metadata/verifyAttestationWithMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAY,OAAO,EAAsB,MAAM,oBAAoB,CAAC;AAE7F;;;GAGG;AACH,wBAAsB,6BAA6B,CAAC,EAClD,SAAS,EACT,mBAAmB,EACnB,GAAG,EACH,uBAAuB,GACxB,EAAE;IACD,SAAS,EAAE,iBAAiB,CAAC;IAC7B,mBAAmB,EAAE,UAAU,CAAC;IAChC,GAAG,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE,CAAC;IACtC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC,GAAG,OAAO,CAAC,OAAO,CAAC,CAoJnB;AAED,KAAK,QAAQ,GAAG;IACd,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE;KAAG,GAAG,IAAI,OAAO,GAAG,QAAQ;CAe9D,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.algSignToCOSEInfoMap = exports.verifyAttestationWithMetadata = void 0;
3
+ exports.algSignToCOSEInfoMap = void 0;
4
+ exports.verifyAttestationWithMetadata = verifyAttestationWithMetadata;
4
5
  const convertCertBufferToPEM_js_1 = require("../helpers/convertCertBufferToPEM.js");
5
6
  const validateCertificatePath_js_1 = require("../helpers/validateCertificatePath.js");
6
7
  const decodeCredentialPublicKey_js_1 = require("../helpers/decodeCredentialPublicKey.js");
@@ -119,7 +120,6 @@ async function verifyAttestationWithMetadata({ statement, credentialPublicKey, x
119
120
  }
120
121
  return true;
121
122
  }
122
- exports.verifyAttestationWithMetadata = verifyAttestationWithMetadata;
123
123
  /**
124
124
  * Convert ALG_SIGN values to COSE info
125
125
  *
@@ -8,3 +8,4 @@
8
8
  * (Pulled from https://www.rfc-editor.org/rfc/rfc7515#section-4.1.1)
9
9
  */
10
10
  export declare function verifyJWT(jwt: string, leafCert: Uint8Array): Promise<boolean>;
11
+ //# sourceMappingURL=verifyJWT.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyJWT.d.ts","sourceRoot":"","sources":["../../src/metadata/verifyJWT.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CA0B7E"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyJWT = void 0;
3
+ exports.verifyJWT = verifyJWT;
4
4
  const convertX509PublicKeyToCOSE_js_1 = require("../helpers/convertX509PublicKeyToCOSE.js");
5
5
  const index_js_1 = require("../helpers/iso/index.js");
6
6
  const cose_js_1 = require("../helpers/cose.js");
@@ -38,4 +38,3 @@ function verifyJWT(jwt, leafCert) {
38
38
  const kty = certCOSE.get(cose_js_1.COSEKEYS.kty);
39
39
  throw new Error(`JWT verification with public key of kty ${kty} is not supported by this method`);
40
40
  }
41
- exports.verifyJWT = verifyJWT;
@@ -1,4 +1,4 @@
1
- import type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticatorSelectionCriteria, AuthenticatorTransportFuture, Base64URLString, COSEAlgorithmIdentifier, PublicKeyCredentialCreationOptionsJSON } from '../deps.js';
1
+ import type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticatorSelectionCriteria, AuthenticatorTransportFuture, Base64URLString, COSEAlgorithmIdentifier, PublicKeyCredentialCreationOptionsJSON } from '@simplewebauthn/types';
2
2
  export type GenerateRegistrationOptionsOpts = {
3
3
  rpName: string;
4
4
  rpID: string;
@@ -41,3 +41,4 @@ export declare const supportedCOSEAlgorithmIdentifiers: COSEAlgorithmIdentifier[
41
41
  * @param supportedAlgorithmIDs **(Optional)** - Array of numeric COSE algorithm identifiers supported for attestation by this RP. See https://www.iana.org/assignments/cose/cose.xhtml#algorithms. Defaults to `[-8, -7, -257]`
42
42
  */
43
43
  export declare function generateRegistrationOptions(options: GenerateRegistrationOptionsOpts): Promise<PublicKeyCredentialCreationOptionsJSON>;
44
+ //# sourceMappingURL=generateRegistrationOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateRegistrationOptions.d.ts","sourceRoot":"","sources":["../../src/registration/generateRegistrationOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,oCAAoC,EACpC,8BAA8B,EAC9B,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,sCAAsC,EAEvC,MAAM,uBAAuB,CAAC;AAM/B,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,+BAA+B,CAAC;IAClD,kBAAkB,CAAC,EAAE;QACnB,EAAE,EAAE,eAAe,CAAC;QACpB,UAAU,CAAC,EAAE,4BAA4B,EAAE,CAAC;KAC7C,EAAE,CAAC;IACJ,sBAAsB,CAAC,EAAE,8BAA8B,CAAC;IACxD,UAAU,CAAC,EAAE,oCAAoC,CAAC;IAClD,qBAAqB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAE,uBAAuB,EAqBtE,CAAC;AAsBF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,sCAAsC,CAAC,CAiHjD"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateRegistrationOptions = exports.supportedCOSEAlgorithmIdentifiers = void 0;
3
+ exports.supportedCOSEAlgorithmIdentifiers = void 0;
4
+ exports.generateRegistrationOptions = generateRegistrationOptions;
4
5
  const generateChallenge_js_1 = require("../helpers/generateChallenge.js");
5
6
  const generateUserID_js_1 = require("../helpers/generateUserID.js");
6
7
  const index_js_1 = require("../helpers/iso/index.js");
@@ -161,4 +162,3 @@ async function generateRegistrationOptions(options) {
161
162
  },
162
163
  };
163
164
  }
164
- exports.generateRegistrationOptions = generateRegistrationOptions;
@@ -45,3 +45,4 @@ export declare const TPM_ECC_CURVE_COSE_CRV_MAP: {
45
45
  [key: string]: number;
46
46
  };
47
47
  export {};
48
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/constants.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAEH;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAkB3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAsC5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAUlD,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;CAiFhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAM/D,CAAC"}
@@ -112,6 +112,10 @@ exports.TPM_MANUFACTURERS = {
112
112
  name: 'IBM',
113
113
  id: 'IBM',
114
114
  },
115
+ 'id:49424D00': {
116
+ name: 'IBM',
117
+ id: 'IBM',
118
+ },
115
119
  'id:49465800': {
116
120
  name: 'Infineon',
117
121
  id: 'IFX',
@@ -177,9 +181,9 @@ exports.TPM_MANUFACTURERS = {
177
181
  * Match TPM public area curve ID's to `crv` numbers used in COSE public keys
178
182
  */
179
183
  exports.TPM_ECC_CURVE_COSE_CRV_MAP = {
180
- TPM_ECC_NIST_P256: 1,
181
- TPM_ECC_NIST_P384: 2,
182
- TPM_ECC_NIST_P521: 3,
183
- TPM_ECC_BN_P256: 1,
184
+ TPM_ECC_NIST_P256: 1, // p256
185
+ TPM_ECC_NIST_P384: 2, // p384
186
+ TPM_ECC_NIST_P521: 3, // p521
187
+ TPM_ECC_BN_P256: 1, // p256
184
188
  TPM_ECC_SM2_P256: 1, // p256
185
189
  };
@@ -22,3 +22,4 @@ type ParsedCertInfo = {
22
22
  };
23
23
  };
24
24
  export {};
25
+ //# sourceMappingURL=parseCertInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseCertInfo.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/parseCertInfo.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,UAAU,GAAG,cAAc,CAkElE;AAED,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,UAAU,CAAC;IAC5B,SAAS,EAAE,UAAU,CAAC;IACtB,SAAS,EAAE;QACT,KAAK,EAAE,UAAU,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;IACF,eAAe,EAAE,UAAU,CAAC;IAC5B,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,UAAU,CAAC;QAC1B,IAAI,EAAE,UAAU,CAAC;QACjB,aAAa,EAAE,UAAU,CAAC;KAC3B,CAAC;CACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseCertInfo = void 0;
3
+ exports.parseCertInfo = parseCertInfo;
4
4
  const constants_js_1 = require("./constants.js");
5
5
  const index_js_1 = require("../../../helpers/iso/index.js");
6
6
  /**
@@ -59,4 +59,3 @@ function parseCertInfo(certInfo) {
59
59
  attested,
60
60
  };
61
61
  }
62
- exports.parseCertInfo = parseCertInfo;
@@ -41,3 +41,4 @@ type ECCParameters = {
41
41
  kdf: string;
42
42
  };
43
43
  export {};
44
+ //# sourceMappingURL=parsePubArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsePubArea.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/parsePubArea.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,GAAG,aAAa,CAyG/D;AAED,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,aAAa,GAAG,aAAa,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE;QAChB,QAAQ,EAAE,OAAO,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,EAAE,OAAO,CAAC;QACrB,mBAAmB,EAAE,OAAO,CAAC;QAC7B,YAAY,EAAE,OAAO,CAAC;QACtB,eAAe,EAAE,OAAO,CAAC;QACzB,IAAI,EAAE,OAAO,CAAC;QACd,oBAAoB,EAAE,OAAO,CAAC;QAC9B,UAAU,EAAE,OAAO,CAAC;QACpB,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE;QACV,GAAG,CAAC,EAAE,aAAa,CAAC;QACpB,GAAG,CAAC,EAAE,aAAa,CAAC;KACrB,CAAC;IACF,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parsePubArea = void 0;
3
+ exports.parsePubArea = parsePubArea;
4
4
  const constants_js_1 = require("./constants.js");
5
5
  const index_js_1 = require("../../../helpers/iso/index.js");
6
6
  /**
@@ -95,4 +95,3 @@ function parsePubArea(pubArea) {
95
95
  unique,
96
96
  };
97
97
  }
98
- exports.parsePubArea = parsePubArea;
@@ -1,2 +1,3 @@
1
1
  import type { AttestationFormatVerifierOpts } from '../../verifyRegistrationResponse.js';
2
2
  export declare function verifyAttestationTPM(options: AttestationFormatVerifierOpts): Promise<boolean>;
3
+ //# sourceMappingURL=verifyAttestationTPM.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyAttestationTPM.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/verifyAttestationTPM.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAuBzF,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA+VlB"}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyAttestationTPM = void 0;
4
- const deps_js_1 = require("../../../deps.js");
3
+ exports.verifyAttestationTPM = verifyAttestationTPM;
4
+ const asn1_schema_1 = require("@peculiar/asn1-schema");
5
+ const asn1_x509_1 = require("@peculiar/asn1-x509");
5
6
  const decodeCredentialPublicKey_js_1 = require("../../../helpers/decodeCredentialPublicKey.js");
6
7
  const cose_js_1 = require("../../../helpers/cose.js");
7
8
  const toHash_js_1 = require("../../../helpers/toHash.js");
@@ -10,6 +11,7 @@ const validateCertificatePath_js_1 = require("../../../helpers/validateCertifica
10
11
  const getCertificateInfo_js_1 = require("../../../helpers/getCertificateInfo.js");
11
12
  const verifySignature_js_1 = require("../../../helpers/verifySignature.js");
12
13
  const index_js_1 = require("../../../helpers/iso/index.js");
14
+ const validateExtFIDOGenCEAAGUID_js_1 = require("../../../helpers/validateExtFIDOGenCEAAGUID.js");
13
15
  const metadataService_js_1 = require("../../../services/metadataService.js");
14
16
  const verifyAttestationWithMetadata_js_1 = require("../../../metadata/verifyAttestationWithMetadata.js");
15
17
  const constants_js_1 = require("./constants.js");
@@ -170,18 +172,18 @@ async function verifyAttestationTPM(options) {
170
172
  /**
171
173
  * Plumb the depths of the certificate's ASN.1-formatted data for some values we need to verify
172
174
  */
173
- const parsedCert = deps_js_1.AsnParser.parse(x5c[0], deps_js_1.Certificate);
175
+ const parsedCert = asn1_schema_1.AsnParser.parse(x5c[0], asn1_x509_1.Certificate);
174
176
  if (!parsedCert.tbsCertificate.extensions) {
175
177
  throw new Error('Certificate was missing extensions (TPM)');
176
178
  }
177
179
  let subjectAltNamePresent;
178
180
  let extKeyUsage;
179
181
  parsedCert.tbsCertificate.extensions.forEach((ext) => {
180
- if (ext.extnID === deps_js_1.id_ce_subjectAltName) {
181
- subjectAltNamePresent = deps_js_1.AsnParser.parse(ext.extnValue, deps_js_1.SubjectAlternativeName);
182
+ if (ext.extnID === asn1_x509_1.id_ce_subjectAltName) {
183
+ subjectAltNamePresent = asn1_schema_1.AsnParser.parse(ext.extnValue, asn1_x509_1.SubjectAlternativeName);
182
184
  }
183
- else if (ext.extnID === deps_js_1.id_ce_extKeyUsage) {
184
- extKeyUsage = deps_js_1.AsnParser.parse(ext.extnValue, deps_js_1.ExtendedKeyUsage);
185
+ else if (ext.extnID === asn1_x509_1.id_ce_extKeyUsage) {
186
+ extKeyUsage = asn1_schema_1.AsnParser.parse(ext.extnValue, asn1_x509_1.ExtendedKeyUsage);
185
187
  }
186
188
  });
187
189
  // Check that certificate contains subjectAltName (2.5.29.17) extension,
@@ -209,8 +211,14 @@ async function verifyAttestationTPM(options) {
209
211
  if (extKeyUsage[0] !== '2.23.133.8.3') {
210
212
  throw new Error(`Unexpected extKeyUsage "${extKeyUsage[0]}", expected "2.23.133.8.3" (TPM)`);
211
213
  }
212
- // TODO: If certificate contains id-fido-gen-ce-aaguid(1.3.6.1.4.1.45724.1.1.4) extension, check
213
- // that it’s value is set to the same AAGUID as in authData.
214
+ // Validate attestation statement AAGUID against leaf cert AAGUID
215
+ try {
216
+ await (0, validateExtFIDOGenCEAAGUID_js_1.validateExtFIDOGenCEAAGUID)(parsedCert.tbsCertificate.extensions, aaguid);
217
+ }
218
+ catch (err) {
219
+ const _err = err;
220
+ throw new Error(`${_err.message} (TPM)`);
221
+ }
214
222
  // Run some metadata checks if a statement exists for this authenticator
215
223
  const statement = await metadataService_js_1.MetadataService.getStatement(aaguid);
216
224
  if (statement) {
@@ -246,7 +254,6 @@ async function verifyAttestationTPM(options) {
246
254
  hashAlgorithm: alg,
247
255
  });
248
256
  }
249
- exports.verifyAttestationTPM = verifyAttestationTPM;
250
257
  /**
251
258
  * Contain logic for pulling TPM-specific values out of subjectAlternativeName extension
252
259
  */