diff --git a/.gitattributes b/.gitattributes
index c5fd65b3add7b4be01655a0e8c583f70f3172054..837453aa80abd0a273f4e5f18df2eb922f950424 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -41,3 +41,6 @@ node_modules/@rolldown/binding-linux-x64-gnu/rolldown-binding.linux-x64-gnu.node
node_modules/@rolldown/binding-linux-x64-musl/rolldown-binding.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
node_modules/@rollup/rollup-linux-x64-gnu/rollup.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
node_modules/@rollup/rollup-linux-x64-musl/rollup.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
+node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
+node_modules/@swc/core-linux-x64-musl/swc.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
+node_modules/@trivago/prettier-plugin-sort-imports/.yarn/install-state.gz filter=lfs diff=lfs merge=lfs -text
diff --git a/node_modules/@scarf/scarf/LICENSE b/node_modules/@scarf/scarf/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..584253b5b9fa7ec0d8232097ca93edbce27992ec
--- /dev/null
+++ b/node_modules/@scarf/scarf/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2020 Scarf Systems, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/node_modules/@scarf/scarf/README.md b/node_modules/@scarf/scarf/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..3dda84f25ed6aeb4f153ce69778dbb8ec9e7688c
--- /dev/null
+++ b/node_modules/@scarf/scarf/README.md
@@ -0,0 +1,198 @@
+# scarf-js
+
+
+[](https://badge.fury.io/js/%40scarf%2Fscarf)
+
+
+
+
+
+Scarf is like Google Analytics for your npm packages. By sending some basic
+details after installation, this package can help you can gain insight into how
+your packages are used and by which companies. Scarf aims to help open-source developers
+fund their work when it is used commercially.
+
+To read more about why we wrote this library, check out [this post](https://github.com/scarf-sh/scarf-js/blob/master/WHY.org) on the topic.
+
+### Features
+
+- No dependencies.
+- Fully transparent to the user. Scarf will log its behavior to the console
+ during installation. It will never silently report analytics for someone that
+ hasn't explictly given permission to do so.
+- Never interrupts your package installation. Reporting is done on a best effort basis.
+
+### Installing
+
+You'll first need to create a library entry on [Scarf](https://scarf.sh). Once
+created, add a dependency on this library to your own:
+
+```bash
+npm i --save @scarf/scarf
+```
+
+Once your library is published to npm with this change, Scarf will automatically
+collect stats on install, no additional code is required!
+
+Head to your package's dashboard on Scarf to see your reports when available.
+
+### Configuring
+
+Users of your package will be opted in by default and can opt out by setting the
+`SCARF_ANALYTICS=false` environment variable. If you'd like Scarf analytics to
+instead be opt-in, you can set this by adding an entry to your `package.json`
+
+
+```json5
+// your-package/package.json
+
+{
+ // ...
+ "scarfSettings": {
+ "defaultOptIn": false
+ }
+ // ...
+}
+```
+
+Scarf will now be opt-out by default, and users can set `SCARF_ANALYTICS=true`
+to opt in.
+
+Regardless of the default state, Scarf will log what it is doing to users who
+haven't explictly opted in or out.
+
+By default, scarf-js will only trigger analytics when your package is installed as a dependency of another package, or is being installed globally. This ensures that scarf-js analytics will not be triggered on `npm install` being run _within your project_. To change this, you can add:
+
+```json5
+// your-package/package.json
+
+{
+ // ...
+ "scarfSettings": {
+ "allowTopLevel": true
+ }
+ // ...
+}
+```
+
+
+#### Full Configuration Example
+
+```json5
+// your-package/package.json
+
+{
+ // ...
+ "scarfSettings": {
+ // Toggles whether Scarf is enabled for this package
+ "enabled": true,
+ // Enables Scarf when users run npm install directly in your repository
+ // Scarf will try to report the Git commit SHA of your repository if it can
+ // be obtained.
+ "allowTopLevel": true,
+ // Users will be opted into analytics by default
+ "defaultOptIn": true,
+ // By default, Scarf searches for its own location in your build's dependency
+ // graph to ensure reporting can be done for all packages using Scarf.
+ // For large projects with lots of dependencies, generating that dependency
+ // graph takes more time than Scarf allots for its entire process, so Scarf
+ // will always time out. `skipTraversal` is an optional flag for large
+ // applications to skip that traversal entirely. Use this flag with caution and
+ // care, as it will break Scarf analytics for all other packages you depend
+ // on in your build.
+ "skipTraversal": false
+ }
+ // ...
+}
+```
+
+### FAQ
+
+#### What information does scarf-js provide me as a package author?
+
+- Understanding your user-base
+ - Which companies are using your package?
+ - Is your project growing or shrinking? Where? On which platforms?
+- Which versions of your package are being used?
+
+#### As a user of a package using scarf-js, what information does scarf-js send about me?
+
+*Scarf does not store personally identifying information.* Scarf aims to collect information that is helpful for:
+- Open Source package maintainence
+- Open Source commercialization
+
+Specifically, scarf-js sends:
+
+- The operating system you are using
+- Your IP address will be used to look up any available company information. _Scarf does not store the actual IP address_
+- Limited dependency tree information. Scarf sends the name and version of the package(s) that directly depend on scarf-js. Additionally, scarf-js will send SHA256-hashed name and version for the following packages in the dependency tree:
+ - Packages that depend on a package that depends on scarf-js.
+ - The root package of the dependency tree.
+This allows Scarf to provide information for maintainers about which public packages are using their own, without exposing identifying details of non-public packages.
+
+You can have scarf-js print the exact JSON payload it sends by setting `SCARF_VERBOSE=true` in your environment.
+
+#### As a user of a package using scarf-js, how can I opt out of analytics?
+
+Scarf's analytics help support developers of the open source packages you are
+using, so enabling analytics is appreciated. However, if you'd like to opt out,
+you can add your preference to your project's `package.json`:
+
+
+```json5
+// your-package/package.json
+
+{
+ // ...
+ "scarfSettings": {
+ "enabled": false
+ }
+ // ...
+}
+```
+
+Alternatively, you can set this variable in your environment:
+
+```shell
+export SCARF_ANALYTICS=false
+```
+
+You can also set this variable in accordance to the [Console Do Not Track](https://consoledonottrack.com/) standard:
+```shell
+export DO_NOT_TRACK=1
+```
+
+Either route will disable Scarf for all packages.
+
+#### I distribute a package on npm, and scarf-js is in our dependency tree. Can I disable the analytics for my downstream dependents?
+
+Yes. By opting out of analytics via `package.json`, any package upstream will have analytics disbabled.
+
+```json5
+// your-package/package.json
+
+{
+ // ...
+ "scarfSettings": {
+ "enabled": false
+ }
+ // ...
+}
+```
+
+Installers of your packages will have scarf-js disabled for all dependencies upstream from yours.
+
+
+### Developing
+
+Setting the environment variable `SCARF_LOCAL_PORT=8080` will configure Scarf to
+use http://localhost:8080 as the analytics endpoint host.
+
+### Future work
+
+Future releases of scarf-js will provide a module of utility functions to
+collect usage analytics in addition to the current installation analytics.
+
+### Community
+
+Join the [Scarf-Community workspace](https://tinyurl.com/scarf-community-slack) on Slack and find us in the #scarf-js channel. We'll keep an eye out for your questions and concerns.
diff --git a/node_modules/@scarf/scarf/package.json b/node_modules/@scarf/scarf/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..8e691fe29daed6f30d1738b20535ef3f6f70695b
--- /dev/null
+++ b/node_modules/@scarf/scarf/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "@scarf/scarf",
+ "version": "1.4.0",
+ "description": "Scarf is like Google Analytics for your npm packages. Gain insights into how your packages are installed and used, and by which companies.",
+ "main": "report.js",
+ "homepage": "https://github.com/scarf-sh/scarf-js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/scarf-sh/scarf-js.git"
+ },
+ "files": [
+ "report.js"
+ ],
+ "scripts": {
+ "postinstall": "node ./report.js",
+ "test": "jest --verbose"
+ },
+ "author": "Scarf Systems",
+ "license": "Apache-2.0",
+ "devDependencies": {
+ "jest": "^25.3.0",
+ "minimist": "^1.2.2",
+ "standard": "^14.3.1"
+ },
+ "standard": {
+ "globals": [
+ "expect",
+ "test",
+ "jest",
+ "beforeAll",
+ "afterAll",
+ "fail",
+ "describe"
+ ]
+ }
+}
diff --git a/node_modules/@scarf/scarf/report.js b/node_modules/@scarf/scarf/report.js
new file mode 100644
index 0000000000000000000000000000000000000000..9b1c48723506f049c931334ff223422528b3fdd8
--- /dev/null
+++ b/node_modules/@scarf/scarf/report.js
@@ -0,0 +1,574 @@
+const path = require('path')
+const os = require('os')
+const exec = require('child_process').exec
+const localDevPort = process.env.SCARF_LOCAL_PORT
+const https = localDevPort ? require('http') : require('https')
+const fs = require('fs')
+const fsAsync = fs.promises
+const util = require('util')
+
+const scarfHost = localDevPort ? 'localhost' : 'scarf.sh'
+const scarfLibName = '@scarf/scarf'
+const privatePackageRewrite = '@private/private'
+const privateVersionRewrite = '0'
+
+const rootPath = process.env.INIT_CWD
+
+// Pulled into a function for test mocking
+function tmpFileName () {
+ // throttle per user
+ const username = os.userInfo().username
+ return path.join(os.tmpdir(), `scarf-js-history-${username}.log`)
+}
+
+// Pulled into a function for test mocking
+function dirName () {
+ return __dirname
+}
+
+function npmExecPath () {
+ return process.env.npm_execpath
+}
+
+const userMessageThrottleTime = 1000 * 60 // 1 minute
+
+const execTimeout = 3000
+
+// In general, these keys should never change to remain backwards compatible
+// with previous versions of Scarf. If we need to update them, we'll need to
+// make sure we can read the previous values as well
+const optedInLogRateLimitKey = 'optedInLastLog'
+const optedOutLogRateLimitKey = 'optedOutLastLog'
+
+const makeDefaultSettings = () => {
+ return {
+ defaultOptIn: true
+ }
+}
+
+function logIfVerbose (toLog, stream) {
+ if (process.env.SCARF_VERBOSE === 'true') {
+ (stream || console.log)(toLog)
+ }
+}
+
+// SCARF_NO_ANALYTICS was the original variable, we'll get rid of it eventually
+const userHasOptedOut = (rootPackage) => {
+ return (rootPackage && rootPackage.scarfSettings && rootPackage.scarfSettings.enabled === false) ||
+ (process.env.SCARF_ANALYTICS === 'false' || process.env.SCARF_NO_ANALYTICS === 'true' || process.env.DO_NOT_TRACK === '1')
+}
+
+const userHasOptedIn = (rootPackage) => {
+ return (rootPackage && rootPackage.scarfSettings && rootPackage.scarfSettings.enabled) || process.env.SCARF_ANALYTICS === 'true'
+}
+
+// Packages that depend on Scarf can configure whether to should fire when
+// `npm install` is being run directly from within the package, rather than from a
+// dependent package
+function allowTopLevel (rootPackage) {
+ return rootPackage && rootPackage.scarfSettings && rootPackage.scarfSettings.allowTopLevel
+}
+
+function skipTraversal (rootPackage) {
+ return rootPackage && rootPackage.scarfSettings && rootPackage.scarfSettings.skipTraversal
+}
+
+function parentIsRoot (dependencyToReport) {
+ const parent = dependencyToReport.parent
+ const rootPackage = dependencyToReport.rootPackage
+
+ return parent && rootPackage && parent.name === rootPackage.name && parent.version === rootPackage.version
+}
+
+function isTopLevel (dependencyToReport) {
+ return parentIsRoot(dependencyToReport) && !process.env.npm_config_global
+}
+
+function isGlobal (dependencyToReport) {
+ return parentIsRoot(dependencyToReport) && !!process.env.npm_config_global
+}
+
+function hashWithDefault (toHash, defaultReturn) {
+ let crypto
+ try {
+ crypto = require('crypto')
+ } catch (err) {
+ logIfVerbose('node crypto module unavailable')
+ }
+
+ if (crypto && toHash) {
+ return crypto.createHash('sha256').update(toHash, 'utf-8').digest('hex')
+ } else {
+ return defaultReturn
+ }
+}
+
+// We don't send any paths, hash package names and versions
+function redactSensitivePackageInfo (dependencyInfo) {
+ if (dependencyInfo.grandparent && dependencyInfo.grandparent.name) {
+ dependencyInfo.grandparent.nameHash = hashWithDefault(dependencyInfo.grandparent.name, privatePackageRewrite)
+ dependencyInfo.grandparent.versionHash = hashWithDefault(dependencyInfo.grandparent.version, privateVersionRewrite)
+ }
+
+ if (dependencyInfo.rootPackage && dependencyInfo.rootPackage.name) {
+ dependencyInfo.rootPackage.nameHash = hashWithDefault(dependencyInfo.rootPackage.name, privatePackageRewrite)
+ dependencyInfo.rootPackage.versionHash = hashWithDefault(dependencyInfo.rootPackage.version, privateVersionRewrite)
+ }
+
+ delete (dependencyInfo.rootPackage.packageJsonPath)
+ delete (dependencyInfo.rootPackage.path)
+ delete (dependencyInfo.rootPackage.name)
+ delete (dependencyInfo.rootPackage.version)
+ delete (dependencyInfo.parent.path)
+ delete (dependencyInfo.scarf.path)
+ if (dependencyInfo.grandparent) {
+ delete (dependencyInfo.grandparent.path)
+ delete (dependencyInfo.grandparent.name)
+ delete (dependencyInfo.grandparent.version)
+ }
+ return dependencyInfo
+}
+
+/*
+ Scarf-js is automatically disabled when being run inside of a yarn install.
+ The `npm_execpath` environment variable tells us which package manager is
+ running our install
+ */
+function isYarn () {
+ const execPath = module.exports.npmExecPath() || ''
+ return ['yarn', 'yarn.js', 'yarnpkg', 'yarn.cmd', 'yarnpkg.cmd']
+ .some(packageManBinName => execPath.endsWith(packageManBinName))
+}
+
+function processDependencyTreeOutput (resolve, reject) {
+ return function (error, stdout, stderr) {
+ if (error && !stdout) {
+ return reject(new Error(`Scarf received an error from npm -ls: ${error} | ${stderr}`))
+ }
+
+ try {
+ const output = JSON.parse(stdout)
+
+ const depsToScarf = findScarfInFullDependencyTree(output).filter(depChain => depChain.length >= 2)
+ if (!depsToScarf.length) {
+ return reject(new Error('No Scarf parent package found'))
+ }
+ const rootPackageDetails = rootPackageDepInfo(output)
+
+ const dependencyInfo = depsToScarf.map(depChain => {
+ return {
+ scarf: depChain[depChain.length - 1],
+ parent: depChain[depChain.length - 2],
+ grandparent: depChain[depChain.length - 3],
+ rootPackage: rootPackageDetails,
+ anyInChainDisabled: depChain.some(dep => {
+ return (dep.scarfSettings || {}).enabled === false
+ })
+ }
+ })
+
+ dependencyInfo.forEach(d => {
+ d.parent.scarfSettings = Object.assign(makeDefaultSettings(), d.parent.scarfSettings || {})
+ })
+
+ // Here, we find the dependency chain that corresponds to the scarf package we're currently in
+ const dependencyToReport = dependencyInfo.find(dep => (dep.scarf.path === module.exports.dirName())) || dependencyInfo[0]
+ if (!dependencyToReport) {
+ return reject(new Error(`Couldn't find dependency info for path ${module.exports.dirName()}`))
+ }
+
+ // If any intermediate dependency in the chain of deps that leads to scarf
+ // has disabled Scarf, we must respect that setting unless the user overrides it.
+ if (dependencyToReport.anyInChainDisabled && !userHasOptedIn(dependencyToReport.rootPackage)) {
+ return reject(new Error('Scarf has been disabled via a package.json in the dependency chain.'))
+ }
+
+ if (isTopLevel(dependencyToReport) && !isGlobal(dependencyToReport) && !allowTopLevel(rootPackageDetails)) {
+ return reject(new Error('The package depending on Scarf is the root package being installed, but Scarf is not configured to run in this case. To enable it, set `scarfSettings.allowTopLevel = true` in your package.json'))
+ }
+
+ return resolve(dependencyToReport)
+ } catch (err) {
+ logIfVerbose(err, console.error)
+ return reject(err)
+ }
+ }
+}
+
+function processGitRevParseOutput (resolve, reject) {
+ return function (error, stdout, stderr) {
+ if (error && !stdout) {
+ return reject(new Error(`Scarf received an error from git rev-parse: ${error} | ${stderr}`))
+ }
+
+ const output = String(stdout).trim()
+
+ if (output.length > 0) {
+ return resolve(output)
+ } else {
+ return reject(new Error('Scarf did not receive usable output from git rev-parse'))
+ }
+ }
+}
+
+// packageJSONOverride: a test convenience to set a packageJSON explicitly.
+// Leave empty to use the actual root package.json.
+async function getDependencyInfo (packageJSONOverride) {
+ try {
+ const rootPackageJSON = require(packageJSONOverride || path.join(rootPath, 'package.json'))
+ const scarfPackageJSON = require(path.join(dirName(), 'package.json'))
+
+ if (skipTraversal(rootPackageJSON)) {
+ logIfVerbose('skipping dependency tree traversal')
+ const rootInfoToReport = {
+ name: rootPackageJSON.name,
+ version: rootPackageJSON.version,
+ scarfSettings: { ...makeDefaultSettings(), ...rootPackageJSON.scarfSettings }
+ }
+ const shallowDepInfo = {
+ scarf: { name: '@scarf/scarf', version: scarfPackageJSON.version },
+ parent: { ...rootInfoToReport },
+ rootPackage: { ...rootInfoToReport },
+ anyInChainDisabled: false,
+ skippedTraversal: true
+ }
+ logIfVerbose(util.inspect(shallowDepInfo))
+ return shallowDepInfo
+ }
+ } catch (err) {
+ logIfVerbose(err, console.error)
+ }
+
+ return new Promise((resolve, reject) => {
+ exec(`cd ${rootPath} && npm ls @scarf/scarf --json --long`, { timeout: execTimeout, maxBuffer: 1024 * 1024 * 1024 }, processDependencyTreeOutput(resolve, reject))
+ })
+}
+
+async function getGitShaFromRootPath () {
+ const promise = new Promise((resolve, reject) => {
+ exec(`cd ${rootPath} && git rev-parse HEAD`, { timeout: execTimeout, maxBuffer: 1024 * 1024 * 1024 }, processGitRevParseOutput(resolve, reject))
+ })
+ try {
+ return await promise
+ } catch (e) {
+ logIfVerbose(e)
+ return undefined
+ }
+}
+
+async function reportPostInstall () {
+ const scarfApiToken = process.env.SCARF_API_TOKEN
+
+ const dependencyInfo = await module.exports.getDependencyInfo()
+ logIfVerbose(dependencyInfo)
+ if (!dependencyInfo.parent || !dependencyInfo.parent.name) {
+ return Promise.reject(new Error('No parent found, nothing to report'))
+ }
+
+ if (parentIsRoot(dependencyInfo) && allowTopLevel(dependencyInfo.rootPackage)) {
+ const gitSha = await getGitShaFromRootPath()
+ logIfVerbose(`Injecting sha to parent: ${gitSha}`)
+ dependencyInfo.parent.gitSha = gitSha
+ }
+
+ const rootPackage = dependencyInfo.rootPackage
+
+ if (!userHasOptedIn(rootPackage) && isYarn()) {
+ return Promise.reject(new Error('Package manager is yarn. scarf-js is unable to inform user of analytics. Aborting.'))
+ }
+
+ await new Promise((resolve, reject) => {
+ if (dependencyInfo.parent.scarfSettings.defaultOptIn) {
+ if (userHasOptedOut(rootPackage)) {
+ return reject(new Error('User has opted out'))
+ }
+
+ if (!userHasOptedIn(rootPackage)) {
+ rateLimitedUserLog(optedInLogRateLimitKey, `
+ The dependency '${dependencyInfo.parent.name}' is tracking installation
+ statistics using scarf-js (https://scarf.sh), which helps open-source developers
+ fund and maintain their projects. Scarf securely logs basic installation
+ details when this package is installed. The Scarf npm library is open source
+ and permissively licensed at https://github.com/scarf-sh/scarf-js. For more
+ details about your project's dependencies, try running 'npm ls'. To opt out of
+ analytics, set the environment variable 'SCARF_ANALYTICS=false'.
+ `)
+ }
+ resolve(dependencyInfo)
+ } else {
+ if (!userHasOptedIn(rootPackage)) {
+ if (!userHasOptedOut(rootPackage)) {
+ // We'll only print the 'please opt in' text if the user hasn't
+ // already opted out, and our logging rate limit hasn't been reached
+ if (hasHitRateLimit(optedOutLogRateLimitKey, getRateLimitedLogHistory())) {
+ return reject(new Error('Analytics are opt-out by default, but rate limit already hit for prompting opt-in.'))
+ }
+ rateLimitedUserLog(optedOutLogRateLimitKey, `
+ The dependency '${dependencyInfo.parent.name}' would like to track
+ installation statistics using scarf-js (https://scarf.sh), which helps
+ open-source developers fund and maintain their projects. Reporting is disabled
+ by default for this package. When enabled, Scarf securely logs basic
+ installation details when this package is installed. The Scarf npm library is
+ open source and permissively licensed at https://github.com/scarf-sh/scarf-js.
+ For more details about your project's dependencies, try running 'npm ls'.
+ `
+ )
+ const stdin = process.stdin
+ stdin.setEncoding('utf-8')
+
+ process.stdout.write(`Would you like to support ${dependencyInfo.parent.name} by sending analytics for this install? (y/N): `)
+
+ const timeout1 = setTimeout(() => {
+ console.log('')
+ console.log('No opt in received, skipping analytics')
+ reject(new Error('Timeout waiting for user opt in'))
+ }, 7000)
+
+ stdin.on('data', async function (data) {
+ clearTimeout(timeout1)
+ const enabled = data.trim().toLowerCase() === 'y'
+
+ const afterUserInput = (enabled, saved) => {
+ if (enabled) {
+ console.log('Thanks for enabling analytics!')
+ }
+
+ if (!saved) {
+ console.log('To prevent this message in the future, you can also set the `SCARF_ANALYTICS=true|false` environment variable')
+ }
+
+ if (enabled) {
+ return resolve(dependencyInfo)
+ } else {
+ return reject(new Error('Not enabled via cli'))
+ }
+ }
+
+ process.stdout.write('Save this preference to your project\'s package.json file? (y/N): ')
+
+ setTimeout(() => {
+ console.log('')
+ return afterUserInput(enabled, false)
+ }, 15000)
+
+ stdin.removeAllListeners('data')
+ stdin.on('data', async function (data) {
+ try {
+ const savePreference = data.trim().toLowerCase() === 'y'
+ if (savePreference) {
+ await savePreferencesToRootPackage(dependencyInfo.rootPackage.packageJsonPath, enabled)
+ }
+ return afterUserInput(enabled, savePreference)
+ } catch (err) {
+ logIfVerbose(err, console.error)
+ return reject(err)
+ }
+ })
+ })
+ }
+ } else {
+ resolve(dependencyInfo)
+ }
+ }
+ })
+
+ redactSensitivePackageInfo(dependencyInfo)
+
+ const infoPayload = {
+ libraryType: 'npm',
+ rawPlatform: os.platform(),
+ rawArch: os.arch(),
+ nodeVersion: process.versions.node,
+ dependencyInfo: dependencyInfo
+ }
+
+ const data = JSON.stringify(infoPayload)
+ logIfVerbose(`Scarf payload: ${data}`)
+
+ const reqOptions = {
+ host: scarfHost,
+ port: localDevPort,
+ method: 'POST',
+ path: '/package-event/install',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Content-Length': data.length
+ },
+ timeout: execTimeout
+ }
+
+ if (scarfApiToken) {
+ const authToken = Buffer.from(`n/a:${scarfApiToken}`).toString('base64')
+ reqOptions.headers.Authorization = `Basic ${authToken}`
+ }
+
+ await new Promise((resolve, reject) => {
+ const req = https.request(reqOptions, (res) => {
+ logIfVerbose(`Response status: ${res.statusCode}`)
+ resolve()
+ })
+
+ req.on('error', error => {
+ logIfVerbose(error, console.error)
+ reject(error)
+ })
+
+ req.on('timeout', error => {
+ logIfVerbose(error, console.error)
+ reject(error)
+ })
+
+ req.write(data)
+ req.end()
+ })
+}
+
+// Find all paths to Scarf from the json output of npm ls @scarf/scarf --json in
+// the root package being installed by the user
+//
+// [{
+// scarf: {name: `@scarf/scarf`, version: '0.0.1'},
+// parent: { name: 'scarfed-library', version: '1.0.0', scarfSettings: { defaultOptIn: true } },
+// grandparent: { name: 'scarfed-lib-consumer', version: '1.0.0' }
+// }]
+function findScarfInSubDepTree (pathToDep, deps) {
+ const depNames = Object.keys(deps || {})
+
+ if (!depNames) {
+ return []
+ }
+
+ const scarfFound = depNames.find(depName => depName === scarfLibName)
+ const output = []
+ if (scarfFound) {
+ output.push(pathToDep.concat([{ name: scarfLibName, version: deps[scarfLibName].version, path: deps[scarfLibName].path }]))
+ }
+ for (let i = 0; i < depNames.length; i++) {
+ const depName = depNames[i]
+ const newPathToDep = pathToDep.concat([
+ {
+ name: depName,
+ version: deps[depName].version,
+ scarfSettings: deps[depName].scarfSettings,
+ path: deps[depName].path
+ }
+ ])
+ const results = findScarfInSubDepTree(newPathToDep, deps[depName].dependencies)
+ if (results) {
+ for (let j = 0; j < results.length; j++) {
+ output.push(results[j])
+ }
+ }
+ }
+
+ return output
+}
+
+function findScarfInFullDependencyTree (tree) {
+ if (tree.name === scarfLibName) {
+ return [[{ name: scarfLibName, version: tree.version }]]
+ } else {
+ return findScarfInSubDepTree([packageDetailsFromDepInfo(tree)], tree.dependencies)
+ }
+}
+
+function packageDetailsFromDepInfo (tree) {
+ return {
+ name: tree.name,
+ version: tree.version,
+ scarfSettings: tree.scarfSettings,
+ path: tree.path
+ }
+}
+
+function rootPackageDepInfo (packageInfo) {
+ if (process.env.npm_config_global) {
+ packageInfo = Object.values(packageInfo.dependencies)[0]
+ }
+ const info = packageDetailsFromDepInfo(packageInfo)
+ info.packageJsonPath = `${packageInfo.path}/package.json`
+ return info
+}
+
+async function savePreferencesToRootPackage (path, optIn) {
+ const packageJsonString = await fsAsync.readFile(path)
+ const parsed = JSON.parse(packageJsonString)
+ parsed.scarfSettings = {
+ enabled: optIn
+ }
+ await fsAsync.writeFile(path, JSON.stringify(parsed, null, 2))
+}
+
+/*
+ If Scarf-js appears in many different spots in a package's dependency tree, we
+ want to avoid spamming the user with the same message informing them of
+ Scarf's analytics. Rate limited logs will record timestamps of logging in a
+ temp file. Before logging something to the user, we will verify we're not over
+ the rate limit.
+*/
+function rateLimitedUserLog (rateLimitKey, toLog) {
+ const history = getRateLimitedLogHistory()
+ if (!hasHitRateLimit(rateLimitKey, history)) {
+ writeCurrentTimeToLogHistory(rateLimitKey, history)
+ console.log(toLog)
+ } else {
+ logIfVerbose(`[SUPPRESSED USER MESSAGE, RATE LIMIT HIT] ${toLog}`)
+ }
+}
+
+function getRateLimitedLogHistory () {
+ let history
+ try {
+ history = JSON.parse(fs.readFileSync(module.exports.tmpFileName()))
+ } catch (e) {
+ logIfVerbose(e)
+ }
+ return history || {}
+}
+
+// Current rate limit: 1/minute
+function hasHitRateLimit (rateLimitKey, history) {
+ if (!history || !history[rateLimitKey]) {
+ return false
+ }
+
+ const lastLog = history[rateLimitKey]
+ return (new Date().getTime() - lastLog) < userMessageThrottleTime
+}
+
+function writeCurrentTimeToLogHistory (rateLimitKey, history) {
+ history[rateLimitKey] = new Date().getTime()
+ fs.writeFileSync(module.exports.tmpFileName(), JSON.stringify(history))
+}
+
+module.exports = {
+ redactSensitivePackageInfo,
+ hasHitRateLimit,
+ getRateLimitedLogHistory,
+ rateLimitedUserLog,
+ tmpFileName,
+ dirName,
+ processDependencyTreeOutput,
+ processGitRevParseOutput,
+ npmExecPath,
+ getDependencyInfo,
+ getGitShaFromRootPath,
+ reportPostInstall,
+ hashWithDefault,
+ findScarfInFullDependencyTree
+}
+
+if (require.main === module) {
+ try {
+ reportPostInstall().catch(e => {
+ // This is an optional, best effort attempt. If there are any errors in
+ // Scarf, we must not interfere with whatever the user is doing
+ logIfVerbose(`\n\n${e}`, console.error)
+ }).finally(() => {
+ process.exit(0)
+ })
+ } catch (e) {
+ logIfVerbose(`\n\nTop level error: ${e}`, console.error)
+ process.exit(0)
+ }
+}
diff --git a/node_modules/@simplewebauthn/server/LICENSE.md b/node_modules/@simplewebauthn/server/LICENSE.md
new file mode 100644
index 0000000000000000000000000000000000000000..adb1965c5dc8dd3b8b52a1a275686eb46dfcbb83
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/LICENSE.md
@@ -0,0 +1,18 @@
+MIT License
+
+Copyright (c) 2020 Matthew Miller
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
+OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@simplewebauthn/server/README.md b/node_modules/@simplewebauthn/server/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..b6189b02c62fce96bf1e24f3609ae0f00cdd8329
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/README.md
@@ -0,0 +1,47 @@
+# @simplewebauthn/server
+
+
+[](https://www.npmjs.com/package/@simplewebauthn/server)
+[](https://jsr.io/@simplewebauthn/server)
+
+- [Installation](#installation)
+ - [Node LTS 20.x and higher](#node-lts-20x-and-higher)
+ - [Deno v1.43 and higher](#deno-v143-and-higher)
+- [Documentation](#documentation)
+- [Supported Attestation Formats](#supported-attestation-formats)
+
+## Installation
+
+This package can be installed from **[NPM](https://www.npmjs.com/package/@simplewebauthn/server)**
+and **[JSR](https://jsr.io/@simplewebauthn/server)**:
+
+### Node LTS 20.x and higher
+
+```sh
+npm install @simplewebauthn/server
+```
+
+### Deno v1.43 and higher
+
+```sh
+deno add jsr:@simplewebauthn/server
+```
+
+## Documentation
+
+You can find in-depth documentation on this package here:
+https://simplewebauthn.dev/docs/packages/server
+
+## Supported Attestation Formats
+
+SimpleWebAuthn supports
+[all current WebAuthn attestation formats](https://w3c.github.io/webauthn/#sctn-defined-attestation-formats),
+including:
+
+- **Android Key**
+- **Android SafetyNet**
+- **Apple**
+- **FIDO U2F**
+- **Packed**
+- **TPM**
+- **None**
diff --git a/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.d.ts b/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..169709bb3591161d1383466fb56ed8ff537930fc
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.d.ts
@@ -0,0 +1,26 @@
+import type { AuthenticationExtensionsClientInputs, AuthenticatorTransportFuture, Base64URLString, PublicKeyCredentialRequestOptionsJSON, Uint8Array_ } from '../types/index.js';
+export type GenerateAuthenticationOptionsOpts = Parameters[0];
+/**
+ * Prepare a value to pass into navigator.credentials.get(...) for authenticator authentication
+ *
+ * **Options:**
+ *
+ * @param rpID - Valid domain name (after `https://`)
+ * @param allowCredentials **(Optional)** - Authenticators previously registered by the user, if any. If undefined the client will ask the user which credential they want to use
+ * @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back user for authentication. Defaults to generating a random value
+ * @param timeout **(Optional)** - How long (in ms) the user can take to complete authentication. Defaults to `60000`
+ * @param userVerification **(Optional)** - Set to `'discouraged'` when asserting as part of a 2FA flow, otherwise set to `'preferred'` or `'required'` as desired. Defaults to `"preferred"`
+ * @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during authentication
+ */
+export declare function generateAuthenticationOptions(options: {
+ rpID: string;
+ allowCredentials?: {
+ id: Base64URLString;
+ transports?: AuthenticatorTransportFuture[];
+ }[];
+ challenge?: string | Uint8Array_;
+ timeout?: number;
+ userVerification?: 'required' | 'preferred' | 'discouraged';
+ extensions?: AuthenticationExtensionsClientInputs;
+}): Promise;
+//# sourceMappingURL=generateAuthenticationOptions.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.d.ts.map b/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..5dd96c4f8c41a6d235ffd4f1dca83c40d03ec3cc
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.d.ts.map
@@ -0,0 +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,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAI3B,MAAM,MAAM,iCAAiC,GAAG,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpG;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE;IACP,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,WAAW,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;IAC5D,UAAU,CAAC,EAAE,oCAAoC,CAAC;CACnD,GACA,OAAO,CAAC,qCAAqC,CAAC,CAoChD"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.js b/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.js
new file mode 100644
index 0000000000000000000000000000000000000000..88599a855965bd15222ce9a4e250bd6f190fd214
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.js
@@ -0,0 +1,41 @@
+import { isoBase64URL, isoUint8Array } from '../helpers/iso/index.js';
+import { generateChallenge } from '../helpers/generateChallenge.js';
+/**
+ * Prepare a value to pass into navigator.credentials.get(...) for authenticator authentication
+ *
+ * **Options:**
+ *
+ * @param rpID - Valid domain name (after `https://`)
+ * @param allowCredentials **(Optional)** - Authenticators previously registered by the user, if any. If undefined the client will ask the user which credential they want to use
+ * @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back user for authentication. Defaults to generating a random value
+ * @param timeout **(Optional)** - How long (in ms) the user can take to complete authentication. Defaults to `60000`
+ * @param userVerification **(Optional)** - Set to `'discouraged'` when asserting as part of a 2FA flow, otherwise set to `'preferred'` or `'required'` as desired. Defaults to `"preferred"`
+ * @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during authentication
+ */
+export async function generateAuthenticationOptions(options) {
+ const { allowCredentials, challenge = await generateChallenge(), timeout = 60000, userVerification = 'preferred', extensions, rpID, } = options;
+ /**
+ * Preserve ability to specify `string` values for challenges
+ */
+ let _challenge = challenge;
+ if (typeof _challenge === 'string') {
+ _challenge = isoUint8Array.fromUTF8String(_challenge);
+ }
+ return {
+ rpId: rpID,
+ challenge: isoBase64URL.fromBuffer(_challenge),
+ allowCredentials: allowCredentials?.map((cred) => {
+ if (!isoBase64URL.isBase64URL(cred.id)) {
+ throw new Error(`allowCredential id "${cred.id}" is not a valid base64url string`);
+ }
+ return {
+ ...cred,
+ id: isoBase64URL.trimPadding(cred.id),
+ type: 'public-key',
+ };
+ }),
+ timeout,
+ userVerification,
+ extensions,
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.d.ts b/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..71565af91a0d75b4d5aab5f66ae3c0461826187a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.d.ts
@@ -0,0 +1,67 @@
+import type { AuthenticationResponseJSON, Base64URLString, CredentialDeviceType, UserVerificationRequirement, WebAuthnCredential } from '../types/index.js';
+import type { AuthenticationExtensionsAuthenticatorOutputs } from '../helpers/decodeAuthenticatorExtensions.js';
+/**
+ * Configurable options when calling `verifyAuthenticationResponse()`
+ */
+export type VerifyAuthenticationResponseOpts = Parameters[0];
+/**
+ * Verify that the user has legitimately completed the authentication process
+ *
+ * **Options:**
+ *
+ * @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`
+ * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateAuthenticationOptions()`
+ * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
+ * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
+ * @param credential - An internal {@link WebAuthnCredential} corresponding to `id` in the authentication response
+ * @param expectedType **(Optional)** - The response type expected ('webauthn.get')
+ * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
+ * @param advancedFIDOConfig **(Optional)** - Options for satisfying more stringent FIDO RP feature requirements
+ * @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"`
+ */
+export declare function verifyAuthenticationResponse(options: {
+ response: AuthenticationResponseJSON;
+ expectedChallenge: string | ((challenge: string) => boolean | Promise);
+ expectedOrigin: string | string[];
+ expectedRPID: string | string[];
+ credential: WebAuthnCredential;
+ expectedType?: string | string[];
+ requireUserVerification?: boolean;
+ advancedFIDOConfig?: {
+ userVerification?: UserVerificationRequirement;
+ };
+}): Promise;
+/**
+ * Result of authentication verification
+ *
+ * @param verified If the authentication response could be verified
+ * @param authenticationInfo.credentialID The ID of the authenticator used during authentication.
+ * Should be used to identify which DB authenticator entry needs its `counter` updated to the value
+ * below
+ * @param authenticationInfo.newCounter The number of times the authenticator identified above
+ * reported it has been used. **Should be kept in a DB for later reference to help prevent replay
+ * attacks!**
+ * @param authenticationInfo.credentialDeviceType Whether this is a single-device or multi-device
+ * credential. **Should be kept in a DB for later reference!**
+ * @param authenticationInfo.credentialBackedUp Whether or not the multi-device credential has been
+ * backed up. Always `false` for single-device credentials. **Should be kept in a DB for later
+ * reference!**
+ * @param authenticationInfo.origin The origin of the website that the authentication occurred on
+ * @param authenticationInfo.rpID The RP ID that the authentication occurred on
+ * @param authenticationInfo?.authenticatorExtensionResults The authenticator extensions returned
+ * by the browser
+ */
+export type VerifiedAuthenticationResponse = {
+ verified: boolean;
+ authenticationInfo: {
+ credentialID: Base64URLString;
+ newCounter: number;
+ userVerified: boolean;
+ credentialDeviceType: CredentialDeviceType;
+ credentialBackedUp: boolean;
+ origin: string;
+ rpID: string;
+ authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs;
+ };
+};
+//# sourceMappingURL=verifyAuthenticationResponse.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.d.ts.map b/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..29504d8454039dd34d6c2f0f716b12acf4397279
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.d.ts.map
@@ -0,0 +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,mBAAmB,CAAC;AAM3B,OAAO,KAAK,EAAE,4CAA4C,EAAE,MAAM,6CAA6C,CAAC;AAIhH;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC;AAElG;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE;IACP,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,GACA,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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.js b/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.js
new file mode 100644
index 0000000000000000000000000000000000000000..5fdb6f404cb3bfa46a49a32b5e066d969d9cb768
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.js
@@ -0,0 +1,171 @@
+import { decodeClientDataJSON } from '../helpers/decodeClientDataJSON.js';
+import { toHash } from '../helpers/toHash.js';
+import { verifySignature } from '../helpers/verifySignature.js';
+import { parseAuthenticatorData } from '../helpers/parseAuthenticatorData.js';
+import { parseBackupFlags } from '../helpers/parseBackupFlags.js';
+import { matchExpectedRPID } from '../helpers/matchExpectedRPID.js';
+import { isoBase64URL, isoUint8Array } from '../helpers/iso/index.js';
+/**
+ * Verify that the user has legitimately completed the authentication process
+ *
+ * **Options:**
+ *
+ * @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`
+ * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateAuthenticationOptions()`
+ * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
+ * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
+ * @param credential - An internal {@link WebAuthnCredential} corresponding to `id` in the authentication response
+ * @param expectedType **(Optional)** - The response type expected ('webauthn.get')
+ * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
+ * @param advancedFIDOConfig **(Optional)** - Options for satisfying more stringent FIDO RP feature requirements
+ * @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"`
+ */
+export async function verifyAuthenticationResponse(options) {
+ const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, credential, requireUserVerification = true, advancedFIDOConfig, } = options;
+ const { id, rawId, type: credentialType, response: assertionResponse } = response;
+ // Ensure credential specified an ID
+ if (!id) {
+ throw new Error('Missing credential ID');
+ }
+ // Ensure ID is base64url-encoded
+ if (id !== rawId) {
+ throw new Error('Credential ID was not base64url-encoded');
+ }
+ // Make sure credential type is public-key
+ if (credentialType !== 'public-key') {
+ throw new Error(`Unexpected credential type ${credentialType}, expected "public-key"`);
+ }
+ if (!response) {
+ throw new Error('Credential missing response');
+ }
+ if (typeof assertionResponse?.clientDataJSON !== 'string') {
+ throw new Error('Credential response clientDataJSON was not a string');
+ }
+ const clientDataJSON = decodeClientDataJSON(assertionResponse.clientDataJSON);
+ const { type, origin, challenge, tokenBinding } = clientDataJSON;
+ // Make sure we're handling an authentication
+ if (Array.isArray(expectedType)) {
+ if (!expectedType.includes(type)) {
+ const joinedExpectedType = expectedType.join(', ');
+ throw new Error(`Unexpected authentication response type "${type}", expected one of: ${joinedExpectedType}`);
+ }
+ }
+ else if (expectedType) {
+ if (type !== expectedType) {
+ throw new Error(`Unexpected authentication response type "${type}", expected "${expectedType}"`);
+ }
+ }
+ else if (type !== 'webauthn.get') {
+ throw new Error(`Unexpected authentication response type: ${type}`);
+ }
+ // Ensure the device provided the challenge we gave it
+ if (typeof expectedChallenge === 'function') {
+ if (!(await expectedChallenge(challenge))) {
+ throw new Error(`Custom challenge verifier returned false for registration response challenge "${challenge}"`);
+ }
+ }
+ else if (challenge !== expectedChallenge) {
+ throw new Error(`Unexpected authentication response challenge "${challenge}", expected "${expectedChallenge}"`);
+ }
+ // Check that the origin is our site
+ if (Array.isArray(expectedOrigin)) {
+ if (!expectedOrigin.includes(origin)) {
+ const joinedExpectedOrigin = expectedOrigin.join(', ');
+ throw new Error(`Unexpected authentication response origin "${origin}", expected one of: ${joinedExpectedOrigin}`);
+ }
+ }
+ else {
+ if (origin !== expectedOrigin) {
+ throw new Error(`Unexpected authentication response origin "${origin}", expected "${expectedOrigin}"`);
+ }
+ }
+ if (!isoBase64URL.isBase64URL(assertionResponse.authenticatorData)) {
+ throw new Error('Credential response authenticatorData was not a base64url string');
+ }
+ if (!isoBase64URL.isBase64URL(assertionResponse.signature)) {
+ throw new Error('Credential response signature was not a base64url string');
+ }
+ if (assertionResponse.userHandle &&
+ typeof assertionResponse.userHandle !== 'string') {
+ throw new Error('Credential response userHandle was not a string');
+ }
+ if (tokenBinding) {
+ if (typeof tokenBinding !== 'object') {
+ throw new Error('ClientDataJSON tokenBinding was not an object');
+ }
+ if (['present', 'supported', 'notSupported'].indexOf(tokenBinding.status) < 0) {
+ throw new Error(`Unexpected tokenBinding status ${tokenBinding.status}`);
+ }
+ }
+ const authDataBuffer = isoBase64URL.toBuffer(assertionResponse.authenticatorData);
+ const parsedAuthData = parseAuthenticatorData(authDataBuffer);
+ const { rpIdHash, flags, counter, extensionsData } = parsedAuthData;
+ // Make sure the response's RP ID is ours
+ let expectedRPIDs = [];
+ if (typeof expectedRPID === 'string') {
+ expectedRPIDs = [expectedRPID];
+ }
+ else {
+ expectedRPIDs = expectedRPID;
+ }
+ const matchedRPID = await matchExpectedRPID(rpIdHash, expectedRPIDs);
+ if (advancedFIDOConfig !== undefined) {
+ const { userVerification: fidoUserVerification } = advancedFIDOConfig;
+ /**
+ * Use FIDO Conformance-defined rules for verifying UP and UV flags
+ */
+ if (fidoUserVerification === 'required') {
+ // Require `flags.uv` be true (implies `flags.up` is true)
+ if (!flags.uv) {
+ throw new Error('User verification required, but user could not be verified');
+ }
+ }
+ else if (fidoUserVerification === 'preferred' ||
+ fidoUserVerification === 'discouraged') {
+ // Ignore `flags.uv`
+ }
+ }
+ else {
+ /**
+ * Use WebAuthn spec-defined rules for verifying UP and UV flags
+ */
+ // WebAuthn only requires the user presence flag be true
+ if (!flags.up) {
+ throw new Error('User not present during authentication');
+ }
+ // Enforce user verification if required
+ if (requireUserVerification && !flags.uv) {
+ throw new Error('User verification required, but user could not be verified');
+ }
+ }
+ const clientDataHash = await toHash(isoBase64URL.toBuffer(assertionResponse.clientDataJSON));
+ const signatureBase = isoUint8Array.concat([authDataBuffer, clientDataHash]);
+ const signature = isoBase64URL.toBuffer(assertionResponse.signature);
+ if ((counter > 0 || credential.counter > 0) &&
+ counter <= credential.counter) {
+ // Error out when the counter in the DB is greater than or equal to the counter in the
+ // dataStruct. It's related to how the authenticator maintains the number of times its been
+ // used for this client. If this happens, then someone's somehow increased the counter
+ // on the device without going through this site
+ throw new Error(`Response counter value ${counter} was lower than expected ${credential.counter}`);
+ }
+ const { credentialDeviceType, credentialBackedUp } = parseBackupFlags(flags);
+ const toReturn = {
+ verified: await verifySignature({
+ signature,
+ data: signatureBase,
+ credentialPublicKey: credential.publicKey,
+ }),
+ authenticationInfo: {
+ newCounter: counter,
+ credentialID: credential.id,
+ userVerified: flags.uv,
+ credentialDeviceType,
+ credentialBackedUp,
+ authenticatorExtensionResults: extensionsData,
+ origin: clientDataJSON.origin,
+ rpID: matchedRPID,
+ },
+ };
+ return toReturn;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..64f45fd20a463ad6e98aa722f20ef1042bf2d1a1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.d.ts
@@ -0,0 +1,6 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Convert the aaguid buffer in authData into a UUID string
+ */
+export declare function convertAAGUIDToString(aaguid: Uint8Array_): string;
+//# sourceMappingURL=convertAAGUIDToString.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..38add2e808c1f7fc893b0746add24677eac20bba
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"convertAAGUIDToString.d.ts","sourceRoot":"","sources":["../../src/helpers/convertAAGUIDToString.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAcjE"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.js b/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.js
new file mode 100644
index 0000000000000000000000000000000000000000..ffda9f897e2cb86ffac5c1db57ba57f6c827d9a9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.js
@@ -0,0 +1,17 @@
+import { isoUint8Array } from './iso/index.js';
+/**
+ * Convert the aaguid buffer in authData into a UUID string
+ */
+export function convertAAGUIDToString(aaguid) {
+ // Raw Hex: adce000235bcc60a648b0b25f1f05503
+ const hex = isoUint8Array.toHex(aaguid);
+ const segments = [
+ hex.slice(0, 8), // 8
+ hex.slice(8, 12), // 4
+ hex.slice(12, 16), // 4
+ hex.slice(16, 20), // 4
+ hex.slice(20, 32), // 8
+ ];
+ // Formatted: adce0002-35bc-c60a-648b-0b25f1f05503
+ return segments.join('-');
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c838350700bcf29fdf0db0a7558c75dc08f955e8
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.d.ts
@@ -0,0 +1,6 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Takes COSE-encoded public key and converts it to PKCS key
+ */
+export declare function convertCOSEtoPKCS(cosePublicKey: Uint8Array_): Uint8Array_;
+//# sourceMappingURL=convertCOSEtoPKCS.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..acc72bf3f333a59750eec7e56b4e5b77140320c8
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"convertCOSEtoPKCS.d.ts","sourceRoot":"","sources":["../../src/helpers/convertCOSEtoPKCS.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,WAAW,GAAG,WAAW,CAmBzE"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.js b/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.js
new file mode 100644
index 0000000000000000000000000000000000000000..c415570a63579631ffbe0c77c04f59ab8280512e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.js
@@ -0,0 +1,21 @@
+import { isoCBOR, isoUint8Array } from './iso/index.js';
+import { COSEKEYS } from './cose.js';
+/**
+ * Takes COSE-encoded public key and converts it to PKCS key
+ */
+export function convertCOSEtoPKCS(cosePublicKey) {
+ // This is a little sloppy, I'm using COSEPublicKeyEC2 since it could have both x and y, but when
+ // there's no y it means it's probably better typed as COSEPublicKeyOKP. I'll leave this for now
+ // and revisit it later if it ever becomes an actual problem.
+ const struct = isoCBOR.decodeFirst(cosePublicKey);
+ const tag = Uint8Array.from([0x04]);
+ const x = struct.get(COSEKEYS.x);
+ const y = struct.get(COSEKEYS.y);
+ if (!x) {
+ throw new Error('COSE public key was missing x');
+ }
+ if (y) {
+ return isoUint8Array.concat([tag, x, y]);
+ }
+ return isoUint8Array.concat([tag, x]);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..fdbcfdd5fa35f995e40c3c8be9208c96e4fa9979
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.d.ts
@@ -0,0 +1,6 @@
+import type { Base64URLString, Uint8Array_ } from '../types/index.js';
+/**
+ * Convert buffer to an OpenSSL-compatible PEM text format.
+ */
+export declare function convertCertBufferToPEM(certBuffer: Uint8Array_ | Base64URLString): string;
+//# sourceMappingURL=convertCertBufferToPEM.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f96cc65b226e7bdba283b596878b79bb6bdede3c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"convertCertBufferToPEM.d.ts","sourceRoot":"","sources":["../../src/helpers/convertCertBufferToPEM.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGtE;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,WAAW,GAAG,eAAe,GACxC,MAAM,CA4BR"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.js b/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.js
new file mode 100644
index 0000000000000000000000000000000000000000..5b9ad1969759f5b86f5c1f961512bf83b11762d9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.js
@@ -0,0 +1,31 @@
+import { isoBase64URL } from './iso/index.js';
+/**
+ * Convert buffer to an OpenSSL-compatible PEM text format.
+ */
+export function convertCertBufferToPEM(certBuffer) {
+ let b64cert;
+ /**
+ * Get certBuffer to a base64 representation
+ */
+ if (typeof certBuffer === 'string') {
+ if (isoBase64URL.isBase64URL(certBuffer)) {
+ b64cert = isoBase64URL.toBase64(certBuffer);
+ }
+ else if (isoBase64URL.isBase64(certBuffer)) {
+ b64cert = certBuffer;
+ }
+ else {
+ throw new Error('Certificate is not a valid base64 or base64url string');
+ }
+ }
+ else {
+ b64cert = isoBase64URL.fromBuffer(certBuffer, 'base64');
+ }
+ let PEMKey = '';
+ for (let i = 0; i < Math.ceil(b64cert.length / 64); i += 1) {
+ const start = 64 * i;
+ PEMKey += `${b64cert.substr(start, 64)}\n`;
+ }
+ PEMKey = `-----BEGIN CERTIFICATE-----\n${PEMKey}-----END CERTIFICATE-----\n`;
+ return PEMKey;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6a301c6d9ab7dcb45a431a2b4b18b6fef4a6e0f1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.d.ts
@@ -0,0 +1,6 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Take a certificate in PEM format and convert it to bytes
+ */
+export declare function convertPEMToBytes(pem: string): Uint8Array_;
+//# sourceMappingURL=convertPEMToBytes.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..cadf6182be323de6ed6bb17471bb02024136a575
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"convertPEMToBytes.d.ts","sourceRoot":"","sources":["../../src/helpers/convertPEMToBytes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAO1D"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.js b/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.js
new file mode 100644
index 0000000000000000000000000000000000000000..1e9cb56c279185deb9aafab4cdf782fdfdc88478
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.js
@@ -0,0 +1,11 @@
+import { isoBase64URL } from './iso/index.js';
+/**
+ * Take a certificate in PEM format and convert it to bytes
+ */
+export function convertPEMToBytes(pem) {
+ const certBase64 = pem
+ .replace('-----BEGIN CERTIFICATE-----', '')
+ .replace('-----END CERTIFICATE-----', '')
+ .replace(/[\n ]/g, '');
+ return isoBase64URL.toBuffer(certBase64, 'base64');
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d7c18ef85b08f2854a7afe365572555fb63a65af
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.d.ts
@@ -0,0 +1,4 @@
+import { COSEPublicKey } from './cose.js';
+import type { Uint8Array_ } from '../types/index.js';
+export declare function convertX509PublicKeyToCOSE(x509Certificate: Uint8Array_): COSEPublicKey;
+//# sourceMappingURL=convertX509PublicKeyToCOSE.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..2ae83908e43942b2f6370afb5baff3b4cbb26edf
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"convertX509PublicKeyToCOSE.d.ts","sourceRoot":"","sources":["../../src/helpers/convertX509PublicKeyToCOSE.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,aAAa,EAGd,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,WAAW,GAC3B,aAAa,CA+Ff"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.js b/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.js
new file mode 100644
index 0000000000000000000000000000000000000000..006906e9c52f2ca94023b7699f58cb1cd75f9f93
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.js
@@ -0,0 +1,73 @@
+import { AsnParser } from '@peculiar/asn1-schema';
+import { Certificate } from '@peculiar/asn1-x509';
+import { ECParameters, id_ecPublicKey, id_secp256r1, id_secp384r1 } from '@peculiar/asn1-ecc';
+import { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';
+import { COSECRV, COSEKEYS, COSEKTY, } from './cose.js';
+import { mapX509SignatureAlgToCOSEAlg } from './mapX509SignatureAlgToCOSEAlg.js';
+export function convertX509PublicKeyToCOSE(x509Certificate) {
+ let cosePublicKey = new Map();
+ /**
+ * Time to extract the public key from an X.509 certificate
+ */
+ const x509 = AsnParser.parse(x509Certificate, Certificate);
+ const { tbsCertificate } = x509;
+ const { subjectPublicKeyInfo, signature: _tbsSignature } = tbsCertificate;
+ const signatureAlgorithm = _tbsSignature.algorithm;
+ const publicKeyAlgorithmID = subjectPublicKeyInfo.algorithm.algorithm;
+ if (publicKeyAlgorithmID === id_ecPublicKey) {
+ /**
+ * EC2 Public Key
+ */
+ if (!subjectPublicKeyInfo.algorithm.parameters) {
+ throw new Error('Certificate public key was missing parameters (EC2)');
+ }
+ const ecParameters = AsnParser.parse(new Uint8Array(subjectPublicKeyInfo.algorithm.parameters), ECParameters);
+ let crv = -999;
+ const { namedCurve } = ecParameters;
+ if (namedCurve === id_secp256r1) {
+ crv = COSECRV.P256;
+ }
+ else if (namedCurve === id_secp384r1) {
+ crv = COSECRV.P384;
+ }
+ else {
+ throw new Error(`Certificate public key contained unexpected namedCurve ${namedCurve} (EC2)`);
+ }
+ const subjectPublicKey = new Uint8Array(subjectPublicKeyInfo.subjectPublicKey);
+ let x;
+ let y;
+ if (subjectPublicKey[0] === 0x04) {
+ // Public key is in "uncompressed form", so we can split the remaining bytes in half
+ let pointer = 1;
+ const halfLength = (subjectPublicKey.length - 1) / 2;
+ x = subjectPublicKey.slice(pointer, pointer += halfLength);
+ y = subjectPublicKey.slice(pointer);
+ }
+ else {
+ throw new Error('TODO: Figure out how to handle public keys in "compressed form"');
+ }
+ const coseEC2PubKey = new Map();
+ coseEC2PubKey.set(COSEKEYS.kty, COSEKTY.EC2);
+ coseEC2PubKey.set(COSEKEYS.alg, mapX509SignatureAlgToCOSEAlg(signatureAlgorithm));
+ coseEC2PubKey.set(COSEKEYS.crv, crv);
+ coseEC2PubKey.set(COSEKEYS.x, x);
+ coseEC2PubKey.set(COSEKEYS.y, y);
+ cosePublicKey = coseEC2PubKey;
+ }
+ else if (publicKeyAlgorithmID === id_rsaEncryption) {
+ /**
+ * RSA public key
+ */
+ const rsaPublicKey = AsnParser.parse(subjectPublicKeyInfo.subjectPublicKey, RSAPublicKey);
+ const coseRSAPubKey = new Map();
+ coseRSAPubKey.set(COSEKEYS.kty, COSEKTY.RSA);
+ coseRSAPubKey.set(COSEKEYS.alg, mapX509SignatureAlgToCOSEAlg(signatureAlgorithm));
+ coseRSAPubKey.set(COSEKEYS.n, new Uint8Array(rsaPublicKey.modulus));
+ coseRSAPubKey.set(COSEKEYS.e, new Uint8Array(rsaPublicKey.publicExponent));
+ cosePublicKey = coseRSAPubKey;
+ }
+ else {
+ throw new Error(`Certificate public key contained unexpected algorithm ID ${publicKeyAlgorithmID}`);
+ }
+ return cosePublicKey;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/cose.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/cose.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..58429bb5a1eda35bcf980c0295c0f34be4ce00a2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/cose.d.ts
@@ -0,0 +1,122 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Fundamental values that are needed to discern the more specific COSE public key types below.
+ *
+ * The use of `Maps` here is due to CBOR encoding being used with public keys, and the CBOR "Map"
+ * type is being decoded to JavaScript's `Map` type instead of, say, a basic Object as us JS
+ * developers might prefer.
+ *
+ * These types are an unorthodox way of saying "these Maps should involve these discrete lists of
+ * keys", but it works.
+ * @module
+ */
+/**
+ * COSE public key common values
+ */
+export type COSEPublicKey = {
+ get(key: COSEKEYS.kty): COSEKTY | undefined;
+ get(key: COSEKEYS.alg): COSEALG | undefined;
+ set(key: COSEKEYS.kty, value: COSEKTY): void;
+ set(key: COSEKEYS.alg, value: COSEALG): void;
+};
+/**
+ * Values specific to Octet Key Pair public keys
+ */
+export type COSEPublicKeyOKP = COSEPublicKey & {
+ get(key: COSEKEYS.crv): number | undefined;
+ get(key: COSEKEYS.x): Uint8Array_ | undefined;
+ set(key: COSEKEYS.crv, value: number): void;
+ set(key: COSEKEYS.x, value: Uint8Array_): void;
+};
+/**
+ * Values specific to Elliptic Curve Cryptography public keys
+ */
+export type COSEPublicKeyEC2 = COSEPublicKey & {
+ get(key: COSEKEYS.crv): number | undefined;
+ get(key: COSEKEYS.x): Uint8Array_ | undefined;
+ get(key: COSEKEYS.y): Uint8Array_ | undefined;
+ set(key: COSEKEYS.crv, value: number): void;
+ set(key: COSEKEYS.x, value: Uint8Array_): void;
+ set(key: COSEKEYS.y, value: Uint8Array_): void;
+};
+/**
+ * Values specific to RSA public keys
+ */
+export type COSEPublicKeyRSA = COSEPublicKey & {
+ get(key: COSEKEYS.n): Uint8Array_ | undefined;
+ get(key: COSEKEYS.e): Uint8Array_ | undefined;
+ set(key: COSEKEYS.n, value: Uint8Array_): void;
+ set(key: COSEKEYS.e, value: Uint8Array_): void;
+};
+/**
+ * A type guard for determining if a COSE public key is an OKP key pair
+ */
+export declare function isCOSEPublicKeyOKP(cosePublicKey: COSEPublicKey): cosePublicKey is COSEPublicKeyOKP;
+/**
+ * A type guard for determining if a COSE public key is an EC2 key pair
+ */
+export declare function isCOSEPublicKeyEC2(cosePublicKey: COSEPublicKey): cosePublicKey is COSEPublicKeyEC2;
+/**
+ * A type guard for determining if a COSE public key is an RSA key pair
+ */
+export declare function isCOSEPublicKeyRSA(cosePublicKey: COSEPublicKey): cosePublicKey is COSEPublicKeyRSA;
+/**
+ * COSE Keys
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-common-parameters
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters
+ */
+export declare enum COSEKEYS {
+ kty = 1,
+ alg = 3,
+ crv = -1,
+ x = -2,
+ y = -3,
+ n = -1,
+ e = -2
+}
+/**
+ * COSE Key Types
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-type
+ */
+export declare enum COSEKTY {
+ OKP = 1,
+ EC2 = 2,
+ RSA = 3
+}
+export declare function isCOSEKty(kty: number | undefined): kty is COSEKTY;
+/**
+ * COSE Curves
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves
+ */
+export declare enum COSECRV {
+ P256 = 1,
+ P384 = 2,
+ P521 = 3,
+ ED25519 = 6,
+ SECP256K1 = 8
+}
+export declare function isCOSECrv(crv: number | undefined): crv is COSECRV;
+/**
+ * COSE Algorithms
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#algorithms
+ */
+export declare enum COSEALG {
+ ES256 = -7,
+ EdDSA = -8,
+ ES384 = -35,
+ ES512 = -36,
+ PS256 = -37,
+ PS384 = -38,
+ PS512 = -39,
+ ES256K = -47,
+ RS256 = -257,
+ RS384 = -258,
+ RS512 = -259,
+ RS1 = -65535
+}
+export declare function isCOSEAlg(alg: number | undefined): alg is COSEALG;
+//# sourceMappingURL=cose.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/cose.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/cose.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..c9724c743e1e423c82cd90fcf7572cd03ad2deb9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/cose.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"cose.d.ts","sourceRoot":"","sources":["../../src/helpers/cose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAE1B,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,GAAG,OAAO,GAAG,SAAS,CAAC;IAC5C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,GAAG,OAAO,GAAG,SAAS,CAAC;IAE5C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAE7C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,GAAG,WAAW,GAAG,SAAS,CAAC;IAE9C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CAChD,CAAC;AAEF;;GAEG;AACH,MAAM,MAA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,IAAI,gBAAgB,CAGnC;AAED;;;;;GAKG;AACH,oBAAY,QAAQ;IAClB,GAAG,IAAI;IACP,GAAG,IAAI;IACP,GAAG,KAAK;IACR,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;CACP;AAED;;;;GAIG;AACH,oBAAY,OAAO;IACjB,GAAG,IAAI;IACP,GAAG,IAAI;IACP,GAAG,IAAI;CACR;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,IAAI,OAAO,CAEjE;AAED;;;;GAIG;AACH,oBAAY,OAAO;IACjB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,OAAO,IAAI;IACX,SAAS,IAAI;CACd;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,IAAI,OAAO,CAEjE;AAED;;;;GAIG;AACH,oBAAY,OAAO;IACjB,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,MAAM,MAAM;IACZ,KAAK,OAAO;IACZ,KAAK,OAAO;IACZ,KAAK,OAAO;IACZ,GAAG,SAAS;CACb;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,IAAI,OAAO,CAEjE"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/cose.js b/node_modules/@simplewebauthn/server/esm/helpers/cose.js
new file mode 100644
index 0000000000000000000000000000000000000000..ac835f734c35c3c7e2bcccc509ef205621aeec42
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/cose.js
@@ -0,0 +1,90 @@
+/**
+ * A type guard for determining if a COSE public key is an OKP key pair
+ */
+export function isCOSEPublicKeyOKP(cosePublicKey) {
+ const kty = cosePublicKey.get(COSEKEYS.kty);
+ return isCOSEKty(kty) && kty === COSEKTY.OKP;
+}
+/**
+ * A type guard for determining if a COSE public key is an EC2 key pair
+ */
+export function isCOSEPublicKeyEC2(cosePublicKey) {
+ const kty = cosePublicKey.get(COSEKEYS.kty);
+ return isCOSEKty(kty) && kty === COSEKTY.EC2;
+}
+/**
+ * A type guard for determining if a COSE public key is an RSA key pair
+ */
+export function isCOSEPublicKeyRSA(cosePublicKey) {
+ const kty = cosePublicKey.get(COSEKEYS.kty);
+ return isCOSEKty(kty) && kty === COSEKTY.RSA;
+}
+/**
+ * COSE Keys
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-common-parameters
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters
+ */
+export var COSEKEYS;
+(function (COSEKEYS) {
+ COSEKEYS[COSEKEYS["kty"] = 1] = "kty";
+ COSEKEYS[COSEKEYS["alg"] = 3] = "alg";
+ COSEKEYS[COSEKEYS["crv"] = -1] = "crv";
+ COSEKEYS[COSEKEYS["x"] = -2] = "x";
+ COSEKEYS[COSEKEYS["y"] = -3] = "y";
+ COSEKEYS[COSEKEYS["n"] = -1] = "n";
+ COSEKEYS[COSEKEYS["e"] = -2] = "e";
+})(COSEKEYS || (COSEKEYS = {}));
+/**
+ * COSE Key Types
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-type
+ */
+export var COSEKTY;
+(function (COSEKTY) {
+ COSEKTY[COSEKTY["OKP"] = 1] = "OKP";
+ COSEKTY[COSEKTY["EC2"] = 2] = "EC2";
+ COSEKTY[COSEKTY["RSA"] = 3] = "RSA";
+})(COSEKTY || (COSEKTY = {}));
+export function isCOSEKty(kty) {
+ return Object.values(COSEKTY).indexOf(kty) >= 0;
+}
+/**
+ * COSE Curves
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves
+ */
+export var COSECRV;
+(function (COSECRV) {
+ COSECRV[COSECRV["P256"] = 1] = "P256";
+ COSECRV[COSECRV["P384"] = 2] = "P384";
+ COSECRV[COSECRV["P521"] = 3] = "P521";
+ COSECRV[COSECRV["ED25519"] = 6] = "ED25519";
+ COSECRV[COSECRV["SECP256K1"] = 8] = "SECP256K1";
+})(COSECRV || (COSECRV = {}));
+export function isCOSECrv(crv) {
+ return Object.values(COSECRV).indexOf(crv) >= 0;
+}
+/**
+ * COSE Algorithms
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#algorithms
+ */
+export var COSEALG;
+(function (COSEALG) {
+ COSEALG[COSEALG["ES256"] = -7] = "ES256";
+ COSEALG[COSEALG["EdDSA"] = -8] = "EdDSA";
+ COSEALG[COSEALG["ES384"] = -35] = "ES384";
+ COSEALG[COSEALG["ES512"] = -36] = "ES512";
+ COSEALG[COSEALG["PS256"] = -37] = "PS256";
+ COSEALG[COSEALG["PS384"] = -38] = "PS384";
+ COSEALG[COSEALG["PS512"] = -39] = "PS512";
+ COSEALG[COSEALG["ES256K"] = -47] = "ES256K";
+ COSEALG[COSEALG["RS256"] = -257] = "RS256";
+ COSEALG[COSEALG["RS384"] = -258] = "RS384";
+ COSEALG[COSEALG["RS512"] = -259] = "RS512";
+ COSEALG[COSEALG["RS1"] = -65535] = "RS1";
+})(COSEALG || (COSEALG = {}));
+export function isCOSEAlg(alg) {
+ return Object.values(COSEALG).indexOf(alg) >= 0;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0629694d8f3512f01e45f3085ffc114d08666fd0
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.d.ts
@@ -0,0 +1,35 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Convert an AttestationObject buffer to a proper object
+ *
+ * @param base64AttestationObject Attestation Object buffer
+ */
+export declare function decodeAttestationObject(attestationObject: Uint8Array_): AttestationObject;
+export type AttestationFormat = 'fido-u2f' | 'packed' | 'android-safetynet' | 'android-key' | 'tpm' | 'apple' | 'none';
+export type AttestationObject = {
+ get(key: 'fmt'): AttestationFormat;
+ get(key: 'attStmt'): AttestationStatement;
+ get(key: 'authData'): Uint8Array_;
+};
+/**
+ * `AttestationStatement` will be an instance of `Map`, but these keys help make finite the list of
+ * possible values within it.
+ */
+export type AttestationStatement = {
+ get(key: 'sig'): Uint8Array_ | undefined;
+ get(key: 'x5c'): Uint8Array_[] | undefined;
+ get(key: 'response'): Uint8Array_ | undefined;
+ get(key: 'alg'): number | undefined;
+ get(key: 'ver'): string | undefined;
+ get(key: 'certInfo'): Uint8Array_ | undefined;
+ get(key: 'pubArea'): Uint8Array_ | undefined;
+ readonly size: number;
+};
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _decodeAttestationObjectInternals: {
+ stubThis: (value: AttestationObject) => AttestationObject;
+};
+//# sourceMappingURL=decodeAttestationObject.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..1ef71541e185edb39687c9a45d24eb4ade621278
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeAttestationObject.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeAttestationObject.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,iBAAiB,EAAE,WAAW,GAC7B,iBAAiB,CAInB;AAED,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,QAAQ,GACR,mBAAmB,GACnB,aAAa,GACb,KAAK,GACL,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,iBAAiB,CAAC;IACnC,GAAG,CAAC,GAAG,EAAE,SAAS,GAAG,oBAAoB,CAAC;IAC1C,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,CAAC;CACnC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,WAAW,EAAE,GAAG,SAAS,CAAC;IAC3C,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,GAAG,CAAC,GAAG,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IAE7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC;sBAC1B,iBAAiB;CACpC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.js b/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.js
new file mode 100644
index 0000000000000000000000000000000000000000..49d257717f12258d99e3e04f4e406feadcb2fe13
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.js
@@ -0,0 +1,16 @@
+import { isoCBOR } from './iso/index.js';
+/**
+ * Convert an AttestationObject buffer to a proper object
+ *
+ * @param base64AttestationObject Attestation Object buffer
+ */
+export function decodeAttestationObject(attestationObject) {
+ return _decodeAttestationObjectInternals.stubThis(isoCBOR.decodeFirst(attestationObject));
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export const _decodeAttestationObjectInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..706e8ea70dee9b5af23390e05398949a8f20a397
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.d.ts
@@ -0,0 +1,12 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Convert authenticator extension data buffer to a proper object
+ *
+ * @param extensionData Authenticator Extension Data buffer
+ */
+export declare function decodeAuthenticatorExtensions(extensionData: Uint8Array_): AuthenticationExtensionsAuthenticatorOutputs | undefined;
+/**
+ * Attempt to support authenticator extensions we might not know about in WebAuthn
+ */
+export type AuthenticationExtensionsAuthenticatorOutputs = unknown;
+//# sourceMappingURL=decodeAuthenticatorExtensions.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..aba9c4f56a287a3b4792262d2a37ebef87fbd878
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeAuthenticatorExtensions.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeAuthenticatorExtensions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,EAAE,WAAW,GACzB,4CAA4C,GAAG,SAAS,CAU1D;AAED;;GAEG;AACH,MAAM,MAAM,4CAA4C,GAAG,OAAO,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.js b/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.js
new file mode 100644
index 0000000000000000000000000000000000000000..0b62192ad10f36b8c107aa4fa3d6edb53842f53e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.js
@@ -0,0 +1,34 @@
+import { isoCBOR } from './iso/index.js';
+/**
+ * Convert authenticator extension data buffer to a proper object
+ *
+ * @param extensionData Authenticator Extension Data buffer
+ */
+export function decodeAuthenticatorExtensions(extensionData) {
+ let toCBOR;
+ try {
+ toCBOR = isoCBOR.decodeFirst(extensionData);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`Error decoding authenticator extensions: ${_err.message}`);
+ }
+ return convertMapToObjectDeep(toCBOR);
+}
+/**
+ * CBOR-encoded extensions can be deeply-nested Maps, which are too deep for a simple
+ * `Object.entries()`. This method will recursively make sure that all Maps are converted into
+ * basic objects.
+ */
+function convertMapToObjectDeep(input) {
+ const mapped = {};
+ for (const [key, value] of input) {
+ if (value instanceof Map) {
+ mapped[key] = convertMapToObjectDeep(value);
+ }
+ else {
+ mapped[key] = value;
+ }
+ }
+ return mapped;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..814b560c01c0236691e1e869f4f1553f3cf998cf
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.d.ts
@@ -0,0 +1,23 @@
+import type { Base64URLString } from '../types/index.js';
+/**
+ * Decode an authenticator's base64url-encoded clientDataJSON to JSON
+ */
+export declare function decodeClientDataJSON(data: Base64URLString): ClientDataJSON;
+export type ClientDataJSON = {
+ type: string;
+ challenge: string;
+ origin: string;
+ crossOrigin?: boolean;
+ tokenBinding?: {
+ id?: string;
+ status: 'present' | 'supported' | 'not-supported';
+ };
+};
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _decodeClientDataJSONInternals: {
+ stubThis: (value: ClientDataJSON) => ClientDataJSON;
+};
+//# sourceMappingURL=decodeClientDataJSON.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..1768c3de3868723dc8795c86f459b772c2383da6
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeClientDataJSON.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeClientDataJSON.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,eAAe,GAAG,cAAc,CAK1E;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE;QACb,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,eAAe,CAAC;KACnD,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,8BAA8B;sBACvB,cAAc;CACjC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.js b/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.js
new file mode 100644
index 0000000000000000000000000000000000000000..79f79800e4cca881a441aa6a71bb6eae50ee4b25
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.js
@@ -0,0 +1,16 @@
+import { isoBase64URL } from './iso/index.js';
+/**
+ * Decode an authenticator's base64url-encoded clientDataJSON to JSON
+ */
+export function decodeClientDataJSON(data) {
+ const toString = isoBase64URL.toUTF8String(data);
+ const clientData = JSON.parse(toString);
+ return _decodeClientDataJSONInternals.stubThis(clientData);
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export const _decodeClientDataJSONInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1610b3a2c1758f3350f36019c823db8976213f9c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.d.ts
@@ -0,0 +1,11 @@
+import type { COSEPublicKey } from './cose.js';
+import type { Uint8Array_ } from '../types/index.js';
+export declare function decodeCredentialPublicKey(publicKey: Uint8Array_): COSEPublicKey;
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _decodeCredentialPublicKeyInternals: {
+ stubThis: (value: COSEPublicKey) => COSEPublicKey;
+};
+//# sourceMappingURL=decodeCredentialPublicKey.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..e2e6ca73b7a926994739662dbc19c9368d6b4901
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeCredentialPublicKey.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeCredentialPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,WAAW,GACrB,aAAa,CAIf;AAED;;;GAGG;AACH,eAAO,MAAM,mCAAmC;sBAC5B,aAAa;CAChC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.js b/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.js
new file mode 100644
index 0000000000000000000000000000000000000000..318fea443c6e456cd7f9d48a02d6126c25c6f024
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.js
@@ -0,0 +1,11 @@
+import { isoCBOR } from './iso/index.js';
+export function decodeCredentialPublicKey(publicKey) {
+ return _decodeCredentialPublicKeyInternals.stubThis(isoCBOR.decodeFirst(publicKey));
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export const _decodeCredentialPublicKeyInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/fetch.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/fetch.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ee4f94663f07066ca34023cda92eee4b07c1bd06
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/fetch.d.ts
@@ -0,0 +1,13 @@
+/**
+ * A simple method for requesting data via standard `fetch`. Should work
+ * across multiple runtimes.
+ */
+export declare function fetch(url: string): Promise;
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _fetchInternals: {
+ stubThis: (url: string) => Promise;
+};
+//# sourceMappingURL=fetch.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/fetch.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/fetch.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f5494bb75fd427704476426d34b9770f4602020c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/fetch.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/helpers/fetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEpD;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe;oBACV,MAAM;CACvB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/fetch.js b/node_modules/@simplewebauthn/server/esm/helpers/fetch.js
new file mode 100644
index 0000000000000000000000000000000000000000..363518fbc382113efd59384efd4b82da42cc6f5c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/fetch.js
@@ -0,0 +1,14 @@
+/**
+ * A simple method for requesting data via standard `fetch`. Should work
+ * across multiple runtimes.
+ */
+export function fetch(url) {
+ return _fetchInternals.stubThis(url);
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export const _fetchInternals = {
+ stubThis: (url) => globalThis.fetch(url),
+};
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0b37847f71d8875f069908ab7bc46d89466071a9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.d.ts
@@ -0,0 +1,13 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Generate a suitably random value to be used as an attestation or assertion challenge
+ */
+export declare function generateChallenge(): Promise;
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _generateChallengeInternals: {
+ stubThis: (value: Uint8Array_) => Uint8Array;
+};
+//# sourceMappingURL=generateChallenge.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..9eb5fda80c53a60bf9299df0794ecfd0e069a737
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"generateChallenge.d.ts","sourceRoot":"","sources":["../../src/helpers/generateChallenge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,WAAW,CAAC,CAc9D;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B;sBACpB,WAAW;CAC9B,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.js b/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.js
new file mode 100644
index 0000000000000000000000000000000000000000..7ceec54a04c2a74048fb9701065261adba63e97f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.js
@@ -0,0 +1,24 @@
+import { isoCrypto } from './iso/index.js';
+/**
+ * Generate a suitably random value to be used as an attestation or assertion challenge
+ */
+export async function generateChallenge() {
+ /**
+ * WebAuthn spec says that 16 bytes is a good minimum:
+ *
+ * "In order to prevent replay attacks, the challenges MUST contain enough entropy to make
+ * guessing them infeasible. Challenges SHOULD therefore be at least 16 bytes long."
+ *
+ * Just in case, let's double it
+ */
+ const challenge = new Uint8Array(32);
+ await isoCrypto.getRandomValues(challenge);
+ return _generateChallengeInternals.stubThis(challenge);
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export const _generateChallengeInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2b3350933ef9abb223e9ba7904a1fae8081eb3eb
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.d.ts
@@ -0,0 +1,13 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Generate a suitably random value to be used as user ID
+ */
+export declare function generateUserID(): Promise;
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _generateUserIDInternals: {
+ stubThis: (value: Uint8Array_) => Uint8Array;
+};
+//# sourceMappingURL=generateUserID.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..777c1664afc447bf0f4d408f56a7acac08ab5b4c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"generateUserID.d.ts","sourceRoot":"","sources":["../../src/helpers/generateUserID.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAU3D;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB;sBACjB,WAAW;CAC9B,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.js b/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.js
new file mode 100644
index 0000000000000000000000000000000000000000..e2b68767c66fb22f64ba16b3f0cbd4f443414578
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.js
@@ -0,0 +1,20 @@
+import { isoCrypto } from './iso/index.js';
+/**
+ * Generate a suitably random value to be used as user ID
+ */
+export async function generateUserID() {
+ /**
+ * WebAuthn spec says user.id has a max length of 64 bytes. I prefer how 32 random bytes look
+ * after they're base64url-encoded so I'm choosing to go with that here.
+ */
+ const newUserID = new Uint8Array(32);
+ await isoCrypto.getRandomValues(newUserID);
+ return _generateUserIDInternals.stubThis(newUserID);
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export const _generateUserIDInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..480bcba6b464d50d313867236c66622f4395b91e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.d.ts
@@ -0,0 +1,33 @@
+import { Certificate } from '@peculiar/asn1-x509';
+import type { Uint8Array_ } from '../types/index.js';
+export type CertificateInfo = {
+ issuer: Issuer;
+ subject: Subject;
+ version: number;
+ basicConstraintsCA: boolean;
+ notBefore: Date;
+ notAfter: Date;
+ parsedCertificate: Certificate;
+};
+type Issuer = {
+ C?: string;
+ O?: string;
+ OU?: string;
+ CN?: string;
+ combined: string;
+};
+type Subject = {
+ C?: string;
+ O?: string;
+ OU?: string;
+ CN?: string;
+ combined: string;
+};
+/**
+ * Extract PEM certificate info
+ *
+ * @param pemCertificate Result from call to `convertASN1toPEM(x5c[0])`
+ */
+export declare function getCertificateInfo(leafCertBuffer: Uint8Array_): CertificateInfo;
+export {};
+//# sourceMappingURL=getCertificateInfo.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..23fde1cb810ceefba3c6f99de760654bd7bc858e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"getCertificateInfo.d.ts","sourceRoot":"","sources":["../../src/helpers/getCertificateInfo.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,WAAW,EAA0B,MAAM,qBAAqB,CAAC;AAE5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,IAAI,CAAC;IACf,iBAAiB,EAAE,WAAW,CAAC;CAChC,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AASF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,WAAW,GAC1B,eAAe,CA+CjB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.js b/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.js
new file mode 100644
index 0000000000000000000000000000000000000000..48f4297bd5af133c488f2ccd767f7ec6fa4f03b3
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.js
@@ -0,0 +1,77 @@
+import { AsnParser } from '@peculiar/asn1-schema';
+import { BasicConstraints, Certificate, id_ce_basicConstraints } from '@peculiar/asn1-x509';
+const issuerSubjectIDKey = {
+ '2.5.4.6': 'C',
+ '2.5.4.10': 'O',
+ '2.5.4.11': 'OU',
+ '2.5.4.3': 'CN',
+};
+/**
+ * Extract PEM certificate info
+ *
+ * @param pemCertificate Result from call to `convertASN1toPEM(x5c[0])`
+ */
+export function getCertificateInfo(leafCertBuffer) {
+ const x509 = AsnParser.parse(leafCertBuffer, Certificate);
+ const parsedCert = x509.tbsCertificate;
+ // Issuer
+ const issuer = { combined: '' };
+ parsedCert.issuer.forEach(([iss]) => {
+ const key = issuerSubjectIDKey[iss.type];
+ if (key) {
+ issuer[key] = iss.value.toString();
+ }
+ });
+ issuer.combined = issuerSubjectToString(issuer);
+ // Subject
+ const subject = { combined: '' };
+ parsedCert.subject.forEach(([iss]) => {
+ const key = issuerSubjectIDKey[iss.type];
+ if (key) {
+ subject[key] = iss.value.toString();
+ }
+ });
+ subject.combined = issuerSubjectToString(subject);
+ let basicConstraintsCA = false;
+ if (parsedCert.extensions) {
+ // console.log(parsedCert.extensions);
+ for (const ext of parsedCert.extensions) {
+ if (ext.extnID === id_ce_basicConstraints) {
+ const basicConstraints = AsnParser.parse(ext.extnValue, BasicConstraints);
+ basicConstraintsCA = basicConstraints.cA;
+ }
+ }
+ }
+ return {
+ issuer,
+ subject,
+ version: parsedCert.version,
+ basicConstraintsCA,
+ notBefore: parsedCert.validity.notBefore.getTime(),
+ notAfter: parsedCert.validity.notAfter.getTime(),
+ parsedCertificate: x509,
+ };
+}
+/**
+ * Stringify the parts of Issuer or Subject info for easier comparison of subject issuers with
+ * issuer subjects.
+ *
+ * The order might seem arbitrary, because it is. It should be enough that the two are stringified
+ * in the same order.
+ */
+function issuerSubjectToString(input) {
+ const parts = [];
+ if (input.C) {
+ parts.push(input.C);
+ }
+ if (input.O) {
+ parts.push(input.O);
+ }
+ if (input.OU) {
+ parts.push(input.OU);
+ }
+ if (input.CN) {
+ parts.push(input.CN);
+ }
+ return parts.join(' : ');
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/index.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1297a5259ce1f6fa685a4ee32fdc810a349b94be
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/index.d.ts
@@ -0,0 +1,18 @@
+export * from './convertAAGUIDToString.js';
+export * from './convertCertBufferToPEM.js';
+export * from './convertCOSEtoPKCS.js';
+export * from './decodeAttestationObject.js';
+export * from './decodeClientDataJSON.js';
+export * from './decodeCredentialPublicKey.js';
+export * from './generateChallenge.js';
+export * from './generateUserID.js';
+export * from './getCertificateInfo.js';
+export * from './isCertRevoked.js';
+export * from './parseAuthenticatorData.js';
+export * from './toHash.js';
+export * from './validateCertificatePath.js';
+export * from './verifySignature.js';
+export * from './iso/index.js';
+export * from '../metadata/verifyMDSBlob.js';
+export * as cose from './cose.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/index.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..ae168084e7148bb1d994565d156ff1aafd9c110e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/index.js b/node_modules/@simplewebauthn/server/esm/helpers/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..db68a24f7dd01ed45888fe1cd3ed83e525c38af5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/index.js
@@ -0,0 +1,17 @@
+export * from './convertAAGUIDToString.js';
+export * from './convertCertBufferToPEM.js';
+export * from './convertCOSEtoPKCS.js';
+export * from './decodeAttestationObject.js';
+export * from './decodeClientDataJSON.js';
+export * from './decodeCredentialPublicKey.js';
+export * from './generateChallenge.js';
+export * from './generateUserID.js';
+export * from './getCertificateInfo.js';
+export * from './isCertRevoked.js';
+export * from './parseAuthenticatorData.js';
+export * from './toHash.js';
+export * from './validateCertificatePath.js';
+export * from './verifySignature.js';
+export * from './iso/index.js';
+export * from '../metadata/verifyMDSBlob.js';
+export * as cose from './cose.js';
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2d1c2bf3957acba59c9f0332d0d65e00ab4e7d9e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.d.ts
@@ -0,0 +1,9 @@
+import { type X509Certificate } from '@peculiar/x509';
+/**
+ * A method to pull a CRL from a certificate and compare its serial number to the list of revoked
+ * certificate serial numbers within the CRL.
+ *
+ * CRL certificate structure referenced from https://tools.ietf.org/html/rfc5280#page-117
+ */
+export declare function isCertRevoked(cert: X509Certificate): Promise;
+//# sourceMappingURL=isCertRevoked.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..74516b92258e14ee6c4e82287f559a13ed28e28d
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"isCertRevoked.d.ts","sourceRoot":"","sources":["../../src/helpers/isCertRevoked.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAexB;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAkG3E"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.js b/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.js
new file mode 100644
index 0000000000000000000000000000000000000000..dde0264d1b4368df07e5fdae6a5e8581392c349d
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.js
@@ -0,0 +1,96 @@
+import { AuthorityKeyIdentifierExtension, CRLDistributionPointsExtension, SubjectKeyIdentifierExtension, X509Crl, } from '@peculiar/x509';
+import { fetch } from './fetch.js';
+const cacheRevokedCerts = {};
+/**
+ * A method to pull a CRL from a certificate and compare its serial number to the list of revoked
+ * certificate serial numbers within the CRL.
+ *
+ * CRL certificate structure referenced from https://tools.ietf.org/html/rfc5280#page-117
+ */
+export async function isCertRevoked(cert) {
+ const { extensions } = cert;
+ if (!extensions) {
+ return false;
+ }
+ let extAuthorityKeyID;
+ let extSubjectKeyID;
+ let extCRLDistributionPoints;
+ extensions.forEach((ext) => {
+ if (ext instanceof AuthorityKeyIdentifierExtension) {
+ extAuthorityKeyID = ext;
+ }
+ else if (ext instanceof SubjectKeyIdentifierExtension) {
+ extSubjectKeyID = ext;
+ }
+ else if (ext instanceof CRLDistributionPointsExtension) {
+ extCRLDistributionPoints = ext;
+ }
+ });
+ // Check to see if we've got cached info for the cert's CA
+ let keyIdentifier = undefined;
+ if (extAuthorityKeyID && extAuthorityKeyID.keyId) {
+ keyIdentifier = extAuthorityKeyID.keyId;
+ }
+ else if (extSubjectKeyID) {
+ /**
+ * We might be dealing with a self-signed root certificate. Check the
+ * Subject key Identifier extension next.
+ */
+ keyIdentifier = extSubjectKeyID.keyId;
+ }
+ if (keyIdentifier) {
+ const cached = cacheRevokedCerts[keyIdentifier];
+ if (cached) {
+ const now = new Date();
+ // If there's a nextUpdate then make sure we're before it
+ if (!cached.nextUpdate || cached.nextUpdate > now) {
+ return cached.revokedCerts.indexOf(cert.serialNumber) >= 0;
+ }
+ }
+ }
+ const crlURL = extCRLDistributionPoints?.distributionPoints?.[0].distributionPoint?.fullName?.[0]
+ .uniformResourceIdentifier;
+ // If no URL is provided then we have nothing to check
+ if (!crlURL) {
+ return false;
+ }
+ // Download and read the CRL
+ let certListBytes;
+ try {
+ const respCRL = await fetch(crlURL);
+ certListBytes = await respCRL.arrayBuffer();
+ }
+ catch (_err) {
+ return false;
+ }
+ let data;
+ try {
+ data = new X509Crl(certListBytes);
+ }
+ catch (_err) {
+ // Something was malformed with the CRL, so pass
+ return false;
+ }
+ const newCached = {
+ revokedCerts: [],
+ nextUpdate: undefined,
+ };
+ // nextUpdate
+ if (data.nextUpdate) {
+ newCached.nextUpdate = data.nextUpdate;
+ }
+ // revokedCertificates
+ const revokedCerts = data.entries;
+ if (revokedCerts) {
+ for (const cert of revokedCerts) {
+ const revokedHex = cert.serialNumber;
+ newCached.revokedCerts.push(revokedHex);
+ }
+ // Cache the results
+ if (keyIdentifier) {
+ cacheRevokedCerts[keyIdentifier] = newCached;
+ }
+ return newCached.revokedCerts.indexOf(cert.serialNumber) >= 0;
+ }
+ return false;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/index.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7ad61a1bb28ab04559b8d90857737160dc7afc97
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/index.d.ts
@@ -0,0 +1,12 @@
+/**
+ * A collection of methods for isomorphic manipulation of trickier data types
+ *
+ * The goal with these is to make it easier to replace dependencies later that might not play well
+ * with specific server-like runtimes that expose global Web APIs (CloudFlare Workers, Deno, Bun,
+ * etc...), while also supporting execution in Node.
+ */
+export * as isoBase64URL from './isoBase64URL.js';
+export * as isoCBOR from './isoCBOR.js';
+export * as isoCrypto from './isoCrypto/index.js';
+export * as isoUint8Array from './isoUint8Array.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/index.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..ee4f18b17cac403b5127964d1acb48e582cfefe5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/iso/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/index.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..4f6a4ac6948908ad37570d38125282697ec6f83a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/index.js
@@ -0,0 +1,11 @@
+/**
+ * A collection of methods for isomorphic manipulation of trickier data types
+ *
+ * The goal with these is to make it easier to replace dependencies later that might not play well
+ * with specific server-like runtimes that expose global Web APIs (CloudFlare Workers, Deno, Bun,
+ * etc...), while also supporting execution in Node.
+ */
+export * as isoBase64URL from './isoBase64URL.js';
+export * as isoCBOR from './isoCBOR.js';
+export * as isoCrypto from './isoCrypto/index.js';
+export * as isoUint8Array from './isoUint8Array.js';
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..085e34cdfb075883f4e14f6e4d07087b161f1313
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.d.ts
@@ -0,0 +1,43 @@
+import type { Base64URLString, Uint8Array_ } from '../../types/index.js';
+/**
+ * Decode from a Base64URL-encoded string to an ArrayBuffer. Best used when converting a
+ * credential ID from a JSON string to an ArrayBuffer, like in allowCredentials or
+ * excludeCredentials.
+ *
+ * @param buffer Value to decode from base64
+ * @param to (optional) The decoding to use, in case it's desirable to decode from base64 instead
+ */
+export declare function toBuffer(base64urlString: string, from?: 'base64' | 'base64url'): Uint8Array_;
+/**
+ * Encode the given array buffer into a Base64URL-encoded string. Ideal for converting various
+ * credential response ArrayBuffers to string for sending back to the server as JSON.
+ *
+ * @param buffer Value to encode to base64
+ * @param to (optional) The encoding to use, in case it's desirable to encode to base64 instead
+ */
+export declare function fromBuffer(buffer: Uint8Array_, to?: 'base64' | 'base64url'): string;
+/**
+ * Convert a base64url string into base64
+ */
+export declare function toBase64(base64urlString: string): string;
+/**
+ * Encode a UTF-8 string to base64url
+ */
+export declare function fromUTF8String(utf8String: string): string;
+/**
+ * Decode a base64url string into its original UTF-8 string
+ */
+export declare function toUTF8String(base64urlString: string): string;
+/**
+ * Confirm that the string is encoded into base64
+ */
+export declare function isBase64(input: string): boolean;
+/**
+ * Confirm that the string is encoded into base64url, with support for optional padding
+ */
+export declare function isBase64URL(input: string): boolean;
+/**
+ * Remove optional padding from a base64url-encoded string
+ */
+export declare function trimPadding(input: Base64URLString): Base64URLString;
+//# sourceMappingURL=isoBase64URL.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..8636ef644c3a50676c43901b45dd775940aceca1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"isoBase64URL.d.ts","sourceRoot":"","sources":["../../../src/helpers/iso/isoBase64URL.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,eAAe,EAAE,MAAM,EACvB,IAAI,GAAE,QAAQ,GAAG,WAAyB,GACzC,WAAW,CAGb;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,WAAW,EACnB,EAAE,GAAE,QAAQ,GAAG,WAAyB,GACvC,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAIxD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIlD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAEnE"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.js
new file mode 100644
index 0000000000000000000000000000000000000000..31d2d8fd4d650594f332f42df72672cdeccaa41f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.js
@@ -0,0 +1,72 @@
+/**
+ * A runtime-agnostic collection of methods for working with Base64URL encoding
+ * @module
+ */
+import base64 from '@hexagon/base64';
+/**
+ * Decode from a Base64URL-encoded string to an ArrayBuffer. Best used when converting a
+ * credential ID from a JSON string to an ArrayBuffer, like in allowCredentials or
+ * excludeCredentials.
+ *
+ * @param buffer Value to decode from base64
+ * @param to (optional) The decoding to use, in case it's desirable to decode from base64 instead
+ */
+export function toBuffer(base64urlString, from = 'base64url') {
+ const _buffer = base64.toArrayBuffer(base64urlString, from === 'base64url');
+ return new Uint8Array(_buffer);
+}
+/**
+ * Encode the given array buffer into a Base64URL-encoded string. Ideal for converting various
+ * credential response ArrayBuffers to string for sending back to the server as JSON.
+ *
+ * @param buffer Value to encode to base64
+ * @param to (optional) The encoding to use, in case it's desirable to encode to base64 instead
+ */
+export function fromBuffer(buffer, to = 'base64url') {
+ /**
+ * Gracefully handle Uint8Array subclass types, like Node's Buffer, that can have a large
+ * ArrayBuffer backing it.
+ */
+ const _normalized = new Uint8Array(buffer);
+ return base64.fromArrayBuffer(_normalized.buffer, to === 'base64url');
+}
+/**
+ * Convert a base64url string into base64
+ */
+export function toBase64(base64urlString) {
+ const fromBase64Url = base64.toArrayBuffer(base64urlString, true);
+ const toBase64 = base64.fromArrayBuffer(fromBase64Url);
+ return toBase64;
+}
+/**
+ * Encode a UTF-8 string to base64url
+ */
+export function fromUTF8String(utf8String) {
+ return base64.fromString(utf8String, true);
+}
+/**
+ * Decode a base64url string into its original UTF-8 string
+ */
+export function toUTF8String(base64urlString) {
+ return base64.toString(base64urlString, true);
+}
+/**
+ * Confirm that the string is encoded into base64
+ */
+export function isBase64(input) {
+ return base64.validate(input, false);
+}
+/**
+ * Confirm that the string is encoded into base64url, with support for optional padding
+ */
+export function isBase64URL(input) {
+ // Trim padding characters from the string if present
+ input = trimPadding(input);
+ return base64.validate(input, true);
+}
+/**
+ * Remove optional padding from a base64url-encoded string
+ */
+export function trimPadding(input) {
+ return input.replace(/=/g, '');
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b9441fb7626adc29cda5a206ff5c480ef177fdb7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.d.ts
@@ -0,0 +1,29 @@
+/**
+ * A runtime-agnostic collection of methods for working with CBOR encoding
+ * @module
+ */
+import * as tinyCbor from '@levischuck/tiny-cbor';
+import type { Uint8Array_ } from '../../types/index.js';
+/**
+ * Whatever CBOR encoder is used should keep CBOR data the same length when data is re-encoded
+ *
+ * MOST CRITICALLY, this means the following needs to be true of whatever CBOR library we use:
+ * - CBOR Map type values MUST decode to JavaScript Maps
+ * - CBOR tag 64 (uint8 Typed Array) MUST NOT be used when encoding Uint8Arrays back to CBOR
+ *
+ * So long as these requirements are maintained, then CBOR sequences can be encoded and decoded
+ * freely while maintaining their lengths for the most accurate pointer movement across them.
+ */
+/**
+ * Decode and return the first item in a sequence of CBOR-encoded values
+ *
+ * @param input The CBOR data to decode
+ * @param asObject (optional) Whether to convert any CBOR Maps into JavaScript Objects. Defaults to
+ * `false`
+ */
+export declare function decodeFirst(input: Uint8Array_): Type;
+/**
+ * Encode data to CBOR
+ */
+export declare function encode(input: tinyCbor.CBORType): Uint8Array_;
+//# sourceMappingURL=isoCBOR.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..0aad3bc552672c5fe63b2b52a7189e28aa1cb2c2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"isoCBOR.d.ts","sourceRoot":"","sources":["../../../src/helpers/iso/isoCBOR.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;GASG;AAEH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAQ1D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,GAAG,WAAW,CAE5D"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.js
new file mode 100644
index 0000000000000000000000000000000000000000..2288f91f79e428f34a15a5218b16836e9b5d82b2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.js
@@ -0,0 +1,35 @@
+/**
+ * A runtime-agnostic collection of methods for working with CBOR encoding
+ * @module
+ */
+import * as tinyCbor from '@levischuck/tiny-cbor';
+/**
+ * Whatever CBOR encoder is used should keep CBOR data the same length when data is re-encoded
+ *
+ * MOST CRITICALLY, this means the following needs to be true of whatever CBOR library we use:
+ * - CBOR Map type values MUST decode to JavaScript Maps
+ * - CBOR tag 64 (uint8 Typed Array) MUST NOT be used when encoding Uint8Arrays back to CBOR
+ *
+ * So long as these requirements are maintained, then CBOR sequences can be encoded and decoded
+ * freely while maintaining their lengths for the most accurate pointer movement across them.
+ */
+/**
+ * Decode and return the first item in a sequence of CBOR-encoded values
+ *
+ * @param input The CBOR data to decode
+ * @param asObject (optional) Whether to convert any CBOR Maps into JavaScript Objects. Defaults to
+ * `false`
+ */
+export function decodeFirst(input) {
+ // Make a copy so we don't mutate the original
+ const _input = new Uint8Array(input);
+ const decoded = tinyCbor.decodePartialCBOR(_input, 0);
+ const [first] = decoded;
+ return first;
+}
+/**
+ * Encode data to CBOR
+ */
+export function encode(input) {
+ return tinyCbor.encodeCBOR(input);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7dab1d51c0f683dc6795ac3e0b8b56d2221d21e7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.d.ts
@@ -0,0 +1,10 @@
+import type { COSEALG } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Generate a digest of the provided data.
+ *
+ * @param data The data to generate a digest of
+ * @param algorithm A COSE algorithm ID that maps to a desired SHA algorithm
+ */
+export declare function digest(data: Uint8Array_, algorithm: COSEALG): Promise;
+//# sourceMappingURL=digest.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..49f3ef3607c1c9e1cbd8880d083c4e76fa71b10b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/digest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAsB,MAAM,CAC1B,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,WAAW,CAAC,CAQtB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.js
new file mode 100644
index 0000000000000000000000000000000000000000..6d287d17b7da3f7afb1c342550ffe240eb05969e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.js
@@ -0,0 +1,14 @@
+import { mapCoseAlgToWebCryptoAlg } from './mapCoseAlgToWebCryptoAlg.js';
+import { getWebCrypto } from './getWebCrypto.js';
+/**
+ * Generate a digest of the provided data.
+ *
+ * @param data The data to generate a digest of
+ * @param algorithm A COSE algorithm ID that maps to a desired SHA algorithm
+ */
+export async function digest(data, algorithm) {
+ const WebCrypto = await getWebCrypto();
+ const subtleAlgorithm = mapCoseAlgToWebCryptoAlg(algorithm);
+ const hashed = await WebCrypto.subtle.digest(subtleAlgorithm, data);
+ return new Uint8Array(hashed);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a7c210d427ab142a9bba342dd11def0e2961f018
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.d.ts
@@ -0,0 +1,8 @@
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Fill up the provided bytes array with random bytes equal to its length.
+ *
+ * @returns the same bytes array passed into the method
+ */
+export declare function getRandomValues(array: Uint8Array_): Promise;
+//# sourceMappingURL=getRandomValues.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..fdb5d206a33313b41cf772b9e8c8c57a1ffed46b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"getRandomValues.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/getRandomValues.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAM9E"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.js
new file mode 100644
index 0000000000000000000000000000000000000000..e68b86974bee9ee5b273e498136a89d639b5d331
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.js
@@ -0,0 +1,11 @@
+import { getWebCrypto } from './getWebCrypto.js';
+/**
+ * Fill up the provided bytes array with random bytes equal to its length.
+ *
+ * @returns the same bytes array passed into the method
+ */
+export async function getRandomValues(array) {
+ const WebCrypto = await getWebCrypto();
+ WebCrypto.getRandomValues(array);
+ return array;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5ccbb6326d1068ab5e7bb5cfacb51a6f8766bb46
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts
@@ -0,0 +1,14 @@
+import type { Crypto } from '../../../types/index.js';
+/**
+ * Try to get an instance of the Crypto API from the current runtime. Should support Node,
+ * as well as others, like Deno, that implement Web APIs.
+ */
+export declare function getWebCrypto(): Promise;
+export declare class MissingWebCrypto extends Error {
+ constructor();
+}
+export declare const _getWebCryptoInternals: {
+ stubThisGlobalThisCrypto: () => import("crypto").webcrypto.Crypto;
+ setCachedCrypto: (newCrypto: Crypto | undefined) => void;
+};
+//# sourceMappingURL=getWebCrypto.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..b1a4a797bf67d97c4bbe72723114641cca2acf95
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"getWebCrypto.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/getWebCrypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAgC9C;AAED,qBAAa,gBAAiB,SAAQ,KAAK;;CAM1C;AAGD,eAAO,MAAM,sBAAsB;;iCAGJ,MAAM,GAAG,SAAS;CAGhD,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.js
new file mode 100644
index 0000000000000000000000000000000000000000..99380d8c24b16672a19823e30379c234979e931b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.js
@@ -0,0 +1,49 @@
+let webCrypto = undefined;
+/**
+ * Try to get an instance of the Crypto API from the current runtime. Should support Node,
+ * as well as others, like Deno, that implement Web APIs.
+ */
+export function getWebCrypto() {
+ /**
+ * Hello there! If you came here wondering why this method is asynchronous when use of
+ * `globalThis.crypto` is not, it's to minimize a bunch of refactor related to making this
+ * synchronous. For example, `generateRegistrationOptions()` and `generateAuthenticationOptions()`
+ * become synchronous if we make this synchronous (since nothing else in that method is async)
+ * which represents a breaking API change in this library's core API.
+ *
+ * TODO: If it's after February 2025 when you read this then consider whether it still makes sense
+ * to keep this method asynchronous.
+ */
+ const toResolve = new Promise((resolve, reject) => {
+ if (webCrypto) {
+ return resolve(webCrypto);
+ }
+ /**
+ * Naively attempt to access Crypto as a global object, which popular ESM-centric run-times
+ * support (and Node v20+)
+ */
+ const _globalThisCrypto = _getWebCryptoInternals.stubThisGlobalThisCrypto();
+ if (_globalThisCrypto) {
+ webCrypto = _globalThisCrypto;
+ return resolve(webCrypto);
+ }
+ // We tried to access it both in Node and globally, so bail out
+ return reject(new MissingWebCrypto());
+ });
+ return toResolve;
+}
+export class MissingWebCrypto extends Error {
+ constructor() {
+ const message = 'An instance of the Crypto API could not be located';
+ super(message);
+ this.name = 'MissingWebCrypto';
+ }
+}
+// Make it possible to stub return values during testing
+export const _getWebCryptoInternals = {
+ stubThisGlobalThisCrypto: () => globalThis.crypto,
+ // Make it possible to reset the `webCrypto` at the top of the file
+ setCachedCrypto: (newCrypto) => {
+ webCrypto = newCrypto;
+ },
+};
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2401d44dd4f9b51493a4e9180e1fb1233c4ff00c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.d.ts
@@ -0,0 +1,5 @@
+export declare function importKey(opts: {
+ keyData: JsonWebKey;
+ algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams;
+}): Promise;
+//# sourceMappingURL=importKey.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..40f49973aca9c347123c82ea636d5ad9eb28e9c4
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"importKey.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/importKey.ts"],"names":[],"mappings":"AAEA,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,OAAO,EAAE,UAAU,CAAC;IACpB,SAAS,EAAE,mBAAmB,GAAG,qBAAqB,GAAG,iBAAiB,CAAC;CAC5E,GAAG,OAAO,CAAC,SAAS,CAAC,CAQrB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.js
new file mode 100644
index 0000000000000000000000000000000000000000..337465fa25c272e0d9159d2c82f15e7ed794431e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.js
@@ -0,0 +1,8 @@
+import { getWebCrypto } from './getWebCrypto.js';
+export async function importKey(opts) {
+ const WebCrypto = await getWebCrypto();
+ const { keyData, algorithm } = opts;
+ return WebCrypto.subtle.importKey('jwk', keyData, algorithm, false, [
+ 'verify',
+ ]);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3e74dd3ff86829fa0e807c71b9c55e8ea85abf65
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.d.ts
@@ -0,0 +1,8 @@
+/**
+ * A runtime-agnostic collection of methods for working with the WebCrypto API
+ * @module
+ */
+export { digest } from './digest.js';
+export { getRandomValues } from './getRandomValues.js';
+export { verify } from './verify.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..e7c72dfb0bd00dfe7b0a879035d6b699d629fe05
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..2b802a7c97841831d5cc044e7e2bb2a7db06dce4
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.js
@@ -0,0 +1,7 @@
+/**
+ * A runtime-agnostic collection of methods for working with the WebCrypto API
+ * @module
+ */
+export { digest } from './digest.js';
+export { getRandomValues } from './getRandomValues.js';
+export { verify } from './verify.js';
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..65188c61f11461aca38dd74eecfa9e3a6a9d50a7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts
@@ -0,0 +1,7 @@
+import { SubtleCryptoAlg } from './structs.js';
+import { COSEALG } from '../../cose.js';
+/**
+ * Convert a COSE alg ID into a corresponding string value that WebCrypto APIs expect
+ */
+export declare function mapCoseAlgToWebCryptoAlg(alg: COSEALG): SubtleCryptoAlg;
+//# sourceMappingURL=mapCoseAlgToWebCryptoAlg.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..eb97769be85130aebe3d5c127f463e739198a8e1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mapCoseAlgToWebCryptoAlg.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAetE"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js
new file mode 100644
index 0000000000000000000000000000000000000000..2a9cb4b37b33890bd63bf875c5401eac55403102
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js
@@ -0,0 +1,20 @@
+import { COSEALG } from '../../cose.js';
+/**
+ * Convert a COSE alg ID into a corresponding string value that WebCrypto APIs expect
+ */
+export function mapCoseAlgToWebCryptoAlg(alg) {
+ if ([COSEALG.RS1].indexOf(alg) >= 0) {
+ return 'SHA-1';
+ }
+ else if ([COSEALG.ES256, COSEALG.PS256, COSEALG.RS256].indexOf(alg) >= 0) {
+ return 'SHA-256';
+ }
+ else if ([COSEALG.ES384, COSEALG.PS384, COSEALG.RS384].indexOf(alg) >= 0) {
+ return 'SHA-384';
+ }
+ else if ([COSEALG.ES512, COSEALG.PS512, COSEALG.RS512, COSEALG.EdDSA].indexOf(alg) >=
+ 0) {
+ return 'SHA-512';
+ }
+ throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto alg`);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..aff93860b716d39969c5a862d2964bb36626fc79
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts
@@ -0,0 +1,7 @@
+import { COSEALG } from '../../cose.js';
+import { SubtleCryptoKeyAlgName } from './structs.js';
+/**
+ * Convert a COSE alg ID into a corresponding key algorithm string value that WebCrypto APIs expect
+ */
+export declare function mapCoseAlgToWebCryptoKeyAlgName(alg: COSEALG): SubtleCryptoKeyAlgName;
+//# sourceMappingURL=mapCoseAlgToWebCryptoKeyAlgName.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..376b94bb48c955d08c1fe2bfc974ddbc30af8e64
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mapCoseAlgToWebCryptoKeyAlgName.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,OAAO,GACX,sBAAsB,CAoBxB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js
new file mode 100644
index 0000000000000000000000000000000000000000..08e879ac38dbdf9acc539fb83e811815899ca48e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js
@@ -0,0 +1,19 @@
+import { COSEALG } from '../../cose.js';
+/**
+ * Convert a COSE alg ID into a corresponding key algorithm string value that WebCrypto APIs expect
+ */
+export function mapCoseAlgToWebCryptoKeyAlgName(alg) {
+ if ([COSEALG.EdDSA].indexOf(alg) >= 0) {
+ return 'Ed25519';
+ }
+ else if ([COSEALG.ES256, COSEALG.ES384, COSEALG.ES512, COSEALG.ES256K].indexOf(alg) >= 0) {
+ return 'ECDSA';
+ }
+ else if ([COSEALG.RS256, COSEALG.RS384, COSEALG.RS512, COSEALG.RS1].indexOf(alg) >= 0) {
+ return 'RSASSA-PKCS1-v1_5';
+ }
+ else if ([COSEALG.PS256, COSEALG.PS384, COSEALG.PS512].indexOf(alg) >= 0) {
+ return 'RSA-PSS';
+ }
+ throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto key alg name`);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/structs.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/structs.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4e68064dc26ee67de25625692b81d8b988d154c0
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/structs.d.ts
@@ -0,0 +1,4 @@
+export type SubtleCryptoAlg = 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
+export type SubtleCryptoCrv = 'P-256' | 'P-384' | 'P-521' | 'Ed25519';
+export type SubtleCryptoKeyAlgName = 'ECDSA' | 'Ed25519' | 'RSASSA-PKCS1-v1_5' | 'RSA-PSS';
+//# sourceMappingURL=structs.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/structs.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/structs.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..2ec1f4e30f80fbf1cb2f9be459370a5a6e3641c2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/structs.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"structs.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/structs.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AACtE,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,SAAS,GACT,mBAAmB,GACnB,SAAS,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/structs.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/structs.js
new file mode 100644
index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/structs.js
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..58b63a1baf8d74f713d46d6919c504296fc1c288
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts
@@ -0,0 +1,9 @@
+import { COSECRV } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * In WebAuthn, EC2 signatures are wrapped in ASN.1 structure so we need to peel r and s apart.
+ *
+ * See https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types
+ */
+export declare function unwrapEC2Signature(signature: Uint8Array_, crv: COSECRV): Uint8Array_;
+//# sourceMappingURL=unwrapEC2Signature.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..4ab842a51b1a1d8d5d19a81a7b5f7f704c2f7ad0
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"unwrapEC2Signature.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/unwrapEC2Signature.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,OAAO,GAAG,WAAW,CAepF"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js
new file mode 100644
index 0000000000000000000000000000000000000000..f812872fef033dd42333526ca9500133813ac86e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js
@@ -0,0 +1,73 @@
+import { AsnParser } from '@peculiar/asn1-schema';
+import { ECDSASigValue } from '@peculiar/asn1-ecc';
+import { COSECRV } from '../../cose.js';
+import { isoUint8Array } from '../index.js';
+/**
+ * In WebAuthn, EC2 signatures are wrapped in ASN.1 structure so we need to peel r and s apart.
+ *
+ * See https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types
+ */
+export function unwrapEC2Signature(signature, crv) {
+ const parsedSignature = AsnParser.parse(signature, ECDSASigValue);
+ const rBytes = new Uint8Array(parsedSignature.r);
+ const sBytes = new Uint8Array(parsedSignature.s);
+ const componentLength = getSignatureComponentLength(crv);
+ const rNormalizedBytes = toNormalizedBytes(rBytes, componentLength);
+ const sNormalizedBytes = toNormalizedBytes(sBytes, componentLength);
+ const finalSignature = isoUint8Array.concat([
+ rNormalizedBytes,
+ sNormalizedBytes,
+ ]);
+ return finalSignature;
+}
+/**
+ * The SubtleCrypto Web Crypto API expects ECDSA signatures with `r` and `s` values to be encoded
+ * to a specific length depending on the order of the curve. This function returns the expected
+ * byte-length for each of the `r` and `s` signature components.
+ *
+ * See
+ */
+function getSignatureComponentLength(crv) {
+ switch (crv) {
+ case COSECRV.P256:
+ return 32;
+ case COSECRV.P384:
+ return 48;
+ case COSECRV.P521:
+ return 66;
+ default:
+ throw new Error(`Unexpected COSE crv value of ${crv} (EC2)`);
+ }
+}
+/**
+ * Converts the ASN.1 integer representation to bytes of a specific length `n`.
+ *
+ * DER encodes integers as big-endian byte arrays, with as small as possible representation and
+ * requires a leading `0` byte to disambiguate between negative and positive numbers. This means
+ * that `r` and `s` can potentially not be the expected byte-length that is needed by the
+ * SubtleCrypto Web Crypto API: if there are leading `0`s it can be shorter than expected, and if
+ * it has a leading `1` bit, it can be one byte longer.
+ *
+ * See
+ * See
+ */
+function toNormalizedBytes(bytes, componentLength) {
+ let normalizedBytes;
+ if (bytes.length < componentLength) {
+ // In case the bytes are shorter than expected, we need to pad it with leading `0`s.
+ normalizedBytes = new Uint8Array(componentLength);
+ normalizedBytes.set(bytes, componentLength - bytes.length);
+ }
+ else if (bytes.length === componentLength) {
+ normalizedBytes = bytes;
+ }
+ else if (bytes.length === componentLength + 1 && bytes[0] === 0 && (bytes[1] & 0x80) === 0x80) {
+ // The bytes contain a leading `0` to encode that the integer is positive. This leading `0`
+ // needs to be removed for compatibility with the SubtleCrypto Web Crypto API.
+ normalizedBytes = bytes.subarray(1);
+ }
+ else {
+ throw new Error(`Invalid signature component length ${bytes.length}, expected ${componentLength}`);
+ }
+ return normalizedBytes;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f64e05ea6054631ec5c79cb3d51f781a41970fb6
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.d.ts
@@ -0,0 +1,12 @@
+import { type COSEALG, type COSEPublicKey } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Verify signatures with their public key. Supports EC2 and RSA public keys.
+ */
+export declare function verify(opts: {
+ cosePublicKey: COSEPublicKey;
+ signature: Uint8Array_;
+ data: Uint8Array_;
+ shaHashOverride?: COSEALG;
+}): Promise;
+//# sourceMappingURL=verify.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..65c9d7d6980da2c06ec7ca668d41992ff917e5d7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,aAAa,EAKnB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBnB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.js
new file mode 100644
index 0000000000000000000000000000000000000000..30f443dbbe9df7f3cfbb09ce5b54c6b1d2021429
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.js
@@ -0,0 +1,32 @@
+import { COSEKEYS, isCOSECrv, isCOSEPublicKeyEC2, isCOSEPublicKeyOKP, isCOSEPublicKeyRSA, } from '../../cose.js';
+import { verifyEC2 } from './verifyEC2.js';
+import { verifyRSA } from './verifyRSA.js';
+import { verifyOKP } from './verifyOKP.js';
+import { unwrapEC2Signature } from './unwrapEC2Signature.js';
+/**
+ * Verify signatures with their public key. Supports EC2 and RSA public keys.
+ */
+export function verify(opts) {
+ const { cosePublicKey, signature, data, shaHashOverride } = opts;
+ if (isCOSEPublicKeyEC2(cosePublicKey)) {
+ const crv = cosePublicKey.get(COSEKEYS.crv);
+ if (!isCOSECrv(crv)) {
+ throw new Error(`unknown COSE curve ${crv}`);
+ }
+ const unwrappedSignature = unwrapEC2Signature(signature, crv);
+ return verifyEC2({
+ cosePublicKey,
+ signature: unwrappedSignature,
+ data,
+ shaHashOverride,
+ });
+ }
+ else if (isCOSEPublicKeyRSA(cosePublicKey)) {
+ return verifyRSA({ cosePublicKey, signature, data, shaHashOverride });
+ }
+ else if (isCOSEPublicKeyOKP(cosePublicKey)) {
+ return verifyOKP({ cosePublicKey, signature, data });
+ }
+ const kty = cosePublicKey.get(COSEKEYS.kty);
+ throw new Error(`Signature verification with public key of kty ${kty} is not supported by this method`);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9d6643412470a00b52ea5f787d66fb97a3af14c6
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.d.ts
@@ -0,0 +1,12 @@
+import { type COSEALG, type COSEPublicKeyEC2 } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Verify a signature using an EC2 public key
+ */
+export declare function verifyEC2(opts: {
+ cosePublicKey: COSEPublicKeyEC2;
+ signature: Uint8Array_;
+ data: Uint8Array_;
+ shaHashOverride?: COSEALG;
+}): Promise;
+//# sourceMappingURL=verifyEC2.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..c80307d915017aaf30947b07cdb8430a85c7cfa9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyEC2.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verifyEC2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAMvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CA0EnB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.js
new file mode 100644
index 0000000000000000000000000000000000000000..9a3f2ca4dae1e109f3b305cc42816f6ad71a07c4
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.js
@@ -0,0 +1,73 @@
+import { COSECRV, COSEKEYS } from '../../cose.js';
+import { mapCoseAlgToWebCryptoAlg } from './mapCoseAlgToWebCryptoAlg.js';
+import { importKey } from './importKey.js';
+import { isoBase64URL } from '../index.js';
+import { getWebCrypto } from './getWebCrypto.js';
+/**
+ * Verify a signature using an EC2 public key
+ */
+export async function verifyEC2(opts) {
+ const { cosePublicKey, signature, data, shaHashOverride } = opts;
+ const WebCrypto = await getWebCrypto();
+ // Import the public key
+ const alg = cosePublicKey.get(COSEKEYS.alg);
+ const crv = cosePublicKey.get(COSEKEYS.crv);
+ const x = cosePublicKey.get(COSEKEYS.x);
+ const y = cosePublicKey.get(COSEKEYS.y);
+ if (!alg) {
+ throw new Error('Public key was missing alg (EC2)');
+ }
+ if (!crv) {
+ throw new Error('Public key was missing crv (EC2)');
+ }
+ if (!x) {
+ throw new Error('Public key was missing x (EC2)');
+ }
+ if (!y) {
+ throw new Error('Public key was missing y (EC2)');
+ }
+ let _crv;
+ if (crv === COSECRV.P256) {
+ _crv = 'P-256';
+ }
+ else if (crv === COSECRV.P384) {
+ _crv = 'P-384';
+ }
+ else if (crv === COSECRV.P521) {
+ _crv = 'P-521';
+ }
+ else {
+ throw new Error(`Unexpected COSE crv value of ${crv} (EC2)`);
+ }
+ const keyData = {
+ kty: 'EC',
+ crv: _crv,
+ x: isoBase64URL.fromBuffer(x),
+ y: isoBase64URL.fromBuffer(y),
+ ext: false,
+ };
+ const keyAlgorithm = {
+ /**
+ * Note to future self: you can't use `mapCoseAlgToWebCryptoKeyAlgName()` here because some
+ * leaf certs from actual devices specified an RSA SHA value for `alg` (e.g. `-257`) which
+ * would then map here to `'RSASSA-PKCS1-v1_5'`. We always want `'ECDSA'` here so we'll
+ * hard-code this.
+ */
+ name: 'ECDSA',
+ namedCurve: _crv,
+ };
+ const key = await importKey({
+ keyData,
+ algorithm: keyAlgorithm,
+ });
+ // Determine which SHA algorithm to use for signature verification
+ let subtleAlg = mapCoseAlgToWebCryptoAlg(alg);
+ if (shaHashOverride) {
+ subtleAlg = mapCoseAlgToWebCryptoAlg(shaHashOverride);
+ }
+ const verifyAlgorithm = {
+ name: 'ECDSA',
+ hash: { name: subtleAlg },
+ };
+ return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4c7663f81170b8c07c0041cdb509d3a8838ba909
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.d.ts
@@ -0,0 +1,8 @@
+import { type COSEPublicKeyOKP } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+export declare function verifyOKP(opts: {
+ cosePublicKey: COSEPublicKeyOKP;
+ signature: Uint8Array_;
+ data: Uint8Array_;
+}): Promise;
+//# sourceMappingURL=verifyOKP.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..fe778027ac68f06aa58514f9f5529a698b5b1da9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyOKP.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verifyOKP.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,gBAAgB,EAAa,MAAM,eAAe,CAAC;AAKpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;CACnB,GAAG,OAAO,CAAC,OAAO,CAAC,CAyDnB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.js
new file mode 100644
index 0000000000000000000000000000000000000000..ce9adde0063254550c25873a5f162362e957022f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.js
@@ -0,0 +1,51 @@
+import { COSECRV, COSEKEYS, isCOSEAlg } from '../../cose.js';
+import { isoBase64URL } from '../../index.js';
+import { importKey } from './importKey.js';
+import { getWebCrypto } from './getWebCrypto.js';
+export async function verifyOKP(opts) {
+ const { cosePublicKey, signature, data } = opts;
+ const WebCrypto = await getWebCrypto();
+ const alg = cosePublicKey.get(COSEKEYS.alg);
+ const crv = cosePublicKey.get(COSEKEYS.crv);
+ const x = cosePublicKey.get(COSEKEYS.x);
+ if (!alg) {
+ throw new Error('Public key was missing alg (OKP)');
+ }
+ if (!isCOSEAlg(alg)) {
+ throw new Error(`Public key had invalid alg ${alg} (OKP)`);
+ }
+ if (!crv) {
+ throw new Error('Public key was missing crv (OKP)');
+ }
+ if (!x) {
+ throw new Error('Public key was missing x (OKP)');
+ }
+ // Pulled key import steps from here:
+ // https://wicg.github.io/webcrypto-secure-curves/#ed25519-operations
+ let _crv;
+ if (crv === COSECRV.ED25519) {
+ _crv = 'Ed25519';
+ }
+ else {
+ throw new Error(`Unexpected COSE crv value of ${crv} (OKP)`);
+ }
+ const keyData = {
+ kty: 'OKP',
+ crv: _crv,
+ alg: 'EdDSA',
+ x: isoBase64URL.fromBuffer(x),
+ ext: false,
+ };
+ const keyAlgorithm = {
+ name: _crv,
+ namedCurve: _crv,
+ };
+ const key = await importKey({
+ keyData,
+ algorithm: keyAlgorithm,
+ });
+ const verifyAlgorithm = {
+ name: _crv,
+ };
+ return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..67ba29c2240f9ddea5744b6c0d8bed8e4b368c23
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.d.ts
@@ -0,0 +1,12 @@
+import { type COSEALG, type COSEPublicKeyRSA } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Verify a signature using an RSA public key
+ */
+export declare function verifyRSA(opts: {
+ cosePublicKey: COSEPublicKeyRSA;
+ signature: Uint8Array_;
+ data: Uint8Array_;
+ shaHashOverride?: COSEALG;
+}): Promise;
+//# sourceMappingURL=verifyRSA.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..5b78feaf25468fae03ce3ce02db26205366dcbc2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyRSA.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verifyRSA.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAY,KAAK,gBAAgB,EAAa,MAAM,eAAe,CAAC;AAMzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CA2FnB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.js
new file mode 100644
index 0000000000000000000000000000000000000000..d4ec0fab04293da6df4d585d2e1922aadd192d27
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.js
@@ -0,0 +1,91 @@
+import { COSEKEYS, isCOSEAlg } from '../../cose.js';
+import { mapCoseAlgToWebCryptoAlg } from './mapCoseAlgToWebCryptoAlg.js';
+import { importKey } from './importKey.js';
+import { isoBase64URL } from '../index.js';
+import { mapCoseAlgToWebCryptoKeyAlgName } from './mapCoseAlgToWebCryptoKeyAlgName.js';
+import { getWebCrypto } from './getWebCrypto.js';
+/**
+ * Verify a signature using an RSA public key
+ */
+export async function verifyRSA(opts) {
+ const { cosePublicKey, signature, data, shaHashOverride } = opts;
+ const WebCrypto = await getWebCrypto();
+ const alg = cosePublicKey.get(COSEKEYS.alg);
+ const n = cosePublicKey.get(COSEKEYS.n);
+ const e = cosePublicKey.get(COSEKEYS.e);
+ if (!alg) {
+ throw new Error('Public key was missing alg (RSA)');
+ }
+ if (!isCOSEAlg(alg)) {
+ throw new Error(`Public key had invalid alg ${alg} (RSA)`);
+ }
+ if (!n) {
+ throw new Error('Public key was missing n (RSA)');
+ }
+ if (!e) {
+ throw new Error('Public key was missing e (RSA)');
+ }
+ const keyData = {
+ kty: 'RSA',
+ alg: '',
+ n: isoBase64URL.fromBuffer(n),
+ e: isoBase64URL.fromBuffer(e),
+ ext: false,
+ };
+ const keyAlgorithm = {
+ name: mapCoseAlgToWebCryptoKeyAlgName(alg),
+ hash: { name: mapCoseAlgToWebCryptoAlg(alg) },
+ };
+ const verifyAlgorithm = {
+ name: mapCoseAlgToWebCryptoKeyAlgName(alg),
+ };
+ if (shaHashOverride) {
+ keyAlgorithm.hash.name = mapCoseAlgToWebCryptoAlg(shaHashOverride);
+ }
+ if (keyAlgorithm.name === 'RSASSA-PKCS1-v1_5') {
+ if (keyAlgorithm.hash.name === 'SHA-256') {
+ keyData.alg = 'RS256';
+ }
+ else if (keyAlgorithm.hash.name === 'SHA-384') {
+ keyData.alg = 'RS384';
+ }
+ else if (keyAlgorithm.hash.name === 'SHA-512') {
+ keyData.alg = 'RS512';
+ }
+ else if (keyAlgorithm.hash.name === 'SHA-1') {
+ keyData.alg = 'RS1';
+ }
+ }
+ else if (keyAlgorithm.name === 'RSA-PSS') {
+ /**
+ * salt length. The default value is 20 but the convention is to use hLen, the length of the
+ * output of the hash function in bytes. A salt length of zero is permitted and will result in
+ * a deterministic signature value. The actual salt length used can be determined from the
+ * signature value.
+ *
+ * From https://www.cryptosys.net/pki/manpki/pki_rsaschemes.html
+ */
+ let saltLength = 0;
+ if (keyAlgorithm.hash.name === 'SHA-256') {
+ keyData.alg = 'PS256';
+ saltLength = 32; // 256 bits => 32 bytes
+ }
+ else if (keyAlgorithm.hash.name === 'SHA-384') {
+ keyData.alg = 'PS384';
+ saltLength = 48; // 384 bits => 48 bytes
+ }
+ else if (keyAlgorithm.hash.name === 'SHA-512') {
+ keyData.alg = 'PS512';
+ saltLength = 64; // 512 bits => 64 bytes
+ }
+ verifyAlgorithm.saltLength = saltLength;
+ }
+ else {
+ throw new Error(`Unexpected RSA key algorithm ${alg} (${keyAlgorithm.name})`);
+ }
+ const key = await importKey({
+ keyData,
+ algorithm: keyAlgorithm,
+ });
+ return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0edbf7984fc2d1ff577c0a93fdd3cbf34d2eb1ea
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.d.ts
@@ -0,0 +1,42 @@
+import type { Uint8Array_ } from '../../types/index.js';
+/**
+ * A runtime-agnostic collection of methods for working with Uint8Arrays
+ * @module
+ */
+/**
+ * Make sure two Uint8Arrays are deeply equivalent
+ */
+export declare function areEqual(array1: Uint8Array_, array2: Uint8Array_): boolean;
+/**
+ * Convert a Uint8Array to Hexadecimal.
+ *
+ * A replacement for `Buffer.toString('hex')`
+ */
+export declare function toHex(array: Uint8Array_): string;
+/**
+ * Convert a hexadecimal string to isoUint8Array.
+ *
+ * A replacement for `Buffer.from('...', 'hex')`
+ */
+export declare function fromHex(hex: string): Uint8Array_;
+/**
+ * Combine multiple Uint8Arrays into a single Uint8Array
+ */
+export declare function concat(arrays: Uint8Array_[]): Uint8Array_;
+/**
+ * Convert bytes into a UTF-8 string
+ */
+export declare function toUTF8String(array: Uint8Array_): string;
+/**
+ * Convert a UTF-8 string back into bytes
+ */
+export declare function fromUTF8String(utf8String: string): Uint8Array_;
+/**
+ * Convert an ASCII string to Uint8Array
+ */
+export declare function fromASCIIString(value: string): Uint8Array_;
+/**
+ * Prepare a DataView we can slice our way around in as we parse the bytes in a Uint8Array
+ */
+export declare function toDataView(array: Uint8Array_): DataView;
+//# sourceMappingURL=isoUint8Array.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..9d5e4a024648949967589ec48a82a30bf910068c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"isoUint8Array.d.ts","sourceRoot":"","sources":["../../../src/helpers/iso/isoUint8Array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAM1E;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAKhD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAehD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAYzD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAGvD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAG9D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAE1D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,CAEvD"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.js b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.js
new file mode 100644
index 0000000000000000000000000000000000000000..f56ccd0207267219641ea6a4a7647936ae318505
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.js
@@ -0,0 +1,79 @@
+/**
+ * A runtime-agnostic collection of methods for working with Uint8Arrays
+ * @module
+ */
+/**
+ * Make sure two Uint8Arrays are deeply equivalent
+ */
+export function areEqual(array1, array2) {
+ if (array1.length != array2.length) {
+ return false;
+ }
+ return array1.every((val, i) => val === array2[i]);
+}
+/**
+ * Convert a Uint8Array to Hexadecimal.
+ *
+ * A replacement for `Buffer.toString('hex')`
+ */
+export function toHex(array) {
+ const hexParts = Array.from(array, (i) => i.toString(16).padStart(2, '0'));
+ // adce000235bcc60a648b0b25f1f05503
+ return hexParts.join('');
+}
+/**
+ * Convert a hexadecimal string to isoUint8Array.
+ *
+ * A replacement for `Buffer.from('...', 'hex')`
+ */
+export function fromHex(hex) {
+ if (!hex) {
+ return Uint8Array.from([]);
+ }
+ const isValid = hex.length !== 0 && hex.length % 2 === 0 &&
+ !/[^a-fA-F0-9]/u.test(hex);
+ if (!isValid) {
+ throw new Error('Invalid hex string');
+ }
+ const byteStrings = hex.match(/.{1,2}/g) ?? [];
+ return Uint8Array.from(byteStrings.map((byte) => parseInt(byte, 16)));
+}
+/**
+ * Combine multiple Uint8Arrays into a single Uint8Array
+ */
+export function concat(arrays) {
+ let pointer = 0;
+ const totalLength = arrays.reduce((prev, curr) => prev + curr.length, 0);
+ const toReturn = new Uint8Array(totalLength);
+ arrays.forEach((arr) => {
+ toReturn.set(arr, pointer);
+ pointer += arr.length;
+ });
+ return toReturn;
+}
+/**
+ * Convert bytes into a UTF-8 string
+ */
+export function toUTF8String(array) {
+ const decoder = new globalThis.TextDecoder('utf-8');
+ return decoder.decode(array);
+}
+/**
+ * Convert a UTF-8 string back into bytes
+ */
+export function fromUTF8String(utf8String) {
+ const encoder = new globalThis.TextEncoder();
+ return encoder.encode(utf8String);
+}
+/**
+ * Convert an ASCII string to Uint8Array
+ */
+export function fromASCIIString(value) {
+ return Uint8Array.from(value.split('').map((x) => x.charCodeAt(0)));
+}
+/**
+ * Prepare a DataView we can slice our way around in as we parse the bytes in a Uint8Array
+ */
+export function toDataView(array) {
+ return new DataView(array.buffer, array.byteOffset, array.length);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/logging.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/logging.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5a721ebc799b5172764667900babe9eecd499170
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/logging.d.ts
@@ -0,0 +1,16 @@
+/**
+ * Generate an instance of a `debug` logger that extends off of the "simplewebauthn" namespace for
+ * consistent naming.
+ *
+ * See https://www.npmjs.com/package/debug for information on how to control logging output when
+ * using @simplewebauthn/server
+ *
+ * Example:
+ *
+ * ```
+ * const log = getLogger('mds');
+ * log('hello'); // simplewebauthn:mds hello +0ms
+ * ```
+ */
+export declare function getLogger(_name: string): (message: string, ..._rest: unknown[]) => void;
+//# sourceMappingURL=logging.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/logging.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/logging.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..91e9b378e760b821386683d4f643c2bc7c7c2033
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/logging.d.ts.map
@@ -0,0 +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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/logging.js b/node_modules/@simplewebauthn/server/esm/helpers/logging.js
new file mode 100644
index 0000000000000000000000000000000000000000..5786763eef56629c6f61c517369186ed5bf023b4
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/logging.js
@@ -0,0 +1,19 @@
+// const defaultLogger = debug('SimpleWebAuthn');
+/**
+ * Generate an instance of a `debug` logger that extends off of the "simplewebauthn" namespace for
+ * consistent naming.
+ *
+ * See https://www.npmjs.com/package/debug for information on how to control logging output when
+ * using @simplewebauthn/server
+ *
+ * Example:
+ *
+ * ```
+ * const log = getLogger('mds');
+ * log('hello'); // simplewebauthn:mds hello +0ms
+ * ```
+ */
+export function getLogger(_name) {
+ // This is a noop for now while I search for a better debug logger technique
+ return (_message, ..._rest) => { };
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9ca5bea7849c9c3b505be00920ae2b79308f4db5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts
@@ -0,0 +1,9 @@
+import { COSEALG } from './cose.js';
+/**
+ * Map X.509 signature algorithm OIDs to COSE algorithm IDs
+ *
+ * - EC2 OIDs: https://oidref.com/1.2.840.10045.4.3
+ * - RSA OIDs: https://oidref.com/1.2.840.113549.1.1
+ */
+export declare function mapX509SignatureAlgToCOSEAlg(signatureAlgorithm: string): COSEALG;
+//# sourceMappingURL=mapX509SignatureAlgToCOSEAlg.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..41bdd730e05c8b3956f3addfbda8539c39334c0e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map
@@ -0,0 +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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.js b/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.js
new file mode 100644
index 0000000000000000000000000000000000000000..40c4a63c97f2479f0ee77279b749ee43ac231d09
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.js
@@ -0,0 +1,35 @@
+import { COSEALG } from './cose.js';
+/**
+ * Map X.509 signature algorithm OIDs to COSE algorithm IDs
+ *
+ * - EC2 OIDs: https://oidref.com/1.2.840.10045.4.3
+ * - RSA OIDs: https://oidref.com/1.2.840.113549.1.1
+ */
+export function mapX509SignatureAlgToCOSEAlg(signatureAlgorithm) {
+ let alg;
+ if (signatureAlgorithm === '1.2.840.10045.4.3.2') {
+ alg = COSEALG.ES256;
+ }
+ else if (signatureAlgorithm === '1.2.840.10045.4.3.3') {
+ alg = COSEALG.ES384;
+ }
+ else if (signatureAlgorithm === '1.2.840.10045.4.3.4') {
+ alg = COSEALG.ES512;
+ }
+ else if (signatureAlgorithm === '1.2.840.113549.1.1.11') {
+ alg = COSEALG.RS256;
+ }
+ else if (signatureAlgorithm === '1.2.840.113549.1.1.12') {
+ alg = COSEALG.RS384;
+ }
+ else if (signatureAlgorithm === '1.2.840.113549.1.1.13') {
+ alg = COSEALG.RS512;
+ }
+ else if (signatureAlgorithm === '1.2.840.113549.1.1.5') {
+ alg = COSEALG.RS1;
+ }
+ else {
+ throw new Error(`Unable to map X.509 signature algorithm ${signatureAlgorithm} to a COSE algorithm`);
+ }
+ return alg;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..df407c80f6dd7359fb52ab9316c201f29bf02441
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.d.ts
@@ -0,0 +1,9 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Go through each expected RP ID and try to find one that matches. Returns the unhashed RP ID
+ * that matched the hash in the response.
+ *
+ * Raises an `UnexpectedRPIDHash` error if no match is found
+ */
+export declare function matchExpectedRPID(rpIDHash: Uint8Array_, expectedRPIDs: string[]): Promise;
+//# sourceMappingURL=matchExpectedRPID.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..0b1634c16426bf2f357ad746b66cbc0ee5fd439a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"matchExpectedRPID.d.ts","sourceRoot":"","sources":["../../src/helpers/matchExpectedRPID.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,WAAW,EACrB,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,MAAM,CAAC,CA8BjB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.js b/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.js
new file mode 100644
index 0000000000000000000000000000000000000000..8ce3ce3815601ffc6e5600f56ae395b9c47028c7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.js
@@ -0,0 +1,41 @@
+import { toHash } from './toHash.js';
+import { isoUint8Array } from './iso/index.js';
+/**
+ * Go through each expected RP ID and try to find one that matches. Returns the unhashed RP ID
+ * that matched the hash in the response.
+ *
+ * Raises an `UnexpectedRPIDHash` error if no match is found
+ */
+export async function matchExpectedRPID(rpIDHash, expectedRPIDs) {
+ try {
+ const matchedRPID = await Promise.any(expectedRPIDs.map((expected) => {
+ return new Promise((resolve, reject) => {
+ toHash(isoUint8Array.fromASCIIString(expected)).then((expectedRPIDHash) => {
+ if (isoUint8Array.areEqual(rpIDHash, expectedRPIDHash)) {
+ resolve(expected);
+ }
+ else {
+ reject();
+ }
+ });
+ });
+ }));
+ return matchedRPID;
+ }
+ catch (err) {
+ const _err = err;
+ // This means no matches were found
+ if (_err.name === 'AggregateError') {
+ throw new UnexpectedRPIDHash();
+ }
+ // An unexpected error occurred
+ throw err;
+ }
+}
+class UnexpectedRPIDHash extends Error {
+ constructor() {
+ const message = 'Unexpected RP ID hash';
+ super(message);
+ this.name = 'UnexpectedRPIDHash';
+ }
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9a9c5898fb2ddafbdd1379061225f14339a5d7df
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.d.ts
@@ -0,0 +1,34 @@
+import { type AuthenticationExtensionsAuthenticatorOutputs } from './decodeAuthenticatorExtensions.js';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Make sense of the authData buffer contained in an Attestation
+ */
+export declare function parseAuthenticatorData(authData: Uint8Array_): ParsedAuthenticatorData;
+export type ParsedAuthenticatorData = {
+ rpIdHash: Uint8Array_;
+ flagsBuf: Uint8Array_;
+ flags: {
+ up: boolean;
+ uv: boolean;
+ be: boolean;
+ bs: boolean;
+ at: boolean;
+ ed: boolean;
+ flagsInt: number;
+ };
+ counter: number;
+ counterBuf: Uint8Array_;
+ aaguid?: Uint8Array_;
+ credentialID?: Uint8Array_;
+ credentialPublicKey?: Uint8Array_;
+ extensionsData?: AuthenticationExtensionsAuthenticatorOutputs;
+ extensionsDataBuffer?: Uint8Array_;
+};
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _parseAuthenticatorDataInternals: {
+ stubThis: (value: ParsedAuthenticatorData) => ParsedAuthenticatorData;
+};
+//# sourceMappingURL=parseAuthenticatorData.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..2ae207592c6cdaef56824eb5277dcaa67401db60
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"parseAuthenticatorData.d.ts","sourceRoot":"","sources":["../../src/helpers/parseAuthenticatorData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,4CAA4C,EAElD,MAAM,oCAAoC,CAAC;AAG5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,WAAW,GACpB,uBAAuB,CAwHzB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,WAAW,CAAC;IACtB,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,WAAW,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,cAAc,CAAC,EAAE,4CAA4C,CAAC;IAC9D,oBAAoB,CAAC,EAAE,WAAW,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gCAAgC;sBACzB,uBAAuB;CAC1C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.js b/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.js
new file mode 100644
index 0000000000000000000000000000000000000000..15b4c6ef269fb7f69753165e698726206d168f2f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.js
@@ -0,0 +1,106 @@
+import { decodeAuthenticatorExtensions, } from './decodeAuthenticatorExtensions.js';
+import { isoCBOR, isoUint8Array } from './iso/index.js';
+/**
+ * Make sense of the authData buffer contained in an Attestation
+ */
+export function parseAuthenticatorData(authData) {
+ if (authData.byteLength < 37) {
+ throw new Error(`Authenticator data was ${authData.byteLength} bytes, expected at least 37 bytes`);
+ }
+ let pointer = 0;
+ const dataView = isoUint8Array.toDataView(authData);
+ const rpIdHash = authData.slice(pointer, pointer += 32);
+ const flagsBuf = authData.slice(pointer, pointer += 1);
+ const flagsInt = flagsBuf[0];
+ // Bit positions can be referenced here:
+ // https://www.w3.org/TR/webauthn-2/#flags
+ const flags = {
+ up: !!(flagsInt & (1 << 0)), // User Presence
+ uv: !!(flagsInt & (1 << 2)), // User Verified
+ be: !!(flagsInt & (1 << 3)), // Backup Eligibility
+ bs: !!(flagsInt & (1 << 4)), // Backup State
+ at: !!(flagsInt & (1 << 6)), // Attested Credential Data Present
+ ed: !!(flagsInt & (1 << 7)), // Extension Data Present
+ flagsInt,
+ };
+ const counterBuf = authData.slice(pointer, pointer + 4);
+ const counter = dataView.getUint32(pointer, false);
+ pointer += 4;
+ let aaguid = undefined;
+ let credentialID = undefined;
+ let credentialPublicKey = undefined;
+ if (flags.at) {
+ aaguid = authData.slice(pointer, pointer += 16);
+ const credIDLen = dataView.getUint16(pointer);
+ pointer += 2;
+ credentialID = authData.slice(pointer, pointer += credIDLen);
+ /**
+ * Firefox 117 incorrectly CBOR-encodes authData when EdDSA (-8) is used for the public key.
+ * A CBOR "Map of 3 items" (0xa3) should be "Map of 4 items" (0xa4), and if we manually adjust
+ * the single byte there's a good chance the authData can be correctly parsed.
+ *
+ * This browser release also incorrectly uses the string labels "OKP" and "Ed25519" instead of
+ * their integer representations for kty and crv respectively. That's why the COSE public key
+ * in the hex below looks so odd.
+ */
+ // Bytes decode to `{ 1: "OKP", 3: -8, -1: "Ed25519" }` (it's missing key -2 a.k.a. COSEKEYS.x)
+ const badEdDSACBOR = isoUint8Array.fromHex('a301634f4b500327206745643235353139');
+ const bytesAtCurrentPosition = authData.slice(pointer, pointer + badEdDSACBOR.byteLength);
+ let foundBadCBOR = false;
+ if (isoUint8Array.areEqual(badEdDSACBOR, bytesAtCurrentPosition)) {
+ // Change the bad CBOR 0xa3 to 0xa4 so that the credential public key can be recognized
+ foundBadCBOR = true;
+ authData[pointer] = 0xa4;
+ }
+ // Decode the next CBOR item in the buffer, then re-encode it back to a Buffer
+ const firstDecoded = isoCBOR.decodeFirst(authData.slice(pointer));
+ const firstEncoded = Uint8Array.from(
+ /**
+ * Casting to `Map` via `as unknown` here because TS doesn't make it possible to define Maps
+ * with discrete keys and properties with known types per pair, and CBOR libs typically parse
+ * CBOR Major Type 5 to `Map` because you can have numbers for keys. A `COSEPublicKey` can be
+ * generalized as "a Map with numbers for keys and either numbers or bytes for values" though.
+ * If this presumption falls apart then other parts of verification later on will fail so we
+ * should be safe doing this here.
+ */
+ isoCBOR.encode(firstDecoded));
+ if (foundBadCBOR) {
+ // Restore the bit we changed so that `authData` is the same as it came in and won't break
+ // signature verification.
+ authData[pointer] = 0xa3;
+ }
+ credentialPublicKey = firstEncoded;
+ pointer += firstEncoded.byteLength;
+ }
+ let extensionsData = undefined;
+ let extensionsDataBuffer = undefined;
+ if (flags.ed) {
+ const firstDecoded = isoCBOR.decodeFirst(authData.slice(pointer));
+ extensionsDataBuffer = Uint8Array.from(isoCBOR.encode(firstDecoded));
+ extensionsData = decodeAuthenticatorExtensions(extensionsDataBuffer);
+ pointer += extensionsDataBuffer.byteLength;
+ }
+ // Pointer should be at the end of the authenticator data, otherwise too much data was sent
+ if (authData.byteLength > pointer) {
+ throw new Error('Leftover bytes detected while parsing authenticator data');
+ }
+ return _parseAuthenticatorDataInternals.stubThis({
+ rpIdHash,
+ flagsBuf,
+ flags,
+ counter,
+ counterBuf,
+ aaguid,
+ credentialID,
+ credentialPublicKey,
+ extensionsData,
+ extensionsDataBuffer,
+ });
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export const _parseAuthenticatorDataInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..284a6cc5c7c059e83458feb249b81dfa97f85879
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.d.ts
@@ -0,0 +1,20 @@
+import type { CredentialDeviceType } from '../types/index.js';
+/**
+ * Make sense of Bits 3 and 4 in authenticator indicating:
+ *
+ * - Whether the credential can be used on multiple devices
+ * - Whether the credential is backed up or not
+ *
+ * Invalid configurations will raise an `Error`
+ */
+export declare function parseBackupFlags({ be, bs }: {
+ be: boolean;
+ bs: boolean;
+}): {
+ credentialDeviceType: CredentialDeviceType;
+ credentialBackedUp: boolean;
+};
+export declare class InvalidBackupFlags extends Error {
+ constructor(message: string);
+}
+//# sourceMappingURL=parseBackupFlags.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..69ed26edd983b1a7270994a6d0e28cf7ec31588f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"parseBackupFlags.d.ts","sourceRoot":"","sources":["../../src/helpers/parseBackupFlags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;;;;;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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.js b/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.js
new file mode 100644
index 0000000000000000000000000000000000000000..158d1bf9b09f7a32797bf32bed472b3b28d8b76e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.js
@@ -0,0 +1,25 @@
+/**
+ * Make sense of Bits 3 and 4 in authenticator indicating:
+ *
+ * - Whether the credential can be used on multiple devices
+ * - Whether the credential is backed up or not
+ *
+ * Invalid configurations will raise an `Error`
+ */
+export function parseBackupFlags({ be, bs }) {
+ const credentialBackedUp = bs;
+ let credentialDeviceType = 'singleDevice';
+ if (be) {
+ credentialDeviceType = 'multiDevice';
+ }
+ if (credentialDeviceType === 'singleDevice' && credentialBackedUp) {
+ throw new InvalidBackupFlags('Single-device credential indicated that it was backed up, which should be impossible.');
+ }
+ return { credentialDeviceType, credentialBackedUp };
+}
+export class InvalidBackupFlags extends Error {
+ constructor(message) {
+ super(message);
+ this.name = 'InvalidBackupFlags';
+ }
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/toHash.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/toHash.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1a0039fe5ad1d77b9481d4136c1a04c30f08c56e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/toHash.d.ts
@@ -0,0 +1,8 @@
+import type { COSEALG } from './cose.js';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Returns hash digest of the given data, using the given algorithm when provided. Defaults to using
+ * SHA-256.
+ */
+export declare function toHash(data: Uint8Array_ | string, algorithm?: COSEALG): Promise;
+//# sourceMappingURL=toHash.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/toHash.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/toHash.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..00c9c61d7804638b195470509d29b0002b9f2b74
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/toHash.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"toHash.d.ts","sourceRoot":"","sources":["../../src/helpers/toHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;GAGG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,WAAW,GAAG,MAAM,EAC1B,SAAS,GAAE,OAAY,GACtB,OAAO,CAAC,WAAW,CAAC,CAQtB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/toHash.js b/node_modules/@simplewebauthn/server/esm/helpers/toHash.js
new file mode 100644
index 0000000000000000000000000000000000000000..421541cef4181dc2d35f00a166c33fbb58b7ffc1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/toHash.js
@@ -0,0 +1,12 @@
+import { isoCrypto, isoUint8Array } from './iso/index.js';
+/**
+ * Returns hash digest of the given data, using the given algorithm when provided. Defaults to using
+ * SHA-256.
+ */
+export function toHash(data, algorithm = -7) {
+ if (typeof data === 'string') {
+ data = isoUint8Array.fromUTF8String(data);
+ }
+ const digest = isoCrypto.digest(data, algorithm);
+ return digest;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a9bcf6a9d38ff8cd44463f6f617a26682f5dd9df
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.d.ts
@@ -0,0 +1,7 @@
+/**
+ * Traverse an array of PEM certificates and ensure they form a proper chain
+ * @param x5cCertsPEM Typically the result of `x5c.map(convertASN1toPEM)`
+ * @param trustAnchorsPEM PEM-formatted certs that an attestation statement x5c may chain back to
+ */
+export declare function validateCertificatePath(x5cCertsPEM: string[], trustAnchorsPEM?: string[]): Promise;
+//# sourceMappingURL=validateCertificatePath.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..9063cfd1f4652f5cac699e04c1fe42d1492ce1e4
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"validateCertificatePath.d.ts","sourceRoot":"","sources":["../../src/helpers/validateCertificatePath.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EAAE,EACrB,eAAe,GAAE,MAAM,EAAO,GAC7B,OAAO,CAAC,OAAO,CAAC,CA6HlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.js b/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.js
new file mode 100644
index 0000000000000000000000000000000000000000..f0b11201e24e843d7cfbb60458438df1b2c7be73
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.js
@@ -0,0 +1,140 @@
+import { X509Certificate } from '@peculiar/x509';
+import { isCertRevoked } from './isCertRevoked.js';
+import { getWebCrypto } from './iso/isoCrypto/getWebCrypto.js';
+/**
+ * Traverse an array of PEM certificates and ensure they form a proper chain
+ * @param x5cCertsPEM Typically the result of `x5c.map(convertASN1toPEM)`
+ * @param trustAnchorsPEM PEM-formatted certs that an attestation statement x5c may chain back to
+ */
+export async function validateCertificatePath(x5cCertsPEM, trustAnchorsPEM = []) {
+ if (trustAnchorsPEM.length === 0) {
+ // We have no trust anchors to chain back to, so skip path validation
+ return true;
+ }
+ const WebCrypto = await getWebCrypto();
+ // Prepare to work with x5c certs
+ const x5cCertsParsed = x5cCertsPEM.map((certPEM) => new X509Certificate(certPEM));
+ // Check for any expired or temporally invalid certs in x5c
+ for (let i = 0; i < x5cCertsParsed.length; i++) {
+ const cert = x5cCertsParsed[i];
+ const certPEM = x5cCertsPEM[i];
+ try {
+ await assertCertNotRevoked(cert);
+ }
+ catch (_err) {
+ throw new Error(`Found revoked certificate in x5c:\n${certPEM}`);
+ }
+ try {
+ assertCertIsWithinValidTimeWindow(cert.notBefore, cert.notAfter);
+ }
+ catch (_err) {
+ throw new Error(`Found certificate out of validity period in x5c:\n${certPEM}`);
+ }
+ }
+ // Prepare to work with trust anchor certs
+ const trustAnchorsParsed = trustAnchorsPEM.map((certPEM) => {
+ try {
+ return new X509Certificate(certPEM);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`Could not parse trust anchor certificate:\n${certPEM}`, { cause: _err });
+ }
+ });
+ // Filter out any expired or temporally invalid trust anchors certs
+ const validTrustAnchors = [];
+ for (let i = 0; i < trustAnchorsParsed.length; i++) {
+ const cert = trustAnchorsParsed[i];
+ try {
+ await assertCertNotRevoked(cert);
+ }
+ catch (_err) {
+ // Continue processing the other certs
+ continue;
+ }
+ try {
+ assertCertIsWithinValidTimeWindow(cert.notBefore, cert.notAfter);
+ }
+ catch (_err) {
+ // Continue processing the other certs
+ continue;
+ }
+ validTrustAnchors.push(cert);
+ }
+ if (validTrustAnchors.length === 0) {
+ throw new Error('No specified trust anchor was valid for verifying x5c');
+ }
+ // Try to verify x5c with each trust anchor
+ let invalidSubjectAndIssuerError = false;
+ for (const anchor of trustAnchorsParsed) {
+ try {
+ const x5cWithTrustAnchor = x5cCertsParsed.concat([anchor]);
+ if (new Set(x5cWithTrustAnchor).size !== x5cWithTrustAnchor.length) {
+ throw new Error('Invalid certificate path: found duplicate certificates');
+ }
+ // Check signatures, and notBefore and notAfter
+ for (let i = 0; i < x5cWithTrustAnchor.length - 1; i++) {
+ const subject = x5cWithTrustAnchor[i];
+ const issuer = x5cWithTrustAnchor[i + 1];
+ // Leaf or intermediate cert, make sure the next cert in the chain signed it
+ const issuerSignedSubject = await subject.verify({ publicKey: issuer.publicKey, signatureOnly: true }, WebCrypto);
+ if (!issuerSignedSubject) {
+ throw new InvalidSubjectAndIssuer();
+ }
+ if (issuer.subject === issuer.issuer) {
+ // Root cert detected, make sure it signed itself
+ const issuerSignedIssuer = await issuer.verify({ publicKey: issuer.publicKey, signatureOnly: true }, WebCrypto);
+ if (!issuerSignedIssuer) {
+ throw new InvalidSubjectAndIssuer();
+ }
+ // Don't process anything else after a root cert
+ break;
+ }
+ }
+ // If we successfully validated a path then there's no need to continue. Reset any existing
+ // errors that were thrown by earlier trust anchors
+ invalidSubjectAndIssuerError = false;
+ break;
+ }
+ catch (err) {
+ if (err instanceof InvalidSubjectAndIssuer) {
+ invalidSubjectAndIssuerError = true;
+ }
+ else {
+ throw new Error('Unexpected error while validating certificate path', { cause: err });
+ }
+ }
+ }
+ // We tried multiple trust anchors and none of them worked
+ if (invalidSubjectAndIssuerError) {
+ throw new InvalidSubjectAndIssuer();
+ }
+ return true;
+}
+/**
+ * Check if the certificate is revoked or not. If it is, raise an error
+ */
+async function assertCertNotRevoked(certificate) {
+ // Check for certificate revocation
+ const subjectCertRevoked = await isCertRevoked(certificate);
+ if (subjectCertRevoked) {
+ throw new Error('Found revoked certificate in certificate path');
+ }
+}
+/**
+ * Require the cert to be within its notBefore and notAfter time window
+ */
+function assertCertIsWithinValidTimeWindow(certNotBefore, certNotAfter) {
+ const now = new Date(Date.now());
+ if (certNotBefore > now || certNotAfter < now) {
+ throw new Error('Certificate is not yet valid or expired');
+ }
+}
+// Custom errors to help pass on certain errors
+class InvalidSubjectAndIssuer extends Error {
+ constructor() {
+ const message = 'Subject issuer did not match issuer subject';
+ super(message);
+ this.name = 'InvalidSubjectAndIssuer';
+ }
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b8264e9695b8c41285e38d8f434451ff1812d782
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts
@@ -0,0 +1,8 @@
+import type { Extensions } from '@peculiar/asn1-x509';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Look for the id-fido-gen-ce-aaguid certificate extension. If it's present then check it against
+ * the attestation statement AAGUID.
+ */
+export declare function validateExtFIDOGenCEAAGUID(certExtensions: Extensions | undefined, aaguid: Uint8Array_): boolean;
+//# sourceMappingURL=validateExtFIDOGenCEAAGUID.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..99ab7e7a81943da5e2a47a28979cdd23b4b251e0
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"validateExtFIDOGenCEAAGUID.d.ts","sourceRoot":"","sources":["../../src/helpers/validateExtFIDOGenCEAAGUID.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AASrD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,UAAU,GAAG,SAAS,EACtC,MAAM,EAAE,WAAW,GAClB,OAAO,CA6BT"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.js b/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.js
new file mode 100644
index 0000000000000000000000000000000000000000..f2160423cb89b82e77b33142552c743054736914
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.js
@@ -0,0 +1,34 @@
+import { AsnParser, OctetString } from '@peculiar/asn1-schema';
+import { isoUint8Array } from './iso/index.js';
+/**
+ * Attestation Certificate Extension OID: `id-fido-gen-ce-aaguid`
+ *
+ * Sourced from https://fidoalliance.org/specs/fido-v2.0-ps-20150904/fido-key-attestation-v2.0-ps-20150904.html#verifying-an-attestation-statement
+ */
+const id_fido_gen_ce_aaguid = '1.3.6.1.4.1.45724.1.1.4';
+/**
+ * Look for the id-fido-gen-ce-aaguid certificate extension. If it's present then check it against
+ * the attestation statement AAGUID.
+ */
+export function validateExtFIDOGenCEAAGUID(certExtensions, aaguid) {
+ // The certificate had no extensions so there's nothing to validate
+ if (!certExtensions) {
+ return true;
+ }
+ const extFIDOGenCEAAGUID = certExtensions.find((ext) => ext.extnID === id_fido_gen_ce_aaguid);
+ // The extension isn't present so there's nothing to validate
+ if (!extFIDOGenCEAAGUID) {
+ return true;
+ }
+ // Parse the extension value
+ const parsedExtFIDOGenCEAAGUID = AsnParser.parse(extFIDOGenCEAAGUID.extnValue, OctetString);
+ const extValue = new Uint8Array(parsedExtFIDOGenCEAAGUID.buffer);
+ // Compare the two values
+ const aaguidAndExtAreEqual = isoUint8Array.areEqual(aaguid, extValue);
+ if (!aaguidAndExtAreEqual) {
+ const _debugExtHex = isoUint8Array.toHex(extValue);
+ const _debugAAGUIDHex = isoUint8Array.toHex(aaguid);
+ 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}"`);
+ }
+ return true;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.d.ts b/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2faaff74731ee8d903997c8a3995b79adc8b4f00
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.d.ts
@@ -0,0 +1,20 @@
+import { COSEALG } from './cose.js';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Verify an authenticator's signature
+ */
+export declare function verifySignature(opts: {
+ signature: Uint8Array_;
+ data: Uint8Array_;
+ credentialPublicKey?: Uint8Array_;
+ x509Certificate?: Uint8Array_;
+ hashAlgorithm?: COSEALG;
+}): Promise;
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _verifySignatureInternals: {
+ stubThis: (value: Promise) => Promise;
+};
+//# sourceMappingURL=verifySignature.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.d.ts.map b/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..8afaec9be99caa443c9a7d6feedc9796960c1974
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifySignature.d.ts","sourceRoot":"","sources":["../../src/helpers/verifySignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,MAAM,WAAW,CAAC;AAInD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,OAAO,CAAC,CAmCnB;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB;sBAClB,OAAO,CAAC,OAAO,CAAC;CACnC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.js b/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.js
new file mode 100644
index 0000000000000000000000000000000000000000..d748886be280c75f87fa8887b0dd50e78f09ca7d
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.js
@@ -0,0 +1,35 @@
+import { isoCrypto } from './iso/index.js';
+import { decodeCredentialPublicKey } from './decodeCredentialPublicKey.js';
+import { convertX509PublicKeyToCOSE } from './convertX509PublicKeyToCOSE.js';
+/**
+ * Verify an authenticator's signature
+ */
+export function verifySignature(opts) {
+ const { signature, data, credentialPublicKey, x509Certificate, hashAlgorithm, } = opts;
+ if (!x509Certificate && !credentialPublicKey) {
+ throw new Error('Must declare either "leafCert" or "credentialPublicKey"');
+ }
+ if (x509Certificate && credentialPublicKey) {
+ throw new Error('Must not declare both "leafCert" and "credentialPublicKey"');
+ }
+ let cosePublicKey = new Map();
+ if (credentialPublicKey) {
+ cosePublicKey = decodeCredentialPublicKey(credentialPublicKey);
+ }
+ else if (x509Certificate) {
+ cosePublicKey = convertX509PublicKeyToCOSE(x509Certificate);
+ }
+ return _verifySignatureInternals.stubThis(isoCrypto.verify({
+ cosePublicKey,
+ signature,
+ data,
+ shaHashOverride: hashAlgorithm,
+ }));
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export const _verifySignatureInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/esm/index.d.ts b/node_modules/@simplewebauthn/server/esm/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cdfb603bf10902e0443d7157fde5b324ef784444
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/index.d.ts
@@ -0,0 +1,9 @@
+export * from './registration/generateRegistrationOptions.js';
+export * from './registration/verifyRegistrationResponse.js';
+export * from './authentication/generateAuthenticationOptions.js';
+export * from './authentication/verifyAuthenticationResponse.js';
+export * from './services/metadataService.js';
+export * from './services/settingsService.js';
+export * from './metadata/mdsTypes.js';
+export * from './types/index.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/index.d.ts.map b/node_modules/@simplewebauthn/server/esm/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f2eeb61d453eb91dd1a93f6c21aa825d7b76057f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC;AAClE,cAAc,kDAAkD,CAAC;AACjE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/index.js b/node_modules/@simplewebauthn/server/esm/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..c3f437c1cc2f13a4a87a3164a5a6148845d52656
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/index.js
@@ -0,0 +1,8 @@
+export * from './registration/generateRegistrationOptions.js';
+export * from './registration/verifyRegistrationResponse.js';
+export * from './authentication/generateAuthenticationOptions.js';
+export * from './authentication/verifyAuthenticationResponse.js';
+export * from './services/metadataService.js';
+export * from './services/settingsService.js';
+export * from './metadata/mdsTypes.js';
+export * from './types/index.js';
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.d.ts b/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..45557a4317f70fd3e055bdf3dbe66614337c5f1e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.d.ts
@@ -0,0 +1,221 @@
+import type { Base64URLString } from '../types/index.js';
+/**
+ * Metadata Service structures
+ * https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html
+ */
+/** */
+export type MDSJWTHeader = {
+ alg: string;
+ typ: string;
+ x5c: Base64URLString[];
+};
+export type MDSJWTPayload = {
+ legalHeader: string;
+ no: number;
+ nextUpdate: string;
+ entries: MetadataBLOBPayloadEntry[];
+};
+export type MetadataBLOBPayloadEntry = {
+ aaid?: string;
+ aaguid?: string;
+ attestationCertificateKeyIdentifiers?: string[];
+ metadataStatement?: MetadataStatement;
+ biometricStatusReports?: BiometricStatusReport[];
+ statusReports: StatusReport[];
+ timeOfLastStatusChange: string;
+ rogueListURL?: string;
+ rogueListHash?: string;
+};
+export type BiometricStatusReport = {
+ certLevel: number;
+ modality: UserVerify;
+ effectiveDate?: string;
+ certificationDescriptor?: string;
+ certificateNumber?: string;
+ certificationPolicyVersion?: string;
+ certificationRequirementsVersion?: string;
+};
+export type StatusReport = {
+ status: AuthenticatorStatus;
+ effectiveDate?: string;
+ authenticatorVersion?: number;
+ certificate?: string;
+ url?: string;
+ certificationDescriptor?: string;
+ certificateNumber?: string;
+ certificationPolicyVersion?: string;
+ certificationRequirementsVersion?: string;
+};
+export type AuthenticatorStatus = 'NOT_FIDO_CERTIFIED' | 'FIDO_CERTIFIED' | 'USER_VERIFICATION_BYPASS' | 'ATTESTATION_KEY_COMPROMISE' | 'USER_KEY_REMOTE_COMPROMISE' | 'USER_KEY_PHYSICAL_COMPROMISE' | 'UPDATE_AVAILABLE' | 'REVOKED' | 'SELF_ASSERTION_SUBMITTED' | 'FIDO_CERTIFIED_L1' | 'FIDO_CERTIFIED_L1plus' | 'FIDO_CERTIFIED_L2' | 'FIDO_CERTIFIED_L2plus' | 'FIDO_CERTIFIED_L3' | 'FIDO_CERTIFIED_L3plus';
+/**
+ * Types defined in the FIDO Metadata Statement spec
+ *
+ * See https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html
+ */
+export type CodeAccuracyDescriptor = {
+ base: number;
+ minLength: number;
+ maxRetries?: number;
+ blockSlowdown?: number;
+};
+export type BiometricAccuracyDescriptor = {
+ selfAttestedFRR?: number;
+ selfAttestedFAR?: number;
+ maxTemplates?: number;
+ maxRetries?: number;
+ blockSlowdown?: number;
+};
+export type PatternAccuracyDescriptor = {
+ minComplexity: number;
+ maxRetries?: number;
+ blockSlowdown?: number;
+};
+export type VerificationMethodDescriptor = {
+ userVerificationMethod: UserVerify;
+ caDesc?: CodeAccuracyDescriptor;
+ baDesc?: BiometricAccuracyDescriptor;
+ paDesc?: PatternAccuracyDescriptor;
+};
+export type VerificationMethodANDCombinations = VerificationMethodDescriptor[];
+export type rgbPaletteEntry = {
+ r: number;
+ g: number;
+ b: number;
+};
+export type DisplayPNGCharacteristicsDescriptor = {
+ width: number;
+ height: number;
+ bitDepth: number;
+ colorType: number;
+ compression: number;
+ filter: number;
+ interlace: number;
+ plte?: rgbPaletteEntry[];
+};
+export type EcdaaTrustAnchor = {
+ X: string;
+ Y: string;
+ c: string;
+ sx: string;
+ sy: string;
+ G1Curve: string;
+};
+export type ExtensionDescriptor = {
+ id: string;
+ tag?: number;
+ data?: string;
+ fail_if_unknown: boolean;
+};
+/**
+ * langCode -> "en-US", "ja-JP", etc...
+ */
+export type AlternativeDescriptions = {
+ [langCode: string]: string;
+};
+export type MetadataStatement = {
+ legalHeader?: string;
+ aaid?: string;
+ aaguid?: string;
+ attestationCertificateKeyIdentifiers?: string[];
+ description: string;
+ alternativeDescriptions?: AlternativeDescriptions;
+ authenticatorVersion: number;
+ protocolFamily: string;
+ schema: number;
+ upv: Version[];
+ authenticationAlgorithms: AlgSign[];
+ publicKeyAlgAndEncodings: AlgKey[];
+ attestationTypes: Attestation[];
+ userVerificationDetails: VerificationMethodANDCombinations[];
+ keyProtection: KeyProtection[];
+ isKeyRestricted?: boolean;
+ isFreshUserVerificationRequired?: boolean;
+ matcherProtection: MatcherProtection[];
+ cryptoStrength?: number;
+ attachmentHint?: AttachmentHint[];
+ tcDisplay: TransactionConfirmationDisplay[];
+ tcDisplayContentType?: string;
+ tcDisplayPNGCharacteristics?: DisplayPNGCharacteristicsDescriptor[];
+ attestationRootCertificates: string[];
+ ecdaaTrustAnchors?: EcdaaTrustAnchor[];
+ icon?: string;
+ supportedExtensions?: ExtensionDescriptor[];
+ authenticatorGetInfo?: AuthenticatorGetInfo;
+};
+/**
+ * Types declared in other specs
+ */
+/**
+ * USER_VERIFY
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#user-verification-methods
+ */
+export type UserVerify = 'presence_internal' | 'fingerprint_internal' | 'passcode_internal' | 'voiceprint_internal' | 'faceprint_internal' | 'location_internal' | 'eyeprint_internal' | 'pattern_internal' | 'handprint_internal' | 'passcode_external' | 'pattern_external' | 'none' | 'all';
+/**
+ * ALG_SIGN
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authentication-algorithms
+ *
+ * Using this helpful TS pattern here so that we can strongly enforce the existence of COSE info
+ * mappings in `algSignToCOSEInfoMap` in verifyAttestationWithMetadata.ts
+ */
+export type AlgSign = typeof AlgSign[number];
+declare const AlgSign: readonly ["secp256r1_ecdsa_sha256_raw", "secp256r1_ecdsa_sha256_der", "rsassa_pss_sha256_raw", "rsassa_pss_sha256_der", "secp256k1_ecdsa_sha256_raw", "secp256k1_ecdsa_sha256_der", "rsassa_pss_sha384_raw", "rsassa_pkcsv15_sha256_raw", "rsassa_pkcsv15_sha384_raw", "rsassa_pkcsv15_sha512_raw", "rsassa_pkcsv15_sha1_raw", "secp384r1_ecdsa_sha384_raw", "secp512r1_ecdsa_sha256_raw", "ed25519_eddsa_sha512_raw"];
+/**
+ * ALG_KEY
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#public-key-representation-formats
+ */
+export type AlgKey = 'ecc_x962_raw' | 'ecc_x962_der' | 'rsa_2048_raw' | 'rsa_2048_der' | 'cose';
+/**
+ * ATTESTATION
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authenticator-attestation-types
+ */
+export type Attestation = 'basic_full' | 'basic_surrogate' | 'ecdaa' | 'attca' | 'anonca' | 'none';
+/**
+ * KEY_PROTECTION
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#key-protection-types
+ */
+export type KeyProtection = 'software' | 'hardware' | 'tee' | 'secure_element' | 'remote_handle';
+/**
+ * MATCHER_PROTECTION
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#matcher-protection-types
+ */
+export type MatcherProtection = 'software' | 'tee' | 'on_chip';
+/**
+ * ATTACHMENT_HINT
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authenticator-attachment-hints
+ */
+export type AttachmentHint = 'internal' | 'external' | 'wired' | 'wireless' | 'nfc' | 'bluetooth' | 'network' | 'ready' | 'wifi_direct';
+/**
+ * TRANSACTION_CONFIRMATION_DISPLAY
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#transaction-confirmation-display-types
+ */
+export type TransactionConfirmationDisplay = 'any' | 'privileged_software' | 'tee' | 'hardware' | 'remote';
+/**
+ * https://fidoalliance.org/specs/fido-uaf-v1.2-ps-20201020/fido-uaf-protocol-v1.2-ps-20201020.html#version-interface
+ */
+export type Version = {
+ major: number;
+ minor: number;
+};
+/**
+ * https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorGetInfoz
+ */
+export type AuthenticatorGetInfo = {
+ versions: ('FIDO_2_0' | 'U2F_V2')[];
+ extensions?: string[];
+ aaguid: string;
+ options?: {
+ plat?: boolean;
+ rk?: boolean;
+ clientPin?: boolean;
+ up?: boolean;
+ uv?: boolean;
+ };
+ maxMsgSize?: number;
+ pinProtocols?: number[];
+ algorithms?: {
+ type: 'public-key';
+ alg: number;
+ }[];
+};
+export {};
+//# sourceMappingURL=mdsTypes.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.d.ts.map b/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..0266a6c871f93e078e3481eca1daf9f4b6ea464e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mdsTypes.d.ts","sourceRoot":"","sources":["../../src/metadata/mdsTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;GAGG;AAEH,MAAM;AACN,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;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KAAK,GACL,gBAAgB,GAChB,eAAe,CAAC;AAEpB;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,KAAK,GAAG,SAAS,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,UAAU,GACV,OAAO,GACP,UAAU,GACV,KAAK,GACL,WAAW,GACX,SAAS,GACT,OAAO,GACP,aAAa,CAAC;AAElB;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GACtC,KAAK,GACL,qBAAqB,GACrB,KAAK,GACL,UAAU,GACV,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.js b/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.js
new file mode 100644
index 0000000000000000000000000000000000000000..dd369725a288bedbc86fcc8159ba891c8e4f71c4
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.js
@@ -0,0 +1,17 @@
+const AlgSign = [
+ 'secp256r1_ecdsa_sha256_raw',
+ 'secp256r1_ecdsa_sha256_der',
+ 'rsassa_pss_sha256_raw',
+ 'rsassa_pss_sha256_der',
+ 'secp256k1_ecdsa_sha256_raw',
+ 'secp256k1_ecdsa_sha256_der',
+ 'rsassa_pss_sha384_raw',
+ 'rsassa_pkcsv15_sha256_raw',
+ 'rsassa_pkcsv15_sha384_raw',
+ 'rsassa_pkcsv15_sha512_raw',
+ 'rsassa_pkcsv15_sha1_raw',
+ 'secp384r1_ecdsa_sha384_raw',
+ 'secp512r1_ecdsa_sha256_raw',
+ 'ed25519_eddsa_sha512_raw',
+];
+export {};
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.d.ts b/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3ac50e66ebde295218e166a364e1d97a8598c1b9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.d.ts
@@ -0,0 +1,5 @@
+/**
+ * Process a JWT into Javascript-friendly data structures
+ */
+export declare function parseJWT(jwt: string): [T1, T2, string];
+//# sourceMappingURL=parseJWT.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.d.ts.map b/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..3b1dbe4fd009e39f2812227d2629b04d22776855
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.d.ts.map
@@ -0,0 +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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.js b/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.js
new file mode 100644
index 0000000000000000000000000000000000000000..2db5a973c8564866593683b37ab5f94814ce2d9e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.js
@@ -0,0 +1,12 @@
+import { isoBase64URL } from '../helpers/iso/index.js';
+/**
+ * Process a JWT into Javascript-friendly data structures
+ */
+export function parseJWT(jwt) {
+ const parts = jwt.split('.');
+ return [
+ JSON.parse(isoBase64URL.toUTF8String(parts[0])),
+ JSON.parse(isoBase64URL.toUTF8String(parts[1])),
+ parts[2],
+ ];
+}
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.d.ts b/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c6589ef440f9231a13400535297a7305e5f9cedd
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.d.ts
@@ -0,0 +1,31 @@
+import type { Base64URLString } from '../types/index.js';
+import type { AlgSign, MetadataStatement } from './mdsTypes.js';
+import { type COSEALG, type COSECRV, COSEKTY } from '../helpers/cose.js';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Match properties of the authenticator's attestation statement against expected values as
+ * registered with the FIDO Alliance Metadata Service
+ */
+export declare function verifyAttestationWithMetadata({ statement, credentialPublicKey, x5c, attestationStatementAlg, }: {
+ statement: MetadataStatement;
+ credentialPublicKey: Uint8Array_;
+ x5c: Uint8Array_[] | Base64URLString[];
+ attestationStatementAlg?: number;
+}): Promise;
+type COSEInfo = {
+ kty: COSEKTY;
+ alg: COSEALG;
+ crv?: COSECRV;
+};
+/**
+ * Convert ALG_SIGN values to COSE info
+ *
+ * Values pulled from `ALG_KEY_COSE` definitions in the FIDO Registry of Predefined Values
+ *
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authentication-algorithms
+ */
+export declare const algSignToCOSEInfoMap: {
+ [key in AlgSign]: COSEInfo;
+};
+export {};
+//# sourceMappingURL=verifyAttestationWithMetadata.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.d.ts.map b/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..eab452ed068f6ee6f58ac9c9910109e3aa600a4b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationWithMetadata.d.ts","sourceRoot":"","sources":["../../src/metadata/verifyAttestationWithMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EAEZ,OAAO,EAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;GAGG;AACH,wBAAsB,6BAA6B,CAAC,EAClD,SAAS,EACT,mBAAmB,EACnB,GAAG,EACH,uBAAuB,GACxB,EAAE;IACD,SAAS,EAAE,iBAAiB,CAAC;IAC7B,mBAAmB,EAAE,WAAW,CAAC;IACjC,GAAG,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,CAAC;IACvC,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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.js b/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.js
new file mode 100644
index 0000000000000000000000000000000000000000..49d82a3c866a37b85579c531e277cac316fc03ad
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.js
@@ -0,0 +1,159 @@
+import { convertCertBufferToPEM } from '../helpers/convertCertBufferToPEM.js';
+import { validateCertificatePath } from '../helpers/validateCertificatePath.js';
+import { decodeCredentialPublicKey } from '../helpers/decodeCredentialPublicKey.js';
+import { COSEKEYS, COSEKTY, isCOSEPublicKeyEC2, } from '../helpers/cose.js';
+/**
+ * Match properties of the authenticator's attestation statement against expected values as
+ * registered with the FIDO Alliance Metadata Service
+ */
+export async function verifyAttestationWithMetadata({ statement, credentialPublicKey, x5c, attestationStatementAlg, }) {
+ const { authenticationAlgorithms, authenticatorGetInfo, attestationRootCertificates, } = statement;
+ // Make sure the alg in the attestation statement matches one of the ones specified in metadata
+ const keypairCOSEAlgs = new Set();
+ authenticationAlgorithms.forEach((algSign) => {
+ // Map algSign string to { kty, alg, crv }
+ const algSignCOSEINFO = algSignToCOSEInfoMap[algSign];
+ // Keeping this statement here just in case MDS returns something unexpected
+ if (algSignCOSEINFO) {
+ keypairCOSEAlgs.add(algSignCOSEINFO);
+ }
+ });
+ // Extract the public key's COSE info for comparison
+ const decodedPublicKey = decodeCredentialPublicKey(credentialPublicKey);
+ const kty = decodedPublicKey.get(COSEKEYS.kty);
+ const alg = decodedPublicKey.get(COSEKEYS.alg);
+ if (!kty) {
+ throw new Error('Credential public key was missing kty');
+ }
+ if (!alg) {
+ throw new Error('Credential public key was missing alg');
+ }
+ if (!kty) {
+ throw new Error('Credential public key was missing kty');
+ }
+ // Assume everything is a number because these values should be
+ const publicKeyCOSEInfo = { kty, alg };
+ if (isCOSEPublicKeyEC2(decodedPublicKey)) {
+ const crv = decodedPublicKey.get(COSEKEYS.crv);
+ publicKeyCOSEInfo.crv = crv;
+ }
+ /**
+ * Attempt to match the credential public key's algorithm to one specified in the device's
+ * metadata
+ */
+ let foundMatch = false;
+ for (const keypairAlg of keypairCOSEAlgs) {
+ // Make sure algorithm and key type match
+ if (keypairAlg.alg === publicKeyCOSEInfo.alg &&
+ keypairAlg.kty === publicKeyCOSEInfo.kty) {
+ // If not an RSA keypair then make sure curve numbers match too
+ if ((keypairAlg.kty === COSEKTY.EC2 || keypairAlg.kty === COSEKTY.OKP) &&
+ keypairAlg.crv === publicKeyCOSEInfo.crv) {
+ foundMatch = true;
+ }
+ else {
+ // We've matched an RSA public key's properties
+ foundMatch = true;
+ }
+ }
+ if (foundMatch) {
+ break;
+ }
+ }
+ // Make sure the public key is one of the allowed algorithms
+ if (!foundMatch) {
+ /**
+ * Craft some useful error output from the MDS algorithms
+ *
+ * Example:
+ *
+ * ```
+ * [
+ * 'rsassa_pss_sha256_raw' (COSE info: { kty: 3, alg: -37 }),
+ * 'secp256k1_ecdsa_sha256_raw' (COSE info: { kty: 2, alg: -47, crv: 8 })
+ * ]
+ * ```
+ */
+ const debugMDSAlgs = authenticationAlgorithms.map((algSign) => `'${algSign}' (COSE info: ${stringifyCOSEInfo(algSignToCOSEInfoMap[algSign])})`);
+ const strMDSAlgs = JSON.stringify(debugMDSAlgs, null, 2).replace(/"/g, '');
+ /**
+ * Construct useful error output about the public key
+ */
+ const strPubKeyAlg = stringifyCOSEInfo(publicKeyCOSEInfo);
+ throw new Error(`Public key parameters ${strPubKeyAlg} did not match any of the following metadata algorithms:\n${strMDSAlgs}`);
+ }
+ /**
+ * Confirm the attestation statement's algorithm is one supported according to metadata
+ */
+ if (attestationStatementAlg !== undefined &&
+ authenticatorGetInfo?.algorithms !== undefined) {
+ const getInfoAlgs = authenticatorGetInfo.algorithms.map((_alg) => _alg.alg);
+ if (getInfoAlgs.indexOf(attestationStatementAlg) < 0) {
+ throw new Error(`Attestation statement alg ${attestationStatementAlg} did not match one of ${getInfoAlgs}`);
+ }
+ }
+ // Prepare to check the certificate chain
+ const authenticatorCerts = x5c.map(convertCertBufferToPEM);
+ const statementRootCerts = attestationRootCertificates.map(convertCertBufferToPEM);
+ /**
+ * If an authenticator returns exactly one certificate in its x5c, and that cert is found in the
+ * metadata statement then the authenticator is "self-referencing". In this case we forego
+ * certificate chain validation.
+ */
+ let authenticatorIsSelfReferencing = false;
+ if (authenticatorCerts.length === 1 &&
+ statementRootCerts.indexOf(authenticatorCerts[0]) >= 0) {
+ authenticatorIsSelfReferencing = true;
+ }
+ if (!authenticatorIsSelfReferencing) {
+ try {
+ await validateCertificatePath(authenticatorCerts, statementRootCerts);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`Could not validate certificate path with any metadata root certificates: ${_err.message}`);
+ }
+ }
+ return true;
+}
+/**
+ * Convert ALG_SIGN values to COSE info
+ *
+ * Values pulled from `ALG_KEY_COSE` definitions in the FIDO Registry of Predefined Values
+ *
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authentication-algorithms
+ */
+export const algSignToCOSEInfoMap = {
+ secp256r1_ecdsa_sha256_raw: { kty: 2, alg: -7, crv: 1 },
+ secp256r1_ecdsa_sha256_der: { kty: 2, alg: -7, crv: 1 },
+ rsassa_pss_sha256_raw: { kty: 3, alg: -37 },
+ rsassa_pss_sha256_der: { kty: 3, alg: -37 },
+ secp256k1_ecdsa_sha256_raw: { kty: 2, alg: -47, crv: 8 },
+ secp256k1_ecdsa_sha256_der: { kty: 2, alg: -47, crv: 8 },
+ rsassa_pss_sha384_raw: { kty: 3, alg: -38 },
+ rsassa_pkcsv15_sha256_raw: { kty: 3, alg: -257 },
+ rsassa_pkcsv15_sha384_raw: { kty: 3, alg: -258 },
+ rsassa_pkcsv15_sha512_raw: { kty: 3, alg: -259 },
+ rsassa_pkcsv15_sha1_raw: { kty: 3, alg: -65535 },
+ secp384r1_ecdsa_sha384_raw: { kty: 2, alg: -35, crv: 2 },
+ secp512r1_ecdsa_sha256_raw: { kty: 2, alg: -36, crv: 3 },
+ ed25519_eddsa_sha512_raw: { kty: 1, alg: -8, crv: 6 },
+};
+/**
+ * A helper to format COSEInfo a little nicer than we can achieve with JSON.stringify()
+ *
+ * Input: `{ "kty": 3, "alg": -257 }`
+ *
+ * Output: `"{ kty: 3, alg: -257 }"`
+ */
+function stringifyCOSEInfo(info) {
+ const { kty, alg, crv } = info;
+ let toReturn = '';
+ if (kty !== COSEKTY.RSA) {
+ toReturn = `{ kty: ${kty}, alg: ${alg}, crv: ${crv} }`;
+ }
+ else {
+ toReturn = `{ kty: ${kty}, alg: ${alg} }`;
+ }
+ return toReturn;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.d.ts b/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8f76dcba0448e85b7aadd02fe8cfd3285da2c281
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.d.ts
@@ -0,0 +1,12 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Lightweight verification for FIDO MDS JWTs. Supports use of EC2 and RSA.
+ *
+ * If this ever needs to support more JWS algorithms, here's the list of them:
+ *
+ * https://www.rfc-editor.org/rfc/rfc7518.html#section-3.1
+ *
+ * (Pulled from https://www.rfc-editor.org/rfc/rfc7515#section-4.1.1)
+ */
+export declare function verifyJWT(jwt: string, leafCert: Uint8Array_): Promise;
+//# sourceMappingURL=verifyJWT.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.d.ts.map b/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..b5e2644c2a37cb941d707d2e6271a09c0ace081f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyJWT.d.ts","sourceRoot":"","sources":["../../src/metadata/verifyJWT.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CA0B9E"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.js b/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.js
new file mode 100644
index 0000000000000000000000000000000000000000..00a330172018898d49074ecb9afae5e60047e01a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.js
@@ -0,0 +1,37 @@
+import { convertX509PublicKeyToCOSE } from '../helpers/convertX509PublicKeyToCOSE.js';
+import { isoBase64URL, isoUint8Array } from '../helpers/iso/index.js';
+import { COSEALG, COSEKEYS, isCOSEPublicKeyEC2, isCOSEPublicKeyRSA } from '../helpers/cose.js';
+import { verifyEC2 } from '../helpers/iso/isoCrypto/verifyEC2.js';
+import { verifyRSA } from '../helpers/iso/isoCrypto/verifyRSA.js';
+/**
+ * Lightweight verification for FIDO MDS JWTs. Supports use of EC2 and RSA.
+ *
+ * If this ever needs to support more JWS algorithms, here's the list of them:
+ *
+ * https://www.rfc-editor.org/rfc/rfc7518.html#section-3.1
+ *
+ * (Pulled from https://www.rfc-editor.org/rfc/rfc7515#section-4.1.1)
+ */
+export function verifyJWT(jwt, leafCert) {
+ const [header, payload, signature] = jwt.split('.');
+ const certCOSE = convertX509PublicKeyToCOSE(leafCert);
+ const data = isoUint8Array.fromUTF8String(`${header}.${payload}`);
+ const signatureBytes = isoBase64URL.toBuffer(signature);
+ if (isCOSEPublicKeyEC2(certCOSE)) {
+ return verifyEC2({
+ data,
+ signature: signatureBytes,
+ cosePublicKey: certCOSE,
+ shaHashOverride: COSEALG.ES256,
+ });
+ }
+ else if (isCOSEPublicKeyRSA(certCOSE)) {
+ return verifyRSA({
+ data,
+ signature: signatureBytes,
+ cosePublicKey: certCOSE,
+ });
+ }
+ const kty = certCOSE.get(COSEKEYS.kty);
+ throw new Error(`JWT verification with public key of kty ${kty} is not supported by this method`);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.d.ts b/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..11f42802ae7a15720ca0176f11fc5b5baa3536aa
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.d.ts
@@ -0,0 +1,18 @@
+import type { MDSJWTPayload, MetadataStatement } from './mdsTypes.js';
+/**
+ * Perform authenticity and integrity verification of a
+ * [FIDO Metadata Service (MDS)](https://fidoalliance.org/metadata/)-compatible blob, and then
+ * extract the FIDO2 metadata statements included within. This method will make network requests
+ * for things like CRL checks.
+ *
+ * @param blob - A JWT downloaded from an MDS server (e.g. https://mds3.fidoalliance.org)
+ */
+export declare function verifyMDSBlob(blob: string): Promise<{
+ /** MetadataStatement entries within the verified blob */
+ statements: MetadataStatement[];
+ /** A JS `Date` instance of the verified blob's `payload.nextUpdate` string */
+ parsedNextUpdate: Date;
+ /** The verified blob's `payload` value */
+ payload: MDSJWTPayload;
+}>;
+//# sourceMappingURL=verifyMDSBlob.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.d.ts.map b/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..a8a61cfa3b2f21883c1c1fbed23b6a41cd7f42fa
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyMDSBlob.d.ts","sourceRoot":"","sources":["../../src/metadata/verifyMDSBlob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAQpF;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACzD,yDAAyD;IACzD,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,8EAA8E;IAC9E,gBAAgB,EAAE,IAAI,CAAC;IACvB,0CAA0C;IAC1C,OAAO,EAAE,aAAa,CAAC;CACxB,CAAC,CAuDD"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.js b/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.js
new file mode 100644
index 0000000000000000000000000000000000000000..6e710c5ab83865a268fc5da3d2e259a1fa9e38d4
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.js
@@ -0,0 +1,59 @@
+import { parseJWT } from './parseJWT.js';
+import { verifyJWT } from './verifyJWT.js';
+import { validateCertificatePath } from '../helpers/validateCertificatePath.js';
+import { convertCertBufferToPEM } from '../helpers/convertCertBufferToPEM.js';
+import { convertPEMToBytes } from '../helpers/convertPEMToBytes.js';
+import { SettingsService } from '../services/settingsService.js';
+/**
+ * Perform authenticity and integrity verification of a
+ * [FIDO Metadata Service (MDS)](https://fidoalliance.org/metadata/)-compatible blob, and then
+ * extract the FIDO2 metadata statements included within. This method will make network requests
+ * for things like CRL checks.
+ *
+ * @param blob - A JWT downloaded from an MDS server (e.g. https://mds3.fidoalliance.org)
+ */
+export async function verifyMDSBlob(blob) {
+ // Parse the JWT
+ const parsedJWT = parseJWT(blob);
+ const header = parsedJWT[0];
+ const payload = parsedJWT[1];
+ const headerCertsPEM = header.x5c.map(convertCertBufferToPEM);
+ try {
+ // Validate the certificate chain
+ const rootCerts = SettingsService.getRootCertificates({
+ identifier: 'mds',
+ });
+ await validateCertificatePath(headerCertsPEM, rootCerts);
+ }
+ catch (error) {
+ const _error = error;
+ // From FIDO MDS docs: "ignore the file if the chain cannot be verified or if one of the
+ // chain certificates is revoked"
+ throw new Error('BLOB certificate path could not be validated', { cause: _error });
+ }
+ // Verify the BLOB JWT signature
+ const leafCert = headerCertsPEM[0];
+ const verified = await verifyJWT(blob, convertPEMToBytes(leafCert));
+ if (!verified) {
+ // From FIDO MDS docs: "The FIDO Server SHOULD ignore the file if the signature is invalid."
+ throw new Error('BLOB signature could not be verified');
+ }
+ // Cache statements for FIDO2 devices
+ const statements = [];
+ for (const entry of payload.entries) {
+ // Only cache entries with an `aaguid`
+ if (entry.aaguid && entry.metadataStatement) {
+ statements.push(entry.metadataStatement);
+ }
+ }
+ // Convert the nextUpdate property into a Date so we can determine when to re-download
+ const [year, month, day] = payload.nextUpdate.split('-');
+ const parsedNextUpdate = new Date(parseInt(year, 10),
+ // Months need to be zero-indexed
+ parseInt(month, 10) - 1, parseInt(day, 10));
+ return {
+ statements,
+ parsedNextUpdate,
+ payload,
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/esm/package.json b/node_modules/@simplewebauthn/server/esm/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "module"
+}
diff --git a/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.d.ts b/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..93bd66d57d3e18ca4ef1a8043bd81c37ab9ced4a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.d.ts
@@ -0,0 +1,46 @@
+import type { AuthenticationExtensionsClientInputs, AuthenticatorSelectionCriteria, AuthenticatorTransportFuture, Base64URLString, COSEAlgorithmIdentifier, PublicKeyCredentialCreationOptionsJSON, Uint8Array_ } from '../types/index.js';
+export type GenerateRegistrationOptionsOpts = Parameters[0];
+/**
+ * Supported crypto algo identifiers
+ * See https://w3c.github.io/webauthn/#sctn-alg-identifier
+ * and https://www.iana.org/assignments/cose/cose.xhtml#algorithms
+ */
+export declare const supportedCOSEAlgorithmIdentifiers: COSEAlgorithmIdentifier[];
+/**
+ * Prepare a value to pass into navigator.credentials.create(...) for authenticator registration
+ *
+ * **Options:**
+ *
+ * @param rpName - User-visible, "friendly" website/service name
+ * @param rpID - Valid domain name (after `https://`)
+ * @param userName - User's website-specific username (email, etc...)
+ * @param userID **(Optional)** - User's website-specific unique ID. Defaults to generating a random identifier
+ * @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back. Defaults to generating a random value
+ * @param userDisplayName **(Optional)** - User's actual name. Defaults to `""`
+ * @param timeout **(Optional)** - How long (in ms) the user can take to complete attestation. Defaults to `60000`
+ * @param attestationType **(Optional)** - Specific attestation statement. Defaults to `"none"`
+ * @param excludeCredentials **(Optional)** - Authenticators registered by the user so the user can't register the same credential multiple times. Defaults to `[]`
+ * @param authenticatorSelection **(Optional)** - Advanced criteria for restricting the types of authenticators that may be used. Defaults to `{ residentKey: 'preferred', userVerification: 'preferred' }`
+ * @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during attestation
+ * @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]`
+ * @param preferredAuthenticatorType **(Optional)** - Encourage the browser to prompt the user to register a specific type of authenticator
+ */
+export declare function generateRegistrationOptions(options: {
+ rpName: string;
+ rpID: string;
+ userName: string;
+ userID?: Uint8Array_;
+ challenge?: string | Uint8Array_;
+ userDisplayName?: string;
+ timeout?: number;
+ attestationType?: 'direct' | 'enterprise' | 'none';
+ excludeCredentials?: {
+ id: Base64URLString;
+ transports?: AuthenticatorTransportFuture[];
+ }[];
+ authenticatorSelection?: AuthenticatorSelectionCriteria;
+ extensions?: AuthenticationExtensionsClientInputs;
+ supportedAlgorithmIDs?: COSEAlgorithmIdentifier[];
+ preferredAuthenticatorType?: 'securityKey' | 'localDevice' | 'remoteDevice';
+}): Promise;
+//# sourceMappingURL=generateRegistrationOptions.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..7dc79d36ef561c85629019cf7b6c8c84d90c9414
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"generateRegistrationOptions.d.ts","sourceRoot":"","sources":["../../src/registration/generateRegistrationOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oCAAoC,EACpC,8BAA8B,EAC9B,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,sCAAsC,EAGtC,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAK3B,MAAM,MAAM,+BAA+B,GAAG,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhG;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAE,uBAAuB,EAqBtE,CAAC;AAsBF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE;IACP,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;IACnD,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;IAClD,0BAA0B,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,cAAc,CAAC;CAC7E,GACA,OAAO,CAAC,sCAAsC,CAAC,CAqIjD"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.js b/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.js
new file mode 100644
index 0000000000000000000000000000000000000000..e17ceb530518d3fc0a1f9eb8ac2f38d121e67f88
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.js
@@ -0,0 +1,181 @@
+import { generateChallenge } from '../helpers/generateChallenge.js';
+import { generateUserID } from '../helpers/generateUserID.js';
+import { isoBase64URL, isoUint8Array } from '../helpers/iso/index.js';
+/**
+ * Supported crypto algo identifiers
+ * See https://w3c.github.io/webauthn/#sctn-alg-identifier
+ * and https://www.iana.org/assignments/cose/cose.xhtml#algorithms
+ */
+export const supportedCOSEAlgorithmIdentifiers = [
+ // EdDSA (In first position to encourage authenticators to use this over ES256)
+ -8,
+ // ECDSA w/ SHA-256
+ -7,
+ // ECDSA w/ SHA-512
+ -36,
+ // RSASSA-PSS w/ SHA-256
+ -37,
+ // RSASSA-PSS w/ SHA-384
+ -38,
+ // RSASSA-PSS w/ SHA-512
+ -39,
+ // RSASSA-PKCS1-v1_5 w/ SHA-256
+ -257,
+ // RSASSA-PKCS1-v1_5 w/ SHA-384
+ -258,
+ // RSASSA-PKCS1-v1_5 w/ SHA-512
+ -259,
+ // RSASSA-PKCS1-v1_5 w/ SHA-1 (Deprecated; here for legacy support)
+ -65535,
+];
+/**
+ * Set up some default authenticator selection options as per the latest spec:
+ * https://www.w3.org/TR/webauthn-2/#dictdef-authenticatorselectioncriteria
+ *
+ * Helps with some older platforms (e.g. Android 7.0 Nougat) that may not be aware of these
+ * defaults.
+ */
+const defaultAuthenticatorSelection = {
+ residentKey: 'preferred',
+ userVerification: 'preferred',
+};
+/**
+ * Use the most commonly-supported algorithms
+ * See the following:
+ * - https://www.iana.org/assignments/cose/cose.xhtml#algorithms
+ * - https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-pubkeycredparams
+ */
+const defaultSupportedAlgorithmIDs = [-8, -7, -257];
+/**
+ * Prepare a value to pass into navigator.credentials.create(...) for authenticator registration
+ *
+ * **Options:**
+ *
+ * @param rpName - User-visible, "friendly" website/service name
+ * @param rpID - Valid domain name (after `https://`)
+ * @param userName - User's website-specific username (email, etc...)
+ * @param userID **(Optional)** - User's website-specific unique ID. Defaults to generating a random identifier
+ * @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back. Defaults to generating a random value
+ * @param userDisplayName **(Optional)** - User's actual name. Defaults to `""`
+ * @param timeout **(Optional)** - How long (in ms) the user can take to complete attestation. Defaults to `60000`
+ * @param attestationType **(Optional)** - Specific attestation statement. Defaults to `"none"`
+ * @param excludeCredentials **(Optional)** - Authenticators registered by the user so the user can't register the same credential multiple times. Defaults to `[]`
+ * @param authenticatorSelection **(Optional)** - Advanced criteria for restricting the types of authenticators that may be used. Defaults to `{ residentKey: 'preferred', userVerification: 'preferred' }`
+ * @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during attestation
+ * @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]`
+ * @param preferredAuthenticatorType **(Optional)** - Encourage the browser to prompt the user to register a specific type of authenticator
+ */
+export async function generateRegistrationOptions(options) {
+ const { rpName, rpID, userName, userID, challenge = await generateChallenge(), userDisplayName = '', timeout = 60000, attestationType = 'none', excludeCredentials = [], authenticatorSelection = defaultAuthenticatorSelection, extensions, supportedAlgorithmIDs = defaultSupportedAlgorithmIDs, preferredAuthenticatorType, } = options;
+ /**
+ * Prepare pubKeyCredParams from the array of algorithm ID's
+ */
+ const pubKeyCredParams = supportedAlgorithmIDs.map((id) => ({
+ alg: id,
+ type: 'public-key',
+ }));
+ /**
+ * Capture some of the nuances of how `residentKey` and `requireResidentKey` how either is set
+ * depending on when either is defined in the options
+ */
+ if (authenticatorSelection.residentKey === undefined) {
+ /**
+ * `residentKey`: "If no value is given then the effective value is `required` if
+ * requireResidentKey is true or `discouraged` if it is false or absent."
+ *
+ * See https://www.w3.org/TR/webauthn-2/#dom-authenticatorselectioncriteria-residentkey
+ */
+ if (authenticatorSelection.requireResidentKey) {
+ authenticatorSelection.residentKey = 'required';
+ }
+ else {
+ /**
+ * FIDO Conformance v1.7.2 fails the first test if we do this, even though this is
+ * technically compatible with the WebAuthn L2 spec...
+ */
+ // authenticatorSelection.residentKey = 'discouraged';
+ }
+ }
+ else {
+ /**
+ * `requireResidentKey`: "Relying Parties SHOULD set it to true if, and only if, residentKey is
+ * set to "required""
+ *
+ * Spec says this property defaults to `false` so we should still be okay to assign `false` too
+ *
+ * See https://www.w3.org/TR/webauthn-2/#dom-authenticatorselectioncriteria-requireresidentkey
+ */
+ authenticatorSelection.requireResidentKey = authenticatorSelection.residentKey === 'required';
+ }
+ /**
+ * Preserve ability to specify `string` values for challenges
+ */
+ let _challenge = challenge;
+ if (typeof _challenge === 'string') {
+ _challenge = isoUint8Array.fromUTF8String(_challenge);
+ }
+ /**
+ * Explicitly disallow use of strings for userID anymore because `isoBase64URL.fromBuffer()` below
+ * will return an empty string if one gets through!
+ */
+ if (typeof userID === 'string') {
+ throw new Error(`String values for \`userID\` are no longer supported. See https://simplewebauthn.dev/docs/advanced/server/custom-user-ids`);
+ }
+ /**
+ * Generate a user ID if one is not provided
+ */
+ let _userID = userID;
+ if (!_userID) {
+ _userID = await generateUserID();
+ }
+ /**
+ * Map authenticator preference to hints. Map to authenticatorAttachment as well for
+ * backwards-compatibility.
+ */
+ const hints = [];
+ if (preferredAuthenticatorType) {
+ if (preferredAuthenticatorType === 'securityKey') {
+ hints.push('security-key');
+ authenticatorSelection.authenticatorAttachment = 'cross-platform';
+ }
+ else if (preferredAuthenticatorType === 'localDevice') {
+ hints.push('client-device');
+ authenticatorSelection.authenticatorAttachment = 'platform';
+ }
+ else if (preferredAuthenticatorType === 'remoteDevice') {
+ hints.push('hybrid');
+ authenticatorSelection.authenticatorAttachment = 'cross-platform';
+ }
+ }
+ return {
+ challenge: isoBase64URL.fromBuffer(_challenge),
+ rp: {
+ name: rpName,
+ id: rpID,
+ },
+ user: {
+ id: isoBase64URL.fromBuffer(_userID),
+ name: userName,
+ displayName: userDisplayName,
+ },
+ pubKeyCredParams,
+ timeout,
+ attestation: attestationType,
+ excludeCredentials: excludeCredentials.map((cred) => {
+ if (!isoBase64URL.isBase64URL(cred.id)) {
+ throw new Error(`excludeCredential id "${cred.id}" is not a valid base64url string`);
+ }
+ return {
+ ...cred,
+ id: isoBase64URL.trimPadding(cred.id),
+ type: 'public-key',
+ };
+ }),
+ authenticatorSelection,
+ extensions: {
+ ...extensions,
+ credProps: true,
+ },
+ hints,
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.d.ts b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..64d31c7ca8adfe2e6e1754a8a213876a09cc10ce
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.d.ts
@@ -0,0 +1,48 @@
+/**
+ * A whole lotta domain knowledge is captured here, with hazy connections to source
+ * documents. Good places to start searching for more info on these values are the
+ * following Trusted Computing Group TPM Library docs linked in the WebAuthn API:
+ *
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-Architecture-01.38.pdf
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-3-Commands-01.38.pdf
+ */
+/**
+ * 6.9 TPM_ST (Structure Tags)
+ */
+export declare const TPM_ST: {
+ [key: number]: string;
+};
+/**
+ * 6.3 TPM_ALG_ID
+ */
+export declare const TPM_ALG: {
+ [key: number]: string;
+};
+/**
+ * 6.4 TPM_ECC_CURVE
+ */
+export declare const TPM_ECC_CURVE: {
+ [key: number]: string;
+};
+type ManufacturerInfo = {
+ name: string;
+ id: string;
+};
+/**
+ * Sourced from https://trustedcomputinggroup.org/resource/vendor-id-registry/
+ *
+ * Latest version:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-Vendor-ID-Registry-Version-1.02-Revision-1.00.pdf
+ */
+export declare const TPM_MANUFACTURERS: {
+ [key: string]: ManufacturerInfo;
+};
+/**
+ * Match TPM public area curve ID's to `crv` numbers used in COSE public keys
+ */
+export declare const TPM_ECC_CURVE_COSE_CRV_MAP: {
+ [key: string]: number;
+};
+export {};
+//# sourceMappingURL=constants.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..4e0d35bb70f2499c83f7abd42a7f43d4e267dbb2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.d.ts.map
@@ -0,0 +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;CAgChE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAM/D,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.js b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.js
new file mode 100644
index 0000000000000000000000000000000000000000..1f27184745f606a250459d3bfc905ab09c2fd6ef
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.js
@@ -0,0 +1,137 @@
+// deno-lint-ignore-file no-dupe-keys
+/**
+ * A whole lotta domain knowledge is captured here, with hazy connections to source
+ * documents. Good places to start searching for more info on these values are the
+ * following Trusted Computing Group TPM Library docs linked in the WebAuthn API:
+ *
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-Architecture-01.38.pdf
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-3-Commands-01.38.pdf
+ */
+/**
+ * 6.9 TPM_ST (Structure Tags)
+ */
+export const TPM_ST = {
+ 0x00c4: 'TPM_ST_RSP_COMMAND',
+ 0x8000: 'TPM_ST_NULL',
+ 0x8001: 'TPM_ST_NO_SESSIONS',
+ 0x8002: 'TPM_ST_SESSIONS',
+ 0x8014: 'TPM_ST_ATTEST_NV',
+ 0x8015: 'TPM_ST_ATTEST_COMMAND_AUDIT',
+ 0x8016: 'TPM_ST_ATTEST_SESSION_AUDIT',
+ 0x8017: 'TPM_ST_ATTEST_CERTIFY',
+ 0x8018: 'TPM_ST_ATTEST_QUOTE',
+ 0x8019: 'TPM_ST_ATTEST_TIME',
+ 0x801a: 'TPM_ST_ATTEST_CREATION',
+ 0x8021: 'TPM_ST_CREATION',
+ 0x8022: 'TPM_ST_VERIFIED',
+ 0x8023: 'TPM_ST_AUTH_SECRET',
+ 0x8024: 'TPM_ST_HASHCHECK',
+ 0x8025: 'TPM_ST_AUTH_SIGNED',
+ 0x8029: 'TPM_ST_FU_MANIFEST',
+};
+/**
+ * 6.3 TPM_ALG_ID
+ */
+export const TPM_ALG = {
+ 0x0000: 'TPM_ALG_ERROR',
+ 0x0001: 'TPM_ALG_RSA',
+ 0x0004: 'TPM_ALG_SHA',
+ // @ts-ignore 2300
+ 0x0004: 'TPM_ALG_SHA1',
+ 0x0005: 'TPM_ALG_HMAC',
+ 0x0006: 'TPM_ALG_AES',
+ 0x0007: 'TPM_ALG_MGF1',
+ 0x0008: 'TPM_ALG_KEYEDHASH',
+ 0x000a: 'TPM_ALG_XOR',
+ 0x000b: 'TPM_ALG_SHA256',
+ 0x000c: 'TPM_ALG_SHA384',
+ 0x000d: 'TPM_ALG_SHA512',
+ 0x0010: 'TPM_ALG_NULL',
+ 0x0012: 'TPM_ALG_SM3_256',
+ 0x0013: 'TPM_ALG_SM4',
+ 0x0014: 'TPM_ALG_RSASSA',
+ 0x0015: 'TPM_ALG_RSAES',
+ 0x0016: 'TPM_ALG_RSAPSS',
+ 0x0017: 'TPM_ALG_OAEP',
+ 0x0018: 'TPM_ALG_ECDSA',
+ 0x0019: 'TPM_ALG_ECDH',
+ 0x001a: 'TPM_ALG_ECDAA',
+ 0x001b: 'TPM_ALG_SM2',
+ 0x001c: 'TPM_ALG_ECSCHNORR',
+ 0x001d: 'TPM_ALG_ECMQV',
+ 0x0020: 'TPM_ALG_KDF1_SP800_56A',
+ 0x0021: 'TPM_ALG_KDF2',
+ 0x0022: 'TPM_ALG_KDF1_SP800_108',
+ 0x0023: 'TPM_ALG_ECC',
+ 0x0025: 'TPM_ALG_SYMCIPHER',
+ 0x0026: 'TPM_ALG_CAMELLIA',
+ 0x0040: 'TPM_ALG_CTR',
+ 0x0041: 'TPM_ALG_OFB',
+ 0x0042: 'TPM_ALG_CBC',
+ 0x0043: 'TPM_ALG_CFB',
+ 0x0044: 'TPM_ALG_ECB',
+};
+/**
+ * 6.4 TPM_ECC_CURVE
+ */
+export const TPM_ECC_CURVE = {
+ 0x0000: 'TPM_ECC_NONE',
+ 0x0001: 'TPM_ECC_NIST_P192',
+ 0x0002: 'TPM_ECC_NIST_P224',
+ 0x0003: 'TPM_ECC_NIST_P256',
+ 0x0004: 'TPM_ECC_NIST_P384',
+ 0x0005: 'TPM_ECC_NIST_P521',
+ 0x0010: 'TPM_ECC_BN_P256',
+ 0x0011: 'TPM_ECC_BN_P638',
+ 0x0020: 'TPM_ECC_SM2_P256',
+};
+/**
+ * Sourced from https://trustedcomputinggroup.org/resource/vendor-id-registry/
+ *
+ * Latest version:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-Vendor-ID-Registry-Version-1.02-Revision-1.00.pdf
+ */
+export const TPM_MANUFACTURERS = {
+ 'id:414D4400': { name: 'AMD', id: 'AMD' },
+ 'id:414E5400': { name: 'Ant Group', id: 'ANT' },
+ 'id:41544D4C': { name: 'Atmel', id: 'ATML' },
+ 'id:4252434D': { name: 'Broadcom', id: 'BRCM' },
+ 'id:4353434F': { name: 'Cisco', id: 'CSCO' },
+ 'id:464C5953': { name: 'Flyslice Technologies', id: 'FLYS' },
+ 'id:524F4343': { name: 'Fuzhou Rockchip', id: 'ROCC' },
+ 'id:474F4F47': { name: 'Google', id: 'GOOG' },
+ 'id:48504900': { name: 'HPI', id: 'HPI' },
+ 'id:48504500': { name: 'HPE', id: 'HPE' },
+ 'id:48495349': { name: 'Huawei', id: 'HISI' },
+ 'id:49424d00': { name: 'IBM', id: 'IBM' },
+ 'id:49424D00': { name: 'IBM', id: 'IBM' }, // Same ID for IBM as above, except the "D" is capitalized as per TPM spec
+ 'id:49465800': { name: 'Infineon', id: 'IFX' },
+ 'id:494E5443': { name: 'Intel', id: 'INTC' },
+ 'id:4C454E00': { name: 'Lenovo', id: 'LEN' },
+ 'id:4D534654': { name: 'Microsoft', id: 'MSFT' },
+ 'id:4E534D20': { name: 'National Semiconductor', id: 'NSM' },
+ 'id:4E545A00': { name: 'Nationz', id: 'NTZ' },
+ 'id:4E534700': { name: 'NSING', id: 'NSG' },
+ 'id:4E544300': { name: 'Nuvoton Technology', id: 'NTC' },
+ 'id:51434F4D': { name: 'Qualcomm', id: 'QCOM' },
+ 'id:534D534E': { name: 'Samsung', id: 'SMSN' },
+ 'id:53454345': { name: 'SecEdge', id: 'SECE' },
+ 'id:534E5300': { name: 'Sinosun', id: 'SNS' },
+ 'id:534D5343': { name: 'SMSC', id: 'SMSC' },
+ 'id:53544D20': { name: 'STMicroelectronics', id: 'STM' },
+ 'id:54584E00': { name: 'Texas Instruments', id: 'TXN' },
+ 'id:57454300': { name: 'Winbond', id: 'WEC' },
+ 'id:5345414C': { name: 'Wisekey', id: 'SEAL' },
+ 'id:FFFFF1D0': { name: 'FIDO Alliance', id: 'FIDO' }, // FIDO Conformance
+};
+/**
+ * Match TPM public area curve ID's to `crv` numbers used in COSE public keys
+ */
+export const TPM_ECC_CURVE_COSE_CRV_MAP = {
+ TPM_ECC_NIST_P256: 1, // p256
+ TPM_ECC_NIST_P384: 2, // p384
+ TPM_ECC_NIST_P521: 3, // p521
+ TPM_ECC_BN_P256: 1, // p256
+ TPM_ECC_SM2_P256: 1, // p256
+};
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.d.ts b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cf8588a4c4b4f9c9ef11320b0febb1f01d6450d1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.d.ts
@@ -0,0 +1,26 @@
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Cut up a TPM attestation's certInfo into intelligible chunks
+ */
+export declare function parseCertInfo(certInfo: Uint8Array_): ParsedCertInfo;
+type ParsedCertInfo = {
+ magic: number;
+ type: string;
+ qualifiedSigner: Uint8Array_;
+ extraData: Uint8Array_;
+ clockInfo: {
+ clock: Uint8Array_;
+ resetCount: number;
+ restartCount: number;
+ safe: boolean;
+ };
+ firmwareVersion: Uint8Array_;
+ attested: {
+ nameAlg: string;
+ nameAlgBuffer: Uint8Array_;
+ name: Uint8Array_;
+ qualifiedName: Uint8Array_;
+ };
+};
+export {};
+//# sourceMappingURL=parseCertInfo.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..725ef5b78d933e156d59a38da50fec7095351428
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"parseCertInfo.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/parseCertInfo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,WAAW,GAAG,cAAc,CAkEnE;AAED,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,WAAW,CAAC;IAC7B,SAAS,EAAE,WAAW,CAAC;IACvB,SAAS,EAAE;QACT,KAAK,EAAE,WAAW,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;IACF,eAAe,EAAE,WAAW,CAAC;IAC7B,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,WAAW,CAAC;QAC3B,IAAI,EAAE,WAAW,CAAC;QAClB,aAAa,EAAE,WAAW,CAAC;KAC5B,CAAC;CACH,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.js b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.js
new file mode 100644
index 0000000000000000000000000000000000000000..20700cd2e8b7be0d76e7d7edaa45a181d8c5ec6c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.js
@@ -0,0 +1,58 @@
+import { TPM_ALG, TPM_ST } from './constants.js';
+import { isoUint8Array } from '../../../helpers/iso/index.js';
+/**
+ * Cut up a TPM attestation's certInfo into intelligible chunks
+ */
+export function parseCertInfo(certInfo) {
+ let pointer = 0;
+ const dataView = isoUint8Array.toDataView(certInfo);
+ // Get a magic constant
+ const magic = dataView.getUint32(pointer);
+ pointer += 4;
+ // Determine the algorithm used for attestation
+ const typeBuffer = dataView.getUint16(pointer);
+ pointer += 2;
+ const type = TPM_ST[typeBuffer];
+ // The name of a parent entity, can be ignored
+ const qualifiedSignerLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const qualifiedSigner = certInfo.slice(pointer, pointer += qualifiedSignerLength);
+ // Get the expected hash of `attsToBeSigned`
+ const extraDataLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const extraData = certInfo.slice(pointer, pointer += extraDataLength);
+ // Information about the TPM device's internal clock, can be ignored
+ const clock = certInfo.slice(pointer, pointer += 8);
+ const resetCount = dataView.getUint32(pointer);
+ pointer += 4;
+ const restartCount = dataView.getUint32(pointer);
+ pointer += 4;
+ const safe = !!certInfo.slice(pointer, pointer += 1);
+ const clockInfo = { clock, resetCount, restartCount, safe };
+ // TPM device firmware version
+ const firmwareVersion = certInfo.slice(pointer, pointer += 8);
+ // Attested Name
+ const attestedNameLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const attestedName = certInfo.slice(pointer, pointer += attestedNameLength);
+ const attestedNameDataView = isoUint8Array.toDataView(attestedName);
+ // Attested qualified name, can be ignored
+ const qualifiedNameLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const qualifiedName = certInfo.slice(pointer, pointer += qualifiedNameLength);
+ const attested = {
+ nameAlg: TPM_ALG[attestedNameDataView.getUint16(0)],
+ nameAlgBuffer: attestedName.slice(0, 2),
+ name: attestedName,
+ qualifiedName,
+ };
+ return {
+ magic,
+ type,
+ qualifiedSigner,
+ extraData,
+ clockInfo,
+ firmwareVersion,
+ attested,
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.d.ts b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b42264a8bb734d13e9248f70b3c427e614b829cf
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.d.ts
@@ -0,0 +1,45 @@
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Break apart a TPM attestation's pubArea buffer
+ *
+ * See 12.2.4 TPMT_PUBLIC here:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf
+ */
+export declare function parsePubArea(pubArea: Uint8Array_): ParsedPubArea;
+type ParsedPubArea = {
+ type: 'TPM_ALG_RSA' | 'TPM_ALG_ECC';
+ nameAlg: string;
+ objectAttributes: {
+ fixedTPM: boolean;
+ stClear: boolean;
+ fixedParent: boolean;
+ sensitiveDataOrigin: boolean;
+ userWithAuth: boolean;
+ adminWithPolicy: boolean;
+ noDA: boolean;
+ encryptedDuplication: boolean;
+ restricted: boolean;
+ decrypt: boolean;
+ signOrEncrypt: boolean;
+ };
+ authPolicy: Uint8Array_;
+ parameters: {
+ rsa?: RSAParameters;
+ ecc?: ECCParameters;
+ };
+ unique: Uint8Array_;
+};
+type RSAParameters = {
+ symmetric: string;
+ scheme: string;
+ keyBits: number;
+ exponent: number;
+};
+type ECCParameters = {
+ symmetric: string;
+ scheme: string;
+ curveID: string;
+ kdf: string;
+};
+export {};
+//# sourceMappingURL=parsePubArea.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..7136c7106fce2398adce5eb6b4f3f2f60daa4f83
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"parsePubArea.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/parsePubArea.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,aAAa,CAyGhE;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,WAAW,CAAC;IACxB,UAAU,EAAE;QACV,GAAG,CAAC,EAAE,aAAa,CAAC;QACpB,GAAG,CAAC,EAAE,aAAa,CAAC;KACrB,CAAC;IACF,MAAM,EAAE,WAAW,CAAC;CACrB,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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.js b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.js
new file mode 100644
index 0000000000000000000000000000000000000000..90b6c6693d9e57ec55fd3ef77fcda4523b1aa4d1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.js
@@ -0,0 +1,94 @@
+import { TPM_ALG, TPM_ECC_CURVE } from './constants.js';
+import { isoUint8Array } from '../../../helpers/iso/index.js';
+/**
+ * Break apart a TPM attestation's pubArea buffer
+ *
+ * See 12.2.4 TPMT_PUBLIC here:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf
+ */
+export function parsePubArea(pubArea) {
+ let pointer = 0;
+ const dataView = isoUint8Array.toDataView(pubArea);
+ const type = TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ const nameAlg = TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ // Get some authenticator attributes(?)
+ // const objectAttributesInt = pubArea.slice(pointer, (pointer += 4)).readUInt32BE(0);
+ const objectAttributesInt = dataView.getUint32(pointer);
+ pointer += 4;
+ const objectAttributes = {
+ fixedTPM: !!(objectAttributesInt & 1),
+ stClear: !!(objectAttributesInt & 2),
+ fixedParent: !!(objectAttributesInt & 8),
+ sensitiveDataOrigin: !!(objectAttributesInt & 16),
+ userWithAuth: !!(objectAttributesInt & 32),
+ adminWithPolicy: !!(objectAttributesInt & 64),
+ noDA: !!(objectAttributesInt & 512),
+ encryptedDuplication: !!(objectAttributesInt & 1024),
+ restricted: !!(objectAttributesInt & 32768),
+ decrypt: !!(objectAttributesInt & 65536),
+ signOrEncrypt: !!(objectAttributesInt & 131072),
+ };
+ // Slice out the authPolicy of dynamic length
+ const authPolicyLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const authPolicy = pubArea.slice(pointer, pointer += authPolicyLength);
+ // Extract additional curve params according to type
+ const parameters = {};
+ let unique = Uint8Array.from([]);
+ if (type === 'TPM_ALG_RSA') {
+ const symmetric = TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ const scheme = TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ const keyBits = dataView.getUint16(pointer);
+ pointer += 2;
+ const exponent = dataView.getUint32(pointer);
+ pointer += 4;
+ parameters.rsa = { symmetric, scheme, keyBits, exponent };
+ /**
+ * See 11.2.4.5 TPM2B_PUBLIC_KEY_RSA here:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf
+ */
+ // const uniqueLength = pubArea.slice(pointer, (pointer += 2)).readUInt16BE(0);
+ const uniqueLength = dataView.getUint16(pointer);
+ pointer += 2;
+ unique = pubArea.slice(pointer, pointer += uniqueLength);
+ }
+ else if (type === 'TPM_ALG_ECC') {
+ const symmetric = TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ const scheme = TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ const curveID = TPM_ECC_CURVE[dataView.getUint16(pointer)];
+ pointer += 2;
+ const kdf = TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ parameters.ecc = { symmetric, scheme, curveID, kdf };
+ /**
+ * See 11.2.5.1 TPM2B_ECC_PARAMETER here:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf
+ */
+ // Retrieve X
+ const uniqueXLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const uniqueX = pubArea.slice(pointer, pointer += uniqueXLength);
+ // Retrieve Y
+ const uniqueYLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const uniqueY = pubArea.slice(pointer, pointer += uniqueYLength);
+ unique = isoUint8Array.concat([uniqueX, uniqueY]);
+ }
+ else {
+ throw new Error(`Unexpected type "${type}" (TPM)`);
+ }
+ return {
+ type,
+ nameAlg,
+ objectAttributes,
+ authPolicy,
+ parameters,
+ unique,
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..87ad07f4cefc1d3d2d7eec64993482a62dfea53e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts
@@ -0,0 +1,3 @@
+import type { AttestationFormatVerifierOpts } from '../../verifyRegistrationResponse.js';
+export declare function verifyAttestationTPM(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationTPM.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..3859702eadda6049c6e6d3c6bccf47e45190e3e5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts.map
@@ -0,0 +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;AAwBzF,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA+VlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.js b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.js
new file mode 100644
index 0000000000000000000000000000000000000000..c5ae91c625286a2dcf7d6fb32f7f3a71b5e69dde
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.js
@@ -0,0 +1,331 @@
+import { AsnParser } from '@peculiar/asn1-schema';
+import { Certificate, ExtendedKeyUsage, id_ce_extKeyUsage, id_ce_subjectAltName, SubjectAlternativeName, } from '@peculiar/asn1-x509';
+import { decodeCredentialPublicKey } from '../../../helpers/decodeCredentialPublicKey.js';
+import { COSEALG, COSEKEYS, isCOSEAlg, isCOSEPublicKeyEC2, isCOSEPublicKeyRSA, } from '../../../helpers/cose.js';
+import { toHash } from '../../../helpers/toHash.js';
+import { convertCertBufferToPEM } from '../../../helpers/convertCertBufferToPEM.js';
+import { validateCertificatePath } from '../../../helpers/validateCertificatePath.js';
+import { getCertificateInfo } from '../../../helpers/getCertificateInfo.js';
+import { verifySignature } from '../../../helpers/verifySignature.js';
+import { isoUint8Array } from '../../../helpers/iso/index.js';
+import { validateExtFIDOGenCEAAGUID } from '../../../helpers/validateExtFIDOGenCEAAGUID.js';
+import { MetadataService } from '../../../services/metadataService.js';
+import { verifyAttestationWithMetadata } from '../../../metadata/verifyAttestationWithMetadata.js';
+import { TPM_ECC_CURVE_COSE_CRV_MAP, TPM_MANUFACTURERS } from './constants.js';
+import { parseCertInfo } from './parseCertInfo.js';
+import { parsePubArea } from './parsePubArea.js';
+export async function verifyAttestationTPM(options) {
+ const { aaguid, attStmt, authData, credentialPublicKey, clientDataHash, rootCertificates, } = options;
+ const ver = attStmt.get('ver');
+ const sig = attStmt.get('sig');
+ const alg = attStmt.get('alg');
+ const x5c = attStmt.get('x5c');
+ const pubArea = attStmt.get('pubArea');
+ const certInfo = attStmt.get('certInfo');
+ /**
+ * Verify structures
+ */
+ if (ver !== '2.0') {
+ throw new Error(`Unexpected ver "${ver}", expected "2.0" (TPM)`);
+ }
+ if (!sig) {
+ throw new Error('No attestation signature provided in attestation statement (TPM)');
+ }
+ if (!alg) {
+ throw new Error(`Attestation statement did not contain alg (TPM)`);
+ }
+ if (!isCOSEAlg(alg)) {
+ throw new Error(`Attestation statement contained invalid alg ${alg} (TPM)`);
+ }
+ if (!x5c) {
+ throw new Error('No attestation certificate provided in attestation statement (TPM)');
+ }
+ if (!pubArea) {
+ throw new Error('Attestation statement did not contain pubArea (TPM)');
+ }
+ if (!certInfo) {
+ throw new Error('Attestation statement did not contain certInfo (TPM)');
+ }
+ const parsedPubArea = parsePubArea(pubArea);
+ const { unique, type: pubType, parameters } = parsedPubArea;
+ // Verify that the public key specified by the parameters and unique fields of pubArea is
+ // identical to the credentialPublicKey in the attestedCredentialData in authenticatorData.
+ const cosePublicKey = decodeCredentialPublicKey(credentialPublicKey);
+ if (pubType === 'TPM_ALG_RSA') {
+ if (!isCOSEPublicKeyRSA(cosePublicKey)) {
+ throw new Error(`Credential public key with kty ${cosePublicKey.get(COSEKEYS.kty)} did not match ${pubType}`);
+ }
+ const n = cosePublicKey.get(COSEKEYS.n);
+ const e = cosePublicKey.get(COSEKEYS.e);
+ if (!n) {
+ throw new Error('COSE public key missing n (TPM|RSA)');
+ }
+ if (!e) {
+ throw new Error('COSE public key missing e (TPM|RSA)');
+ }
+ if (!isoUint8Array.areEqual(unique, n)) {
+ throw new Error('PubArea unique is not same as credentialPublicKey (TPM|RSA)');
+ }
+ if (!parameters.rsa) {
+ throw new Error(`Parsed pubArea type is RSA, but missing parameters.rsa (TPM|RSA)`);
+ }
+ const eBuffer = e;
+ // If `exponent` is equal to 0x00, then exponent is the default RSA exponent of 2^16+1 (65537)
+ const pubAreaExponent = parameters.rsa.exponent || 65537;
+ // Do some bit shifting to get to an integer
+ const eSum = eBuffer[0] + (eBuffer[1] << 8) + (eBuffer[2] << 16);
+ if (pubAreaExponent !== eSum) {
+ throw new Error(`Unexpected public key exp ${eSum}, expected ${pubAreaExponent} (TPM|RSA)`);
+ }
+ }
+ else if (pubType === 'TPM_ALG_ECC') {
+ if (!isCOSEPublicKeyEC2(cosePublicKey)) {
+ throw new Error(`Credential public key with kty ${cosePublicKey.get(COSEKEYS.kty)} did not match ${pubType}`);
+ }
+ const crv = cosePublicKey.get(COSEKEYS.crv);
+ const x = cosePublicKey.get(COSEKEYS.x);
+ const y = cosePublicKey.get(COSEKEYS.y);
+ if (!crv) {
+ throw new Error('COSE public key missing crv (TPM|ECC)');
+ }
+ if (!x) {
+ throw new Error('COSE public key missing x (TPM|ECC)');
+ }
+ if (!y) {
+ throw new Error('COSE public key missing y (TPM|ECC)');
+ }
+ if (!isoUint8Array.areEqual(unique, isoUint8Array.concat([x, y]))) {
+ throw new Error('PubArea unique is not same as public key x and y (TPM|ECC)');
+ }
+ if (!parameters.ecc) {
+ throw new Error(`Parsed pubArea type is ECC, but missing parameters.ecc (TPM|ECC)`);
+ }
+ const pubAreaCurveID = parameters.ecc.curveID;
+ const pubAreaCurveIDMapToCOSECRV = TPM_ECC_CURVE_COSE_CRV_MAP[pubAreaCurveID];
+ if (pubAreaCurveIDMapToCOSECRV !== crv) {
+ throw new Error(`Public area key curve ID "${pubAreaCurveID}" mapped to "${pubAreaCurveIDMapToCOSECRV}" which did not match public key crv of "${crv}" (TPM|ECC)`);
+ }
+ }
+ else {
+ throw new Error(`Unsupported pubArea.type "${pubType}"`);
+ }
+ const parsedCertInfo = parseCertInfo(certInfo);
+ const { magic, type: certType, attested, extraData } = parsedCertInfo;
+ if (magic !== 0xff544347) {
+ throw new Error(`Unexpected magic value "${magic}", expected "0xff544347" (TPM)`);
+ }
+ if (certType !== 'TPM_ST_ATTEST_CERTIFY') {
+ throw new Error(`Unexpected type "${certType}", expected "TPM_ST_ATTEST_CERTIFY" (TPM)`);
+ }
+ // Hash pubArea to create pubAreaHash using the nameAlg in attested
+ const pubAreaHash = await toHash(pubArea, attestedNameAlgToCOSEAlg(attested.nameAlg));
+ // Concatenate attested.nameAlg and pubAreaHash to create attestedName.
+ const attestedName = isoUint8Array.concat([
+ attested.nameAlgBuffer,
+ pubAreaHash,
+ ]);
+ // Check that certInfo.attested.name is equals to attestedName.
+ if (!isoUint8Array.areEqual(attested.name, attestedName)) {
+ throw new Error(`Attested name comparison failed (TPM)`);
+ }
+ // Concatenate authData with clientDataHash to create attToBeSigned
+ const attToBeSigned = isoUint8Array.concat([authData, clientDataHash]);
+ // Hash attToBeSigned using the algorithm specified in attStmt.alg to create attToBeSignedHash
+ const attToBeSignedHash = await toHash(attToBeSigned, alg);
+ // Check that certInfo.extraData is equals to attToBeSignedHash.
+ if (!isoUint8Array.areEqual(extraData, attToBeSignedHash)) {
+ throw new Error('CertInfo extra data did not equal hashed attestation (TPM)');
+ }
+ /**
+ * Verify signature
+ */
+ if (x5c.length < 1) {
+ throw new Error('No certificates present in x5c array (TPM)');
+ }
+ // Pick a leaf AIK certificate of the x5c array and parse it.
+ const leafCertInfo = getCertificateInfo(x5c[0]);
+ const { basicConstraintsCA, version, subject, notAfter, notBefore } = leafCertInfo;
+ if (basicConstraintsCA) {
+ throw new Error('Certificate basic constraints CA was not `false` (TPM)');
+ }
+ // Check that certificate is of version 3 (value must be set to 2).
+ if (version !== 2) {
+ throw new Error('Certificate version was not `3` (ASN.1 value of 2) (TPM)');
+ }
+ // Check that Subject sequence is empty.
+ if (subject.combined.length > 0) {
+ throw new Error('Certificate subject was not empty (TPM)');
+ }
+ // Check that certificate is currently valid
+ let now = new Date();
+ if (notBefore > now) {
+ throw new Error(`Certificate not good before "${notBefore.toString()}" (TPM)`);
+ }
+ // Check that certificate has not expired
+ now = new Date();
+ if (notAfter < now) {
+ throw new Error(`Certificate not good after "${notAfter.toString()}" (TPM)`);
+ }
+ /**
+ * Plumb the depths of the certificate's ASN.1-formatted data for some values we need to verify
+ */
+ const parsedCert = AsnParser.parse(x5c[0], Certificate);
+ if (!parsedCert.tbsCertificate.extensions) {
+ throw new Error('Certificate was missing extensions (TPM)');
+ }
+ let subjectAltNamePresent;
+ let extKeyUsage;
+ parsedCert.tbsCertificate.extensions.forEach((ext) => {
+ if (ext.extnID === id_ce_subjectAltName) {
+ subjectAltNamePresent = AsnParser.parse(ext.extnValue, SubjectAlternativeName);
+ }
+ else if (ext.extnID === id_ce_extKeyUsage) {
+ extKeyUsage = AsnParser.parse(ext.extnValue, ExtendedKeyUsage);
+ }
+ });
+ // Check that certificate contains subjectAltName (2.5.29.17) extension,
+ if (!subjectAltNamePresent) {
+ throw new Error('Certificate did not contain subjectAltName extension (TPM)');
+ }
+ // TPM-specific values are buried within `directoryName`, so first make sure there are values
+ // there.
+ if (!subjectAltNamePresent[0].directoryName?.[0].length) {
+ throw new Error('Certificate subjectAltName extension directoryName was empty (TPM)');
+ }
+ const { tcgAtTpmManufacturer, tcgAtTpmModel, tcgAtTpmVersion } = getTcgAtTpmValues(subjectAltNamePresent[0].directoryName);
+ if (!tcgAtTpmManufacturer || !tcgAtTpmModel || !tcgAtTpmVersion) {
+ throw new Error('Certificate contained incomplete subjectAltName data (TPM)');
+ }
+ if (!extKeyUsage) {
+ throw new Error('Certificate did not contain ExtendedKeyUsage extension (TPM)');
+ }
+ // Check that tcpaTpmManufacturer (2.23.133.2.1) field is set to a valid manufacturer ID.
+ if (!TPM_MANUFACTURERS[tcgAtTpmManufacturer]) {
+ throw new Error(`Could not match TPM manufacturer "${tcgAtTpmManufacturer}" (TPM)`);
+ }
+ // Check that certificate contains extKeyUsage (2.5.29.37) extension and it must contain
+ // tcg-kp-AIKCertificate (2.23.133.8.3) OID.
+ if (extKeyUsage[0] !== '2.23.133.8.3') {
+ throw new Error(`Unexpected extKeyUsage "${extKeyUsage[0]}", expected "2.23.133.8.3" (TPM)`);
+ }
+ // Validate attestation statement AAGUID against leaf cert AAGUID
+ try {
+ await validateExtFIDOGenCEAAGUID(parsedCert.tbsCertificate.extensions, aaguid);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (TPM)`);
+ }
+ // Run some metadata checks if a statement exists for this authenticator
+ const statement = await MetadataService.getStatement(aaguid);
+ if (statement) {
+ try {
+ await verifyAttestationWithMetadata({
+ statement,
+ credentialPublicKey,
+ x5c,
+ attestationStatementAlg: alg,
+ });
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (TPM)`);
+ }
+ }
+ else {
+ try {
+ // Try validating the certificate path using the root certificates set via SettingsService
+ await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (TPM)`);
+ }
+ }
+ // Verify signature over certInfo with the public key extracted from AIK certificate.
+ // In the wise words of Yuriy Ackermann: "Get Martini friend, you are done!"
+ return verifySignature({
+ signature: sig,
+ data: certInfo,
+ x509Certificate: x5c[0],
+ hashAlgorithm: alg,
+ });
+}
+/**
+ * Contain logic for pulling TPM-specific values out of subjectAlternativeName extension
+ */
+function getTcgAtTpmValues(root) {
+ const oidManufacturer = '2.23.133.2.1';
+ const oidModel = '2.23.133.2.2';
+ const oidVersion = '2.23.133.2.3';
+ let tcgAtTpmManufacturer;
+ let tcgAtTpmModel;
+ let tcgAtTpmVersion;
+ /**
+ * Iterate through the following potential structures:
+ *
+ * (Good, follows the spec)
+ * https://trustedcomputinggroup.org/wp-content/uploads/TCG_IWG_EKCredentialProfile_v2p3_r2_pub.pdf (page 33)
+ * Name [
+ * RelativeDistinguishedName [
+ * AttributeTypeAndValue { type, value }
+ * ]
+ * RelativeDistinguishedName [
+ * AttributeTypeAndValue { type, value }
+ * ]
+ * RelativeDistinguishedName [
+ * AttributeTypeAndValue { type, value }
+ * ]
+ * ]
+ *
+ * (Bad, does not follow the spec)
+ * Name [
+ * RelativeDistinguishedName [
+ * AttributeTypeAndValue { type, value }
+ * AttributeTypeAndValue { type, value }
+ * AttributeTypeAndValue { type, value }
+ * ]
+ * ]
+ *
+ * Both structures have been seen in the wild and need to be supported
+ */
+ root.forEach((relName) => {
+ relName.forEach((attr) => {
+ if (attr.type === oidManufacturer) {
+ tcgAtTpmManufacturer = attr.value.toString();
+ }
+ else if (attr.type === oidModel) {
+ tcgAtTpmModel = attr.value.toString();
+ }
+ else if (attr.type === oidVersion) {
+ tcgAtTpmVersion = attr.value.toString();
+ }
+ });
+ });
+ return {
+ tcgAtTpmManufacturer,
+ tcgAtTpmModel,
+ tcgAtTpmVersion,
+ };
+}
+/**
+ * Convert TPM-specific SHA algorithm ID's with COSE-specific equivalents. Note that the choice to
+ * use ECDSA SHA IDs is arbitrary; any such COSEALG that would map to SHA-256 in
+ * `mapCoseAlgToWebCryptoAlg()`
+ *
+ * SHA IDs referenced from here:
+ *
+ * https://trustedcomputinggroup.org/wp-content/uploads/TCG_TPM2_r1p59_Part2_Structures_pub.pdf
+ */
+function attestedNameAlgToCOSEAlg(alg) {
+ if (alg === 'TPM_ALG_SHA256') {
+ return COSEALG.ES256;
+ }
+ else if (alg === 'TPM_ALG_SHA384') {
+ return COSEALG.ES384;
+ }
+ else if (alg === 'TPM_ALG_SHA512') {
+ return COSEALG.ES512;
+ }
+ throw new Error(`Unexpected TPM attested name alg ${alg}`);
+}
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.d.ts b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3c3566a3f1b81c58e9422e4b14ce6946b9280cae
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.d.ts
@@ -0,0 +1,6 @@
+import type { AttestationFormatVerifierOpts } from '../verifyRegistrationResponse.js';
+/**
+ * Verify an attestation response with fmt 'android-key'
+ */
+export declare function verifyAttestationAndroidKey(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationAndroidKey.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..4bd3129e9e10f9587ae93cb5cb0eb4ed339a1457
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationAndroidKey.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationAndroidKey.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAUtF;;GAEG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA0JlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.js b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.js
new file mode 100644
index 0000000000000000000000000000000000000000..610c654ad0f076d3a4ec736164e0987318b1c5a6
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.js
@@ -0,0 +1,120 @@
+import { AsnParser } from '@peculiar/asn1-schema';
+import { Certificate } from '@peculiar/asn1-x509';
+import { id_ce_keyDescription, KeyDescription } from '@peculiar/asn1-android';
+import { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';
+import { validateCertificatePath } from '../../helpers/validateCertificatePath.js';
+import { verifySignature } from '../../helpers/verifySignature.js';
+import { convertCOSEtoPKCS } from '../../helpers/convertCOSEtoPKCS.js';
+import { isCOSEAlg } from '../../helpers/cose.js';
+import { isoUint8Array } from '../../helpers/iso/index.js';
+import { MetadataService } from '../../services/metadataService.js';
+import { verifyAttestationWithMetadata } from '../../metadata/verifyAttestationWithMetadata.js';
+/**
+ * Verify an attestation response with fmt 'android-key'
+ */
+export async function verifyAttestationAndroidKey(options) {
+ const { authData, clientDataHash, attStmt, credentialPublicKey, aaguid, rootCertificates, } = options;
+ const x5c = attStmt.get('x5c');
+ const sig = attStmt.get('sig');
+ const alg = attStmt.get('alg');
+ if (!x5c) {
+ throw new Error('No attestation certificate provided in attestation statement (Android Key)');
+ }
+ if (!sig) {
+ throw new Error('No attestation signature provided in attestation statement (Android Key)');
+ }
+ if (!alg) {
+ throw new Error(`Attestation statement did not contain alg (Android Key)`);
+ }
+ if (!isCOSEAlg(alg)) {
+ throw new Error(`Attestation statement contained invalid alg ${alg} (Android Key)`);
+ }
+ /**
+ * Verify that the public key in the first certificate in x5c matches the credentialPublicKey in
+ * the attestedCredentialData in authenticatorData.
+ */
+ // Find the public cert in the certificate as PKCS
+ const parsedCert = AsnParser.parse(x5c[0], Certificate);
+ const parsedCertPubKey = new Uint8Array(parsedCert.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey);
+ // Convert the credentialPublicKey to PKCS
+ const credPubKeyPKCS = convertCOSEtoPKCS(credentialPublicKey);
+ if (!isoUint8Array.areEqual(credPubKeyPKCS, parsedCertPubKey)) {
+ throw new Error('Credential public key does not equal leaf cert public key (Android Key)');
+ }
+ /**
+ * Verify that the attestationChallenge field in the attestation certificate extension data is
+ * identical to clientDataHash.
+ */
+ // Find Android KeyStore Extension in certificate extensions
+ const extKeyStore = parsedCert.tbsCertificate.extensions?.find((ext) => ext.extnID === id_ce_keyDescription);
+ if (!extKeyStore) {
+ throw new Error('Certificate did not contain extKeyStore (Android Key)');
+ }
+ const parsedExtKeyStore = AsnParser.parse(extKeyStore.extnValue, KeyDescription);
+ // Verify extKeyStore values
+ const { attestationChallenge, teeEnforced, softwareEnforced } = parsedExtKeyStore;
+ if (!isoUint8Array.areEqual(new Uint8Array(attestationChallenge.buffer), clientDataHash)) {
+ throw new Error('Attestation challenge was not equal to client data hash (Android Key)');
+ }
+ /**
+ * The AuthorizationList.allApplications field is not present on either authorization list
+ * (softwareEnforced nor teeEnforced), since PublicKeyCredential MUST be scoped to the RP ID.
+ *
+ * (i.e. These shouldn't contain the [600] tag)
+ */
+ if (teeEnforced.allApplications !== undefined) {
+ throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)');
+ }
+ if (softwareEnforced.allApplications !== undefined) {
+ throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)');
+ }
+ const statement = await MetadataService.getStatement(aaguid);
+ if (statement) {
+ try {
+ await verifyAttestationWithMetadata({
+ statement,
+ credentialPublicKey,
+ x5c,
+ attestationStatementAlg: alg,
+ });
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Android Key)`, { cause: _err });
+ }
+ }
+ else {
+ /**
+ * Verify that x5c contains a full certificate path.
+ */
+ const x5cNoRootPEM = x5c.slice(0, -1).map(convertCertBufferToPEM);
+ const x5cRootPEM = x5c.slice(-1).map(convertCertBufferToPEM);
+ try {
+ await validateCertificatePath(x5cNoRootPEM, x5cRootPEM);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Android Key)`, { cause: _err });
+ }
+ /**
+ * Make sure the root certificate is one of the Google Hardware Attestation Root certificates
+ *
+ * https://developer.android.com/privacy-and-security/security-key-attestation#root_certificate
+ */
+ if (rootCertificates.length > 0 && rootCertificates.indexOf(x5cRootPEM[0]) < 0) {
+ throw new Error('x5c root certificate was not a known root certificate (Android Key)');
+ }
+ }
+ /**
+ * Verify that sig is a valid signature over the concatenation of authenticatorData and
+ * clientDataHash using the public key in the first certificate in x5c with the algorithm
+ * specified in alg.
+ */
+ const signatureBase = isoUint8Array.concat([authData, clientDataHash]);
+ return verifySignature({
+ signature: sig,
+ data: signatureBase,
+ x509Certificate: x5c[0],
+ hashAlgorithm: alg,
+ });
+}
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..411eda1f30e60817636d6421e535125cde5d1b47
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts
@@ -0,0 +1,6 @@
+import type { AttestationFormatVerifierOpts } from '../verifyRegistrationResponse.js';
+/**
+ * Verify an attestation response with fmt 'android-safetynet'
+ */
+export declare function verifyAttestationAndroidSafetyNet(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationAndroidSafetyNet.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..a22ee0a90b8ed88451aa6c5ec5b9d0f231f4d82a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationAndroidSafetyNet.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationAndroidSafetyNet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAWtF;;GAEG;AACH,wBAAsB,iCAAiC,CACrD,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA6IlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.js b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.js
new file mode 100644
index 0000000000000000000000000000000000000000..530a7a95bf8636aec4f7fc840f25617b29c00633
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.js
@@ -0,0 +1,113 @@
+import { toHash } from '../../helpers/toHash.js';
+import { verifySignature } from '../../helpers/verifySignature.js';
+import { getCertificateInfo } from '../../helpers/getCertificateInfo.js';
+import { validateCertificatePath } from '../../helpers/validateCertificatePath.js';
+import { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';
+import { isoBase64URL, isoUint8Array } from '../../helpers/iso/index.js';
+import { MetadataService } from '../../services/metadataService.js';
+import { verifyAttestationWithMetadata } from '../../metadata/verifyAttestationWithMetadata.js';
+/**
+ * Verify an attestation response with fmt 'android-safetynet'
+ */
+export async function verifyAttestationAndroidSafetyNet(options) {
+ const { attStmt, clientDataHash, authData, aaguid, rootCertificates, verifyTimestampMS = true, credentialPublicKey, attestationSafetyNetEnforceCTSCheck, } = options;
+ const alg = attStmt.get('alg');
+ const response = attStmt.get('response');
+ const ver = attStmt.get('ver');
+ if (!ver) {
+ throw new Error('No ver value in attestation (SafetyNet)');
+ }
+ if (!response) {
+ throw new Error('No response was included in attStmt by authenticator (SafetyNet)');
+ }
+ // Prepare to verify a JWT
+ const jwt = isoUint8Array.toUTF8String(response);
+ const jwtParts = jwt.split('.');
+ const HEADER = JSON.parse(isoBase64URL.toUTF8String(jwtParts[0]));
+ const PAYLOAD = JSON.parse(isoBase64URL.toUTF8String(jwtParts[1]));
+ const SIGNATURE = jwtParts[2];
+ /**
+ * START Verify PAYLOAD
+ */
+ const { nonce, ctsProfileMatch, timestampMs } = PAYLOAD;
+ if (verifyTimestampMS) {
+ // Make sure timestamp is in the past
+ let now = Date.now();
+ if (timestampMs > Date.now()) {
+ throw new Error(`Payload timestamp "${timestampMs}" was later than "${now}" (SafetyNet)`);
+ }
+ // Consider a SafetyNet attestation valid within a minute of it being performed
+ const timestampPlusDelay = timestampMs + 60 * 1000;
+ now = Date.now();
+ if (timestampPlusDelay < now) {
+ throw new Error(`Payload timestamp "${timestampPlusDelay}" has expired (SafetyNet)`);
+ }
+ }
+ const nonceBase = isoUint8Array.concat([authData, clientDataHash]);
+ const nonceBuffer = await toHash(nonceBase);
+ const expectedNonce = isoBase64URL.fromBuffer(nonceBuffer, 'base64');
+ if (nonce !== expectedNonce) {
+ throw new Error('Could not verify payload nonce (SafetyNet)');
+ }
+ if (attestationSafetyNetEnforceCTSCheck && !ctsProfileMatch) {
+ throw new Error('Could not verify device integrity (SafetyNet)');
+ }
+ /**
+ * END Verify PAYLOAD
+ */
+ /**
+ * START Verify Header
+ */
+ // `HEADER.x5c[0]` is definitely a base64 string
+ const leafCertBuffer = isoBase64URL.toBuffer(HEADER.x5c[0], 'base64');
+ const leafCertInfo = getCertificateInfo(leafCertBuffer);
+ const { subject } = leafCertInfo;
+ // Ensure the certificate was issued to this hostname
+ // See https://developer.android.com/training/safetynet/attestation#verify-attestation-response
+ if (subject.CN !== 'attest.android.com') {
+ throw new Error('Certificate common name was not "attest.android.com" (SafetyNet)');
+ }
+ const statement = await MetadataService.getStatement(aaguid);
+ if (statement) {
+ try {
+ await verifyAttestationWithMetadata({
+ statement,
+ credentialPublicKey,
+ x5c: HEADER.x5c,
+ attestationStatementAlg: alg,
+ });
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (SafetyNet)`);
+ }
+ }
+ else {
+ try {
+ // Try validating the certificate path using the root certificates set via SettingsService
+ await validateCertificatePath(HEADER.x5c.map(convertCertBufferToPEM), rootCertificates);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (SafetyNet)`);
+ }
+ }
+ /**
+ * END Verify Header
+ */
+ /**
+ * START Verify Signature
+ */
+ const signatureBaseBuffer = isoUint8Array.fromUTF8String(`${jwtParts[0]}.${jwtParts[1]}`);
+ const signatureBuffer = isoBase64URL.toBuffer(SIGNATURE);
+ const verified = await verifySignature({
+ signature: signatureBuffer,
+ data: signatureBaseBuffer,
+ x509Certificate: leafCertBuffer,
+ hashAlgorithm: alg,
+ });
+ /**
+ * END Verify Signature
+ */
+ return verified;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.d.ts b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c998a454a2e6d012ac90f7627cdcd91f4f9b64df
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.d.ts
@@ -0,0 +1,3 @@
+import type { AttestationFormatVerifierOpts } from '../verifyRegistrationResponse.js';
+export declare function verifyAttestationApple(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationApple.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..c88e16194919abae68de2c5fc8b62e3ccb27ffeb
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationApple.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationApple.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAOtF,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA6ElB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.js b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.js
new file mode 100644
index 0000000000000000000000000000000000000000..8f15961925dcb1139828531a45a2e347e4d62109
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.js
@@ -0,0 +1,58 @@
+import { AsnParser } from '@peculiar/asn1-schema';
+import { Certificate } from '@peculiar/asn1-x509';
+import { validateCertificatePath } from '../../helpers/validateCertificatePath.js';
+import { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';
+import { toHash } from '../../helpers/toHash.js';
+import { convertCOSEtoPKCS } from '../../helpers/convertCOSEtoPKCS.js';
+import { isoUint8Array } from '../../helpers/iso/index.js';
+export async function verifyAttestationApple(options) {
+ const { attStmt, authData, clientDataHash, credentialPublicKey, rootCertificates, } = options;
+ const x5c = attStmt.get('x5c');
+ if (!x5c) {
+ throw new Error('No attestation certificate provided in attestation statement (Apple)');
+ }
+ /**
+ * Verify certificate path
+ */
+ try {
+ await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Apple)`);
+ }
+ /**
+ * Compare nonce in certificate extension to computed nonce
+ */
+ const parsedCredCert = AsnParser.parse(x5c[0], Certificate);
+ const { extensions, subjectPublicKeyInfo } = parsedCredCert.tbsCertificate;
+ if (!extensions) {
+ throw new Error('credCert missing extensions (Apple)');
+ }
+ const extCertNonce = extensions.find((ext) => ext.extnID === '1.2.840.113635.100.8.2');
+ if (!extCertNonce) {
+ throw new Error('credCert missing "1.2.840.113635.100.8.2" extension (Apple)');
+ }
+ const nonceToHash = isoUint8Array.concat([authData, clientDataHash]);
+ const nonce = await toHash(nonceToHash);
+ /**
+ * Ignore the first six ASN.1 structure bytes that define the nonce as an OCTET STRING. Should
+ * trim off
+ *
+ * TODO: Try and get @peculiar (GitHub) to add a schema for "1.2.840.113635.100.8.2" when we
+ * find out where it's defined (doesn't seem to be publicly documented at the moment...)
+ */
+ const extNonce = new Uint8Array(extCertNonce.extnValue.buffer).slice(6);
+ if (!isoUint8Array.areEqual(nonce, extNonce)) {
+ throw new Error(`credCert nonce was not expected value (Apple)`);
+ }
+ /**
+ * Verify credential public key matches the Subject Public Key of credCert
+ */
+ const credPubKeyPKCS = convertCOSEtoPKCS(credentialPublicKey);
+ const credCertSubjectPublicKey = new Uint8Array(subjectPublicKeyInfo.subjectPublicKey);
+ if (!isoUint8Array.areEqual(credPubKeyPKCS, credCertSubjectPublicKey)) {
+ throw new Error('Credential public key does not equal credCert public key (Apple)');
+ }
+ return true;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4c8818418974391300bdf7a08fe2a1204844f266
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts
@@ -0,0 +1,6 @@
+import type { AttestationFormatVerifierOpts } from '../verifyRegistrationResponse.js';
+/**
+ * Verify an attestation response with fmt 'fido-u2f'
+ */
+export declare function verifyAttestationFIDOU2F(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationFIDOU2F.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f665a87f0dfec6f31a6f19b521eae041ae420913
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationFIDOU2F.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationFIDOU2F.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAStF;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA4DlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.js b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.js
new file mode 100644
index 0000000000000000000000000000000000000000..4f6dd6c541d126bf78c32f1fe241f9f20e79bc8f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.js
@@ -0,0 +1,48 @@
+import { convertCOSEtoPKCS } from '../../helpers/convertCOSEtoPKCS.js';
+import { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';
+import { validateCertificatePath } from '../../helpers/validateCertificatePath.js';
+import { verifySignature } from '../../helpers/verifySignature.js';
+import { isoUint8Array } from '../../helpers/iso/index.js';
+import { COSEALG } from '../../helpers/cose.js';
+/**
+ * Verify an attestation response with fmt 'fido-u2f'
+ */
+export async function verifyAttestationFIDOU2F(options) {
+ const { attStmt, clientDataHash, rpIdHash, credentialID, credentialPublicKey, aaguid, rootCertificates, } = options;
+ const reservedByte = Uint8Array.from([0x00]);
+ const publicKey = convertCOSEtoPKCS(credentialPublicKey);
+ const signatureBase = isoUint8Array.concat([
+ reservedByte,
+ rpIdHash,
+ clientDataHash,
+ credentialID,
+ publicKey,
+ ]);
+ const sig = attStmt.get('sig');
+ const x5c = attStmt.get('x5c');
+ if (!x5c) {
+ throw new Error('No attestation certificate provided in attestation statement (FIDOU2F)');
+ }
+ if (!sig) {
+ throw new Error('No attestation signature provided in attestation statement (FIDOU2F)');
+ }
+ // FIDO spec says that aaguid _must_ equal 0x00 here to be legit
+ const aaguidToHex = Number.parseInt(isoUint8Array.toHex(aaguid), 16);
+ if (aaguidToHex !== 0x00) {
+ throw new Error(`AAGUID "${aaguidToHex}" was not expected value`);
+ }
+ try {
+ // Try validating the certificate path using the root certificates set via SettingsService
+ await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (FIDOU2F)`);
+ }
+ return verifySignature({
+ signature: sig,
+ data: signatureBase,
+ x509Certificate: x5c[0],
+ hashAlgorithm: COSEALG.ES256,
+ });
+}
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.d.ts b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7b54a02d24c42731533d75b8612bb3e0368ad3d3
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.d.ts
@@ -0,0 +1,6 @@
+import type { AttestationFormatVerifierOpts } from '../verifyRegistrationResponse.js';
+/**
+ * Verify an attestation response with fmt 'packed'
+ */
+export declare function verifyAttestationPacked(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationPacked.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..65e0747378cdb2b6d9c18e88f81d07d46ae7b32b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationPacked.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationPacked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAYtF;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA0JlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.js b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.js
new file mode 100644
index 0000000000000000000000000000000000000000..c31c37bf9e45c640e1c6caeb1d0dc0153683dd54
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.js
@@ -0,0 +1,113 @@
+import { isCOSEAlg } from '../../helpers/cose.js';
+import { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';
+import { validateCertificatePath } from '../../helpers/validateCertificatePath.js';
+import { getCertificateInfo } from '../../helpers/getCertificateInfo.js';
+import { verifySignature } from '../../helpers/verifySignature.js';
+import { isoUint8Array } from '../../helpers/iso/index.js';
+import { validateExtFIDOGenCEAAGUID } from '../../helpers/validateExtFIDOGenCEAAGUID.js';
+import { MetadataService } from '../../services/metadataService.js';
+import { verifyAttestationWithMetadata } from '../../metadata/verifyAttestationWithMetadata.js';
+/**
+ * Verify an attestation response with fmt 'packed'
+ */
+export async function verifyAttestationPacked(options) {
+ const { attStmt, clientDataHash, authData, credentialPublicKey, aaguid, rootCertificates, } = options;
+ const sig = attStmt.get('sig');
+ const x5c = attStmt.get('x5c');
+ const alg = attStmt.get('alg');
+ if (!sig) {
+ throw new Error('No attestation signature provided in attestation statement (Packed)');
+ }
+ if (!alg) {
+ throw new Error('Attestation statement did not contain alg (Packed)');
+ }
+ if (!isCOSEAlg(alg)) {
+ throw new Error(`Attestation statement contained invalid alg ${alg} (Packed)`);
+ }
+ const signatureBase = isoUint8Array.concat([authData, clientDataHash]);
+ let verified = false;
+ if (x5c) {
+ const { subject, basicConstraintsCA, version, notBefore, notAfter, parsedCertificate, } = getCertificateInfo(x5c[0]);
+ const { OU, CN, O, C } = subject;
+ if (OU !== 'Authenticator Attestation') {
+ throw new Error('Certificate OU was not "Authenticator Attestation" (Packed|Full)');
+ }
+ if (!CN) {
+ throw new Error('Certificate CN was empty (Packed|Full)');
+ }
+ if (!O) {
+ throw new Error('Certificate O was empty (Packed|Full)');
+ }
+ if (!C || C.length !== 2) {
+ throw new Error('Certificate C was not two-character ISO 3166 code (Packed|Full)');
+ }
+ if (basicConstraintsCA) {
+ throw new Error('Certificate basic constraints CA was not `false` (Packed|Full)');
+ }
+ if (version !== 2) {
+ throw new Error('Certificate version was not `3` (ASN.1 value of 2) (Packed|Full)');
+ }
+ let now = new Date();
+ if (notBefore > now) {
+ throw new Error(`Certificate not good before "${notBefore.toString()}" (Packed|Full)`);
+ }
+ now = new Date();
+ if (notAfter < now) {
+ throw new Error(`Certificate not good after "${notAfter.toString()}" (Packed|Full)`);
+ }
+ // Validate attestation statement AAGUID against leaf cert AAGUID
+ try {
+ await validateExtFIDOGenCEAAGUID(parsedCertificate.tbsCertificate.extensions, aaguid);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Packed|Full)`);
+ }
+ // If available, validate attestation alg and x5c with info in the metadata statement
+ const statement = await MetadataService.getStatement(aaguid);
+ if (statement) {
+ // The presence of x5c means this is a full attestation. Check to see if attestationTypes
+ // includes packed attestations.
+ if (statement.attestationTypes.indexOf('basic_full') < 0) {
+ throw new Error('Metadata does not indicate support for full attestations (Packed|Full)');
+ }
+ try {
+ await verifyAttestationWithMetadata({
+ statement,
+ credentialPublicKey,
+ x5c,
+ attestationStatementAlg: alg,
+ });
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Packed|Full)`);
+ }
+ }
+ else {
+ try {
+ // Try validating the certificate path using the root certificates set via SettingsService
+ await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Packed|Full)`);
+ }
+ }
+ verified = await verifySignature({
+ signature: sig,
+ data: signatureBase,
+ x509Certificate: x5c[0],
+ hashAlgorithm: alg,
+ });
+ }
+ else {
+ verified = await verifySignature({
+ signature: sig,
+ data: signatureBase,
+ credentialPublicKey,
+ hashAlgorithm: alg,
+ });
+ }
+ return verified;
+}
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.d.ts b/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3460d16c90dc23bee4fdef46ebb8bed6f3249094
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.d.ts
@@ -0,0 +1,94 @@
+import type { COSEAlgorithmIdentifier, CredentialDeviceType, RegistrationResponseJSON, Uint8Array_, WebAuthnCredential } from '../types/index.js';
+import { type AttestationFormat, type AttestationStatement } from '../helpers/decodeAttestationObject.js';
+import type { AuthenticationExtensionsAuthenticatorOutputs } from '../helpers/decodeAuthenticatorExtensions.js';
+/**
+ * Configurable options when calling `verifyRegistrationResponse()`
+ */
+export type VerifyRegistrationResponseOpts = Parameters[0];
+/**
+ * Verify that the user has legitimately completed the registration process
+ *
+ * **Options:**
+ *
+ * @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`
+ * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateRegistrationOptions()`
+ * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
+ * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
+ * @param expectedType **(Optional)** - The response type expected ('webauthn.create')
+ * @param requireUserPresence **(Optional)** - Enforce user presence by the authenticator (or skip it during auto registration) Defaults to `true`
+ * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
+ * @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
+ * @param attestationSafetyNetEnforceCTSCheck **(Optional)** - Require that an Android device's system integrity has not been tampered with if it uses SafetyNet attestation. Defaults to `true`
+ */
+export declare function verifyRegistrationResponse(options: {
+ response: RegistrationResponseJSON;
+ expectedChallenge: string | ((challenge: string) => boolean | Promise);
+ expectedOrigin: string | string[];
+ expectedRPID?: string | string[];
+ expectedType?: string | string[];
+ requireUserPresence?: boolean;
+ requireUserVerification?: boolean;
+ supportedAlgorithmIDs?: COSEAlgorithmIdentifier[];
+ attestationSafetyNetEnforceCTSCheck?: boolean;
+}): Promise;
+/**
+ * Result of registration verification
+ *
+ * @param verified If the assertion response could be verified
+ * @param registrationInfo.fmt Type of attestation
+ * @param registrationInfo.counter The number of times the authenticator reported it has been used.
+ * **Should be kept in a DB for later reference to help prevent replay attacks!**
+ * @param registrationInfo.aaguid Authenticator's Attestation GUID indicating the type of the
+ * authenticator
+ * @param registrationInfo.credentialPublicKey The credential's public key
+ * @param registrationInfo.credentialID The credential's credential ID for the public key above
+ * @param registrationInfo.credentialType The type of the credential returned by the browser
+ * @param registrationInfo.userVerified Whether the user was uniquely identified during attestation
+ * @param registrationInfo.attestationObject The raw `response.attestationObject` Buffer returned by
+ * the authenticator
+ * @param registrationInfo.credentialDeviceType Whether this is a single-device or multi-device
+ * credential. **Should be kept in a DB for later reference!**
+ * @param registrationInfo.credentialBackedUp Whether or not the multi-device credential has been
+ * backed up. Always `false` for single-device credentials. **Should be kept in a DB for later
+ * reference!**
+ * @param registrationInfo.origin The origin of the website that the registration occurred on
+ * @param registrationInfo?.rpID The RP ID that the registration occurred on, if one or more were
+ * specified in the registration options
+ * @param registrationInfo?.authenticatorExtensionResults The authenticator extensions returned
+ * by the browser
+ */
+export type VerifiedRegistrationResponse = {
+ verified: false;
+ registrationInfo?: never;
+} | {
+ verified: true;
+ registrationInfo: {
+ fmt: AttestationFormat;
+ aaguid: string;
+ credential: WebAuthnCredential;
+ credentialType: 'public-key';
+ attestationObject: Uint8Array_;
+ userVerified: boolean;
+ credentialDeviceType: CredentialDeviceType;
+ credentialBackedUp: boolean;
+ origin: string;
+ rpID?: string;
+ authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs;
+ };
+};
+/**
+ * Values passed to all attestation format verifiers, from which they are free to use as they please
+ */
+export type AttestationFormatVerifierOpts = {
+ aaguid: Uint8Array_;
+ attStmt: AttestationStatement;
+ authData: Uint8Array_;
+ clientDataHash: Uint8Array_;
+ credentialID: Uint8Array_;
+ credentialPublicKey: Uint8Array_;
+ rootCertificates: string[];
+ rpIdHash: Uint8Array_;
+ verifyTimestampMS?: boolean;
+ attestationSafetyNetEnforceCTSCheck?: boolean;
+};
+//# sourceMappingURL=verifyRegistrationResponse.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.d.ts.map b/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f5230294f78f8d46ca07113c389fff4da2ddcdd8
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.d.ts.map
@@ -0,0 +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,WAAW,EACX,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAE1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,4CAA4C,EAAE,MAAM,6CAA6C,CAAC;AAoBhH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9F;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE;IACP,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,GA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mCAAmC,CAAC,EAAE,OAAO,CAAC;CAC/C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.js b/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.js
new file mode 100644
index 0000000000000000000000000000000000000000..c43811509bae5d7d608f210227ce1507ed296d61
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.js
@@ -0,0 +1,213 @@
+import { decodeAttestationObject, } from '../helpers/decodeAttestationObject.js';
+import { decodeClientDataJSON } from '../helpers/decodeClientDataJSON.js';
+import { parseAuthenticatorData } from '../helpers/parseAuthenticatorData.js';
+import { toHash } from '../helpers/toHash.js';
+import { decodeCredentialPublicKey } from '../helpers/decodeCredentialPublicKey.js';
+import { COSEKEYS } from '../helpers/cose.js';
+import { convertAAGUIDToString } from '../helpers/convertAAGUIDToString.js';
+import { parseBackupFlags } from '../helpers/parseBackupFlags.js';
+import { matchExpectedRPID } from '../helpers/matchExpectedRPID.js';
+import { isoBase64URL } from '../helpers/iso/index.js';
+import { SettingsService } from '../services/settingsService.js';
+import { supportedCOSEAlgorithmIdentifiers } from './generateRegistrationOptions.js';
+import { verifyAttestationFIDOU2F } from './verifications/verifyAttestationFIDOU2F.js';
+import { verifyAttestationPacked } from './verifications/verifyAttestationPacked.js';
+import { verifyAttestationAndroidSafetyNet } from './verifications/verifyAttestationAndroidSafetyNet.js';
+import { verifyAttestationTPM } from './verifications/tpm/verifyAttestationTPM.js';
+import { verifyAttestationAndroidKey } from './verifications/verifyAttestationAndroidKey.js';
+import { verifyAttestationApple } from './verifications/verifyAttestationApple.js';
+/**
+ * Verify that the user has legitimately completed the registration process
+ *
+ * **Options:**
+ *
+ * @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`
+ * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateRegistrationOptions()`
+ * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
+ * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
+ * @param expectedType **(Optional)** - The response type expected ('webauthn.create')
+ * @param requireUserPresence **(Optional)** - Enforce user presence by the authenticator (or skip it during auto registration) Defaults to `true`
+ * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
+ * @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
+ * @param attestationSafetyNetEnforceCTSCheck **(Optional)** - Require that an Android device's system integrity has not been tampered with if it uses SafetyNet attestation. Defaults to `true`
+ */
+export async function verifyRegistrationResponse(options) {
+ const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, requireUserPresence = true, requireUserVerification = true, supportedAlgorithmIDs = supportedCOSEAlgorithmIdentifiers, attestationSafetyNetEnforceCTSCheck = true, } = options;
+ const { id, rawId, type: credentialType, response: attestationResponse } = response;
+ // Ensure credential specified an ID
+ if (!id) {
+ throw new Error('Missing credential ID');
+ }
+ // Ensure ID is base64url-encoded
+ if (id !== rawId) {
+ throw new Error('Credential ID was not base64url-encoded');
+ }
+ // Make sure credential type is public-key
+ if (credentialType !== 'public-key') {
+ throw new Error(`Unexpected credential type ${credentialType}, expected "public-key"`);
+ }
+ const clientDataJSON = decodeClientDataJSON(attestationResponse.clientDataJSON);
+ const { type, origin, challenge, tokenBinding } = clientDataJSON;
+ // Make sure we're handling an registration
+ if (Array.isArray(expectedType)) {
+ if (!expectedType.includes(type)) {
+ const joinedExpectedType = expectedType.join(', ');
+ throw new Error(`Unexpected registration response type "${type}", expected one of: ${joinedExpectedType}`);
+ }
+ }
+ else if (expectedType) {
+ if (type !== expectedType) {
+ throw new Error(`Unexpected registration response type "${type}", expected "${expectedType}"`);
+ }
+ }
+ else if (type !== 'webauthn.create') {
+ throw new Error(`Unexpected registration response type: ${type}`);
+ }
+ // Ensure the device provided the challenge we gave it
+ if (typeof expectedChallenge === 'function') {
+ if (!(await expectedChallenge(challenge))) {
+ throw new Error(`Custom challenge verifier returned false for registration response challenge "${challenge}"`);
+ }
+ }
+ else if (challenge !== expectedChallenge) {
+ throw new Error(`Unexpected registration response challenge "${challenge}", expected "${expectedChallenge}"`);
+ }
+ // Check that the origin is our site
+ if (Array.isArray(expectedOrigin)) {
+ if (!expectedOrigin.includes(origin)) {
+ throw new Error(`Unexpected registration response origin "${origin}", expected one of: ${expectedOrigin.join(', ')}`);
+ }
+ }
+ else {
+ if (origin !== expectedOrigin) {
+ throw new Error(`Unexpected registration response origin "${origin}", expected "${expectedOrigin}"`);
+ }
+ }
+ if (tokenBinding) {
+ if (typeof tokenBinding !== 'object') {
+ throw new Error(`Unexpected value for TokenBinding "${tokenBinding}"`);
+ }
+ if (['present', 'supported', 'not-supported'].indexOf(tokenBinding.status) < 0) {
+ throw new Error(`Unexpected tokenBinding.status value of "${tokenBinding.status}"`);
+ }
+ }
+ const attestationObject = isoBase64URL.toBuffer(attestationResponse.attestationObject);
+ const decodedAttestationObject = decodeAttestationObject(attestationObject);
+ const fmt = decodedAttestationObject.get('fmt');
+ const authData = decodedAttestationObject.get('authData');
+ const attStmt = decodedAttestationObject.get('attStmt');
+ const parsedAuthData = parseAuthenticatorData(authData);
+ const { aaguid, rpIdHash, flags, credentialID, counter, credentialPublicKey, extensionsData, } = parsedAuthData;
+ // Make sure the response's RP ID is ours
+ let matchedRPID;
+ if (expectedRPID) {
+ let expectedRPIDs = [];
+ if (typeof expectedRPID === 'string') {
+ expectedRPIDs = [expectedRPID];
+ }
+ else {
+ expectedRPIDs = expectedRPID;
+ }
+ matchedRPID = await matchExpectedRPID(rpIdHash, expectedRPIDs);
+ }
+ // Make sure someone was physically present
+ if (requireUserPresence && !flags.up) {
+ throw new Error('User presence was required, but user was not present');
+ }
+ // Enforce user verification if specified
+ if (requireUserVerification && !flags.uv) {
+ throw new Error('User verification was required, but user could not be verified');
+ }
+ if (!credentialID) {
+ throw new Error('No credential ID was provided by authenticator');
+ }
+ if (!credentialPublicKey) {
+ throw new Error('No public key was provided by authenticator');
+ }
+ if (!aaguid) {
+ throw new Error('No AAGUID was present during registration');
+ }
+ const decodedPublicKey = decodeCredentialPublicKey(credentialPublicKey);
+ const alg = decodedPublicKey.get(COSEKEYS.alg);
+ if (typeof alg !== 'number') {
+ throw new Error('Credential public key was missing numeric alg');
+ }
+ // Make sure the key algorithm is one we specified within the registration options
+ if (!supportedAlgorithmIDs.includes(alg)) {
+ const supported = supportedAlgorithmIDs.join(', ');
+ throw new Error(`Unexpected public key alg "${alg}", expected one of "${supported}"`);
+ }
+ const clientDataHash = await toHash(isoBase64URL.toBuffer(attestationResponse.clientDataJSON));
+ const rootCertificates = SettingsService.getRootCertificates({
+ identifier: fmt,
+ });
+ // Prepare arguments to pass to the relevant verification method
+ const verifierOpts = {
+ aaguid,
+ attStmt,
+ authData,
+ clientDataHash,
+ credentialID,
+ credentialPublicKey,
+ rootCertificates,
+ rpIdHash,
+ attestationSafetyNetEnforceCTSCheck,
+ };
+ /**
+ * Verification can only be performed when attestation = 'direct'
+ */
+ let verified = false;
+ if (fmt === 'fido-u2f') {
+ verified = await verifyAttestationFIDOU2F(verifierOpts);
+ }
+ else if (fmt === 'packed') {
+ verified = await verifyAttestationPacked(verifierOpts);
+ }
+ else if (fmt === 'android-safetynet') {
+ verified = await verifyAttestationAndroidSafetyNet(verifierOpts);
+ }
+ else if (fmt === 'android-key') {
+ verified = await verifyAttestationAndroidKey(verifierOpts);
+ }
+ else if (fmt === 'tpm') {
+ verified = await verifyAttestationTPM(verifierOpts);
+ }
+ else if (fmt === 'apple') {
+ verified = await verifyAttestationApple(verifierOpts);
+ }
+ else if (fmt === 'none') {
+ if (attStmt.size > 0) {
+ throw new Error('None attestation had unexpected attestation statement');
+ }
+ // This is the weaker of the attestations, so there's nothing else to really check
+ verified = true;
+ }
+ else {
+ throw new Error(`Unsupported Attestation Format: ${fmt}`);
+ }
+ if (!verified) {
+ return { verified: false };
+ }
+ const { credentialDeviceType, credentialBackedUp } = parseBackupFlags(flags);
+ return {
+ verified: true,
+ registrationInfo: {
+ fmt,
+ aaguid: convertAAGUIDToString(aaguid),
+ credentialType,
+ credential: {
+ id: isoBase64URL.fromBuffer(credentialID),
+ publicKey: credentialPublicKey,
+ counter,
+ transports: response.response.transports,
+ },
+ attestationObject,
+ userVerified: flags.uv,
+ credentialDeviceType,
+ credentialBackedUp,
+ origin: clientDataJSON.origin,
+ rpID: matchedRPID,
+ authenticatorExtensionResults: extensionsData,
+ },
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.d.ts b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d9db114c26e8f86db66c7daf0fc86ba37cfe43fc
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.d.ts
@@ -0,0 +1,49 @@
+/**
+ * Google Hardware Attestation Root 1
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (first entry)
+ *
+ * Valid until 2026-05-24 @ 09:28 PST
+ *
+ * SHA256 Fingerprint
+ * C1:98:4A:3E:F4:5C:1E:2A:91:85:51:DE:10:60:3C:86:F7:05:1B:22:49:C4:89:1C:AE:32:30:EA:BD:0C:97:D5
+ */
+export declare const Google_Hardware_Attestation_Root_1 = "-----BEGIN CERTIFICATE-----\nMIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyWhcNMjYwNTI0MTYy\nODUyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEq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mJKHHBnETLi8GFqiEsqTWpG/6ibYCv7rY\nDBJDcR9W62BW9jfIoBQcxUCUJouMPH25lLNcDc1ssqvC2v7iUgI9LeoM1sNovqPm\nQUiG9rHli1vXxzCyaMTjwftkJLkf6724DFhuKug2jITV0QkXvaJWF4nUaHOTNA4u\nJU9WDvZLI1j83A+/xnAJUucIv/zGJ1AMH2boHqF8CY16LpsYgBt6tKxxWH00XcyD\nCdW2KlBCeqbQPcsFmWyWugxdcekhYsAWyoSf818NUsZdBWBaR/OukXrNLfkQ79Iy\nZohZbvabO/X+MVT3rriAoKc8oE2Uws6DF+60PV7/WIPjNvXySdqspImSN78mflxD\nqwLqRBYkA3I75qppLGG9rp7UCdRjxMl8ZDBld+7yvHVgt1cVzJx9xnyGCC23Uaic\nMDSXYrB4I4WHXPGjxhZuCuPBLTdOLU8YRvMYdEvYebWHMpvwGCF6bAx3JBpIeOQ1\nwDB5y0USicV3YgYGmi+NZfhA4URSh77Yd6uuJOJENRaNVTzk\n-----END CERTIFICATE-----\n";
+/**
+ * Google Hardware Attestation Root 2
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (second entry)
+ *
+ * Valid until 2034-11-18 @ 12:37 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+export declare const Google_Hardware_Attestation_Root_2 = "-----BEGIN CERTIFICATE-----\nMIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz\nNzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr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VKN2M1G2ok\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";
+/**
+ * Google Hardware Attestation Root 3
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (third entry)
+ *
+ * Valid until 2036-11-13 @ 15:10 PST
+ *
+ * SHA256 Fingerprint
+ * AB:66:41:17:8A:36:E1:79:AA:0C:1C:DD:DF:9A:16:EB:45:FA:20:94:3E:2B:8C:D7:C7:C0:5C:26:CF:8B:48:7A
+ */
+export declare const Google_Hardware_Attestation_Root_3 = "\n-----BEGIN CERTIFICATE-----\nMIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx\nMDQyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEql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O7oFedKdWlZz0YAfu3aGCJd4KHT0MsGiL\nZez9WP81xYSrKMNEsDK+zK5fVzw6jA7cxmpXcARTnmAuGUeI7VVDhDzKeVOctf3a\n0qQLwC+d0+xrETZ4r2fRGNw2YEs2W8Qj6oDcfPvq9JySe7pJ6wcHnl5EZ0lwc4xH\n7Y4Dx9RA1JlfooLMw3tOdJZH0enxPXaydfAD3YifeZpFaUzicHeLzVJLt9dvGB0b\nHQLE4+EqKFgOZv2EoP686DQqbVS1u+9k0p2xbMA105TBIk7npraa8VM0fnrRKi7w\nlZKwdH+aNAyhbXRW9xsnODJ+g8eF452zvbiKKngEKirK5LGieoXBX7tZ9D1GNBH2\nOb3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7\nmD/vFDkzF+wm7cyWpQpCVQ==\n-----END CERTIFICATE-----\n";
+/**
+ * Google Hardware Attestation Root 4
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (fourth entry)
+ *
+ * Valid until 2042-03-15 @ 11:07 PDT
+ *
+ * SHA256 Fingerprint
+ * CE:DB:1C:B6:DC:89:6A:E5:EC:79:73:48:BC:E9:28:67:53:C2:B3:8E:E7:1C:E0:FB:E3:4A:9A:12:48:80:0D:FC
+ */
+export declare const Google_Hardware_Attestation_Root_4 = "\n-----BEGIN CERTIFICATE-----\nMIIFHDCCAwSgAwIBAgIJAPHBcqaZ6vUdMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjIwMzIwMTgwNzQ4WhcNNDIwMzE1MTgw\nNzQ4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jl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luKG\n1nv8NQdxei2DIIhASWfu804CA96cQKTTlaae2fweqXjdN1/v2nqOhngNyz1361mF\nmr4XmaKH/ItTwOe72NI9ZcwS1lVaCvsIkTDCEXdm9rCNPAY10iTunIHFXRh+7KPz\nlHGewCq/8TOohBRn0/NNfh7uRslOSZ/xKbN9tMBtw37Z8d2vvnXq/YWdsm1+JLVw\nn6yYD/yacNJBlwpddla8eaVMjsF6nBnIgQOf9zKSe06nSTqvgwUHosgOECZJZ1Eu\nzbH4yswbt02tKtKEFhx+v+OTge/06V+jGsqTWLsfrOCNLuA8H++z+pUENmpqnnHo\nvaI47gC+TNpkgYGkkBT6B/m/U01BuOBBTzhIlMEZq9qkDWuM2cA5kW5V3FJUcfHn\nw1IdYIg2Wxg7yHcQZemFQg==\n-----END CERTIFICATE-----\n";
+//# sourceMappingURL=android-key.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.d.ts.map b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..a4a69d156c77c3bff2387aa39e9b4b7151991f84
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.d.ts.map
@@ -0,0 +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;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,+0DA+B9C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,+0DA+B9C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.js b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.js
new file mode 100644
index 0000000000000000000000000000000000000000..0b8ae8174f509483c1da1aa83c72e3585298b4cd
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.js
@@ -0,0 +1,171 @@
+/**
+ * Google Hardware Attestation Root 1
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (first entry)
+ *
+ * Valid until 2026-05-24 @ 09:28 PST
+ *
+ * SHA256 Fingerprint
+ * C1:98:4A:3E:F4:5C:1E:2A:91:85:51:DE:10:60:3C:86:F7:05:1B:22:49:C4:89:1C:AE:32:30:EA:BD:0C:97:D5
+ */
+export const Google_Hardware_Attestation_Root_1 = `-----BEGIN CERTIFICATE-----
+MIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
+BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyWhcNMjYwNTI0MTYy
+ODUyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
+AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
+Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
+tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
+nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
+C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
+oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
+JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
+sTUVi2ghzq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CdRjxMl8ZDBld+7yvHVgt1cVzJx9xnyGCC23Uaic
+MDSXYrB4I4WHXPGjxhZuCuPBLTdOLU8YRvMYdEvYebWHMpvwGCF6bAx3JBpIeOQ1
+wDB5y0USicV3YgYGmi+NZfhA4URSh77Yd6uuJOJENRaNVTzk
+-----END CERTIFICATE-----
+`;
+/**
+ * Google Hardware Attestation Root 2
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (second entry)
+ *
+ * Valid until 2034-11-18 @ 12:37 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+export const Google_Hardware_Attestation_Root_2 = `-----BEGIN CERTIFICATE-----
+MIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
+BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz
+NzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
+AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
+Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
+tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
+nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
+C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
+oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
+JtvsBslHZvPBKCOdT0MS+tgSOI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lQgLIKw1rODG2NvU9oR3GVGdMkUB
+ZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH
+ex0SdDrx+tWUDqG8At2JHA==
+-----END CERTIFICATE-----
+`;
+/**
+ * Google Hardware Attestation Root 3
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (third entry)
+ *
+ * Valid until 2036-11-13 @ 15:10 PST
+ *
+ * SHA256 Fingerprint
+ * AB:66:41:17:8A:36:E1:79:AA:0C:1C:DD:DF:9A:16:EB:45:FA:20:94:3E:2B:8C:D7:C7:C0:5C:26:CF:8B:48:7A
+ */
+export const Google_Hardware_Attestation_Root_3 = `
+-----BEGIN CERTIFICATE-----
+MIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
+BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx
+MDQyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
+AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
+Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
+tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
+nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
+C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
+oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
+JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg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Ob3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7
+mD/vFDkzF+wm7cyWpQpCVQ==
+-----END CERTIFICATE-----
+`;
+/**
+ * Google Hardware Attestation Root 4
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (fourth entry)
+ *
+ * Valid until 2042-03-15 @ 11:07 PDT
+ *
+ * SHA256 Fingerprint
+ * CE:DB:1C:B6:DC:89:6A:E5:EC:79:73:48:BC:E9:28:67:53:C2:B3:8E:E7:1C:E0:FB:E3:4A:9A:12:48:80:0D:FC
+ */
+export const Google_Hardware_Attestation_Root_4 = `
+-----BEGIN CERTIFICATE-----
+MIIFHDCCAwSgAwIBAgIJAPHBcqaZ6vUdMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
+BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjIwMzIwMTgwNzQ4WhcNNDIwMzE1MTgw
+NzQ4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
+AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
+Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
+tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
+nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
+C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
+oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
+JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
+sTUVi2ghzq8wm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lMEZq9qkDWuM2cA5kW5V3FJUcfHn
+w1IdYIg2Wxg7yHcQZemFQg==
+-----END CERTIFICATE-----
+`;
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.d.ts b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..31d655d6569f9ecebda6ddf832249403d202c29b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.d.ts
@@ -0,0 +1,12 @@
+/**
+ * GlobalSign Root CA
+ *
+ * Downloaded from https://pki.goog/roots.pem
+ *
+ * Valid until 2028-01-28 @ 04:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+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";
+//# sourceMappingURL=android-safetynet.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.d.ts.map b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..ec9a1f1ad823af2b53d6443e4a9358e4d3067b74
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.d.ts.map
@@ -0,0 +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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.js b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.js
new file mode 100644
index 0000000000000000000000000000000000000000..f4fb1336f1a076b7176da691da6b7b0869ab543c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.js
@@ -0,0 +1,32 @@
+/**
+ * GlobalSign Root CA
+ *
+ * Downloaded from https://pki.goog/roots.pem
+ *
+ * Valid until 2028-01-28 @ 04:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+export const GlobalSign_Root_CA = `-----BEGIN CERTIFICATE-----
+MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
+A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
+b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
+MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
+YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
+aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
+jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
+xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
+1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
+snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
+U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
+9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
+BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
+AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
+yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
+38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
+AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
+DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
+HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
+-----END CERTIFICATE-----
+`;
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.d.ts b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2af589db3ea3ca8ffafb71453be41b733ab41a71
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.d.ts
@@ -0,0 +1,12 @@
+/**
+ * Apple WebAuthn Root CA
+ *
+ * Downloaded from https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem
+ *
+ * Valid until 2045-03-14 @ 17:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+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";
+//# sourceMappingURL=apple.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.d.ts.map b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..70a1279a4a3d465115f5349db833a4fa798fe687
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"apple.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/apple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,6xBAclC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.js b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.js
new file mode 100644
index 0000000000000000000000000000000000000000..b2644c2437a29ae28f8041557f941b2313641524
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.js
@@ -0,0 +1,25 @@
+/**
+ * Apple WebAuthn Root CA
+ *
+ * Downloaded from https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem
+ *
+ * Valid until 2045-03-14 @ 17:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+export const Apple_WebAuthn_Root_CA = `-----BEGIN CERTIFICATE-----
+MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w
+HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ
+bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx
+NTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG
+A1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49
+AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k
+xu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/
+pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk
+2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA
+MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3
+jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B
+1bWeT0vT
+-----END CERTIFICATE-----
+`;
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.d.ts b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0eee0cb36941174faf8161e12e8bf94fe5c0016b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.d.ts
@@ -0,0 +1,12 @@
+/**
+ * GlobalSign Root CA - R3
+ *
+ * Downloaded from https://valid.r3.roots.globalsign.com/
+ *
+ * Valid until 2029-03-18 @ 00:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+export declare const GlobalSign_Root_CA_R3 = "-----BEGIN CERTIFICATE-----\nMIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G\nA1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp\nZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4\nMTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG\nA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8\nRgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT\ngHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm\nKPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd\nQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ\nXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw\nDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o\nLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU\nRUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp\njjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK\n6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX\nmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs\nMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH\nWD9f\n-----END CERTIFICATE-----\n ";
+//# sourceMappingURL=mds.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.d.ts.map b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..51da1f440eca87d070b7a089883fa3de36c1a96f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mds.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/mds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,wuCAqBhC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.js b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.js
new file mode 100644
index 0000000000000000000000000000000000000000..8f1d55ad9d20468713023393241e1745dc37deb4
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.js
@@ -0,0 +1,32 @@
+/**
+ * GlobalSign Root CA - R3
+ *
+ * Downloaded from https://valid.r3.roots.globalsign.com/
+ *
+ * Valid until 2029-03-18 @ 00:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+export const GlobalSign_Root_CA_R3 = `-----BEGIN CERTIFICATE-----
+MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
+A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
+Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
+MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
+A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
+RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
+gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
+KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
+QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
+XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
+DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
+LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
+RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
+jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
+6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
+mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
+Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
+WD9f
+-----END CERTIFICATE-----
+ `;
diff --git a/node_modules/@simplewebauthn/server/esm/services/metadataService.d.ts b/node_modules/@simplewebauthn/server/esm/services/metadataService.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8a330689fd65ca2dbe759d50a8cb69baac8e5fd5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/metadataService.d.ts
@@ -0,0 +1,78 @@
+import type { MetadataStatement } from '../metadata/mdsTypes.js';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Allow MetadataService to accommodate unregistered AAGUIDs (`"permissive"`), or only allow
+ * registered AAGUIDs (`"strict"`). Currently primarily impacts how `getStatement()` operates
+ */
+export type VerificationMode = 'permissive' | 'strict';
+interface MetadataService {
+ /**
+ * Prepare the service to handle remote MDS servers and/or cache local metadata statements.
+ *
+ * **Options:**
+ *
+ * @param opts.mdsServers An array of URLs to FIDO Alliance Metadata Service
+ * (version 3.0)-compatible servers. Defaults to the official FIDO MDS server
+ * @param opts.statements An array of local metadata statements. Statements will be loaded but
+ * not refreshed
+ * @param opts.verificationMode How MetadataService will handle unregistered AAGUIDs. Defaults to
+ * `"strict"` which throws errors during registration response verification when an
+ * unregistered AAGUID is encountered. Set to `"permissive"` to allow registration by
+ * authenticators with unregistered AAGUIDs
+ */
+ initialize(opts?: {
+ mdsServers?: string[];
+ statements?: MetadataStatement[];
+ verificationMode?: VerificationMode;
+ }): Promise;
+ /**
+ * Get a metadata statement for a given AAGUID.
+ *
+ * This method will coordinate updating the cache as per the `nextUpdate` property in the initial
+ * BLOB download.
+ */
+ getStatement(aaguid: string | Uint8Array): Promise;
+}
+/**
+ * An implementation of `MetadataService` that can download and parse BLOBs, and support on-demand
+ * requesting and caching of individual metadata statements.
+ *
+ * https://fidoalliance.org/metadata/
+ */
+export declare class BaseMetadataService implements MetadataService {
+ private mdsCache;
+ private statementCache;
+ private state;
+ private verificationMode;
+ initialize(opts?: {
+ mdsServers?: string[];
+ statements?: MetadataStatement[];
+ verificationMode?: VerificationMode;
+ }): Promise;
+ getStatement(aaguid: string | Uint8Array_): Promise;
+ /**
+ * Download and process the latest BLOB from MDS
+ */
+ private downloadBlob;
+ /**
+ * Verify and process the MDS metadata blob
+ */
+ private verifyBlob;
+ /**
+ * A helper method to pause execution until the service is ready
+ */
+ private pauseUntilReady;
+ /**
+ * Report service status on change
+ */
+ private setState;
+}
+/**
+ * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
+ * download and parsing, and on-demand requesting and caching of individual metadata statements.
+ *
+ * https://fidoalliance.org/metadata/
+ */
+export declare const MetadataService: MetadataService;
+export {};
+//# sourceMappingURL=metadataService.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/metadataService.d.ts.map b/node_modules/@simplewebauthn/server/esm/services/metadataService.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..d2b8add1386e7edf59d6adf51172311486784798
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/metadataService.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"metadataService.d.ts","sourceRoot":"","sources":["../../src/services/metadataService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA4B,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAI3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAmCrD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAIvD,UAAU,eAAe;IACvB;;;;;;;;;;;;;OAaG;IACH,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;;;;;OAKG;IACH,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;IAEhD,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;IA4EV,YAAY,CAChB,MAAM,EAAE,MAAM,GAAG,WAAW,GAC3B,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IA8DzC;;OAEG;YACW,YAAY;IAU1B;;OAEG;YACW,UAAU;IA8CxB;;OAEG;IACH,OAAO,CAAC,eAAe;IAgCvB;;OAEG;IACH,OAAO,CAAC,QAAQ;CAWjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,eAA2C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/metadataService.js b/node_modules/@simplewebauthn/server/esm/services/metadataService.js
new file mode 100644
index 0000000000000000000000000000000000000000..8cb11d98573c680fa92a75c086cc8331baaa5b61
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/metadataService.js
@@ -0,0 +1,268 @@
+import { convertAAGUIDToString } from '../helpers/convertAAGUIDToString.js';
+import { verifyMDSBlob } from '../metadata/verifyMDSBlob.js';
+import { getLogger } from '../helpers/logging.js';
+import { fetch } from '../helpers/fetch.js';
+/**
+ * An instance of `CachedMDS` that will not trigger attempts to refresh the associated entry's blob
+ */
+const NonRefreshingMDS = {
+ url: '',
+ no: 0,
+ nextUpdate: new Date(0),
+};
+const defaultURLMDS = 'https://mds.fidoalliance.org/'; // v3
+var SERVICE_STATE;
+(function (SERVICE_STATE) {
+ SERVICE_STATE[SERVICE_STATE["DISABLED"] = 0] = "DISABLED";
+ SERVICE_STATE[SERVICE_STATE["REFRESHING"] = 1] = "REFRESHING";
+ SERVICE_STATE[SERVICE_STATE["READY"] = 2] = "READY";
+})(SERVICE_STATE || (SERVICE_STATE = {}));
+const log = getLogger('MetadataService');
+/**
+ * An implementation of `MetadataService` that can download and parse BLOBs, and support on-demand
+ * requesting and caching of individual metadata statements.
+ *
+ * https://fidoalliance.org/metadata/
+ */
+export class BaseMetadataService {
+ constructor() {
+ Object.defineProperty(this, "mdsCache", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: {}
+ });
+ Object.defineProperty(this, "statementCache", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: {}
+ });
+ Object.defineProperty(this, "state", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: SERVICE_STATE.DISABLED
+ });
+ Object.defineProperty(this, "verificationMode", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: 'strict'
+ });
+ }
+ async initialize(opts = {}) {
+ // Reset statement cache
+ this.statementCache = {};
+ const { mdsServers = [defaultURLMDS], statements, verificationMode } = opts;
+ this.setState(SERVICE_STATE.REFRESHING);
+ /**
+ * If metadata statements are provided, load them into the cache first. These statements will
+ * not be refreshed when a stale one is detected.
+ */
+ if (statements?.length) {
+ let statementsAdded = 0;
+ statements.forEach((statement) => {
+ // Only cache statements that are for FIDO2-compatible authenticators
+ if (statement.aaguid) {
+ this.statementCache[statement.aaguid] = {
+ entry: {
+ metadataStatement: statement,
+ statusReports: [],
+ timeOfLastStatusChange: '1970-01-01',
+ },
+ url: NonRefreshingMDS.url,
+ };
+ statementsAdded += 1;
+ }
+ });
+ log(`Cached ${statementsAdded} local statements`);
+ }
+ /**
+ * If MDS servers are provided, then download blobs from them, verify them, and then add their
+ * entries to the cache. Blobs loaded in this way will be refreshed when a stale entry within is
+ * detected.
+ */
+ if (mdsServers?.length) {
+ // Get a current count so we know how many new statements we've added from MDS servers
+ const currentCacheCount = Object.keys(this.statementCache).length;
+ let numServers = mdsServers.length;
+ for (const url of mdsServers) {
+ try {
+ const cachedMDS = {
+ url,
+ no: 0,
+ nextUpdate: new Date(0),
+ };
+ const blob = await this.downloadBlob(cachedMDS);
+ await this.verifyBlob(blob, cachedMDS);
+ }
+ catch (err) {
+ // Notify of the error and move on
+ log(`Could not download BLOB from ${url}:`, err);
+ numServers -= 1;
+ }
+ }
+ // Calculate the difference to get the total number of new statements we successfully added
+ const newCacheCount = Object.keys(this.statementCache).length;
+ const cacheDiff = newCacheCount - currentCacheCount;
+ log(`Cached ${cacheDiff} statements from ${numServers} metadata server(s)`);
+ }
+ if (verificationMode) {
+ this.verificationMode = verificationMode;
+ }
+ this.setState(SERVICE_STATE.READY);
+ }
+ async getStatement(aaguid) {
+ if (this.state === SERVICE_STATE.DISABLED) {
+ return;
+ }
+ if (!aaguid) {
+ return;
+ }
+ if (aaguid instanceof Uint8Array) {
+ aaguid = convertAAGUIDToString(aaguid);
+ }
+ // If a cache refresh is in progress then pause this until the service is ready
+ await this.pauseUntilReady();
+ // Try to grab a cached statement
+ const cachedStatement = this.statementCache[aaguid];
+ if (!cachedStatement) {
+ if (this.verificationMode === 'strict') {
+ // FIDO conformance requires RP's to only support registered AAGUID's
+ throw new Error(`No metadata statement found for aaguid "${aaguid}"`);
+ }
+ // Allow registration verification to continue without using metadata
+ return;
+ }
+ // If the statement points to an MDS API, check the MDS' nextUpdate to see if we need to refresh
+ if (cachedStatement.url) {
+ const mds = this.mdsCache[cachedStatement.url];
+ const now = new Date();
+ if (now > mds.nextUpdate) {
+ try {
+ this.setState(SERVICE_STATE.REFRESHING);
+ const blob = await this.downloadBlob(mds);
+ await this.verifyBlob(blob, mds);
+ }
+ finally {
+ this.setState(SERVICE_STATE.READY);
+ }
+ }
+ }
+ const { entry } = cachedStatement;
+ // Check to see if the this aaguid has a status report with a "compromised" status
+ for (const report of entry.statusReports) {
+ const { status } = report;
+ if (status === 'USER_VERIFICATION_BYPASS' ||
+ status === 'ATTESTATION_KEY_COMPROMISE' ||
+ status === 'USER_KEY_REMOTE_COMPROMISE' ||
+ status === 'USER_KEY_PHYSICAL_COMPROMISE') {
+ throw new Error(`Detected compromised aaguid "${aaguid}"`);
+ }
+ }
+ return entry.metadataStatement;
+ }
+ /**
+ * Download and process the latest BLOB from MDS
+ */
+ async downloadBlob(cachedMDS) {
+ const { url } = cachedMDS;
+ // Get latest "BLOB" (FIDO's terminology, not mine)
+ const resp = await fetch(url);
+ const data = await resp.text();
+ return data;
+ }
+ /**
+ * Verify and process the MDS metadata blob
+ */
+ async verifyBlob(blob, cachedMDS) {
+ const { url, no } = cachedMDS;
+ const { payload, parsedNextUpdate } = await verifyMDSBlob(blob);
+ if (payload.no <= no) {
+ // From FIDO MDS docs: "also ignore the file if its number (no) is less or equal to the
+ // number of the last BLOB cached locally."
+ throw new Error(`Latest BLOB no. ${payload.no} is not greater than previous no. ${no}`);
+ }
+ // Cache statements for FIDO2 devices
+ for (const entry of payload.entries) {
+ // Only cache entries with an `aaguid`
+ if (entry.aaguid) {
+ this.statementCache[entry.aaguid] = { entry, url };
+ }
+ }
+ if (url) {
+ // Remember info about the server so we can refresh later
+ this.mdsCache[url] = {
+ ...cachedMDS,
+ // Store the payload `no` to make sure we're getting the next BLOB in the sequence
+ no: payload.no,
+ // Remember when we need to refresh this blob
+ nextUpdate: parsedNextUpdate,
+ };
+ }
+ else {
+ /**
+ * This blob will not be refreshed, but we should still alert if the blob's `nextUpdate` is
+ * in the past
+ */
+ if (parsedNextUpdate < new Date()) {
+ // TODO (Feb 2026): It'd be more actionable for devs if a specific error was raised here,
+ // then this message was logged higher up when it can include the array index of the stale
+ // blob.
+ log(`⚠️ This MDS blob (serial: ${payload.no}) contains stale data as of ${parsedNextUpdate.toISOString()}. Please consider re-initializing MetadataService with a newer MDS blob.`);
+ }
+ }
+ }
+ /**
+ * A helper method to pause execution until the service is ready
+ */
+ pauseUntilReady() {
+ if (this.state === SERVICE_STATE.READY) {
+ return new Promise((resolve) => {
+ resolve();
+ });
+ }
+ // State isn't ready, so set up polling
+ const readyPromise = new Promise((resolve, reject) => {
+ const totalTimeoutMS = 70000;
+ const intervalMS = 100;
+ let iterations = totalTimeoutMS / intervalMS;
+ // Check service state every `intervalMS` milliseconds
+ const intervalID = globalThis.setInterval(() => {
+ if (iterations < 1) {
+ clearInterval(intervalID);
+ reject(`State did not become ready in ${totalTimeoutMS / 1000} seconds`);
+ }
+ else if (this.state === SERVICE_STATE.READY) {
+ clearInterval(intervalID);
+ resolve();
+ }
+ iterations -= 1;
+ }, intervalMS);
+ });
+ return readyPromise;
+ }
+ /**
+ * Report service status on change
+ */
+ setState(newState) {
+ this.state = newState;
+ if (newState === SERVICE_STATE.DISABLED) {
+ log('MetadataService is DISABLED');
+ }
+ else if (newState === SERVICE_STATE.REFRESHING) {
+ log('MetadataService is REFRESHING');
+ }
+ else if (newState === SERVICE_STATE.READY) {
+ log('MetadataService is READY');
+ }
+ }
+}
+/**
+ * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
+ * download and parsing, and on-demand requesting and caching of individual metadata statements.
+ *
+ * https://fidoalliance.org/metadata/
+ */
+export const MetadataService = new BaseMetadataService();
diff --git a/node_modules/@simplewebauthn/server/esm/services/settingsService.d.ts b/node_modules/@simplewebauthn/server/esm/services/settingsService.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..611592b042efff086d80bc565097253fb91b37c6
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/settingsService.d.ts
@@ -0,0 +1,39 @@
+import type { AttestationFormat } from '../helpers/decodeAttestationObject.js';
+import type { Uint8Array_ } from '../types/index.js';
+export type RootCertIdentifier = AttestationFormat | 'mds';
+interface SettingsService {
+ /**
+ * Set potential root certificates for attestation formats that use them. Root certs will be tried
+ * one-by-one when validating a certificate path.
+ *
+ * Certificates can be specified as a raw `Buffer`, or as a PEM-formatted string. If a
+ * `Buffer` is passed in it will be converted to PEM format.
+ */
+ setRootCertificates(opts: {
+ identifier: RootCertIdentifier;
+ certificates: (Uint8Array_ | string)[];
+ }): void;
+ /**
+ * Get any registered root certificates for the specified attestation format
+ */
+ getRootCertificates(opts: {
+ identifier: RootCertIdentifier;
+ }): string[];
+}
+/**
+ * A basic service for specifying acceptable root certificates for all supported attestation
+ * statement formats.
+ *
+ * In addition, default root certificates are included for the following statement formats:
+ *
+ * - `'android-key'`
+ * - `'android-safetynet'`
+ * - `'apple'`
+ * - `'android-mds'`
+ *
+ * These can be overwritten as needed by setting alternative root certificates for their format
+ * identifier using `setRootCertificates()`.
+ */
+export declare const SettingsService: SettingsService;
+export {};
+//# sourceMappingURL=settingsService.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/settingsService.d.ts.map b/node_modules/@simplewebauthn/server/esm/services/settingsService.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..432da95f601084ced18fba89858d21382fbe3ace
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/settingsService.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"settingsService.d.ts","sourceRoot":"","sources":["../../src/services/settingsService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYrD,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG,KAAK,CAAC;AAE3D,UAAU,eAAe;IACvB;;;;;;OAMG;IACH,mBAAmB,CAAC,IAAI,EAAE;QACxB,UAAU,EAAE,kBAAkB,CAAC;QAC/B,YAAY,EAAE,CAAC,WAAW,GAAG,MAAM,CAAC,EAAE,CAAC;KACxC,GAAG,IAAI,CAAC;IAET;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,kBAAkB,CAAA;KAAE,GAAG,MAAM,EAAE,CAAC;CACzE;AAkCD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,eAA2C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/services/settingsService.js b/node_modules/@simplewebauthn/server/esm/services/settingsService.js
new file mode 100644
index 0000000000000000000000000000000000000000..504b2c77f2f99e42e51587686d8f2b7b0823ffca
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/services/settingsService.js
@@ -0,0 +1,71 @@
+import { convertCertBufferToPEM } from '../helpers/convertCertBufferToPEM.js';
+import { GlobalSign_Root_CA } from './defaultRootCerts/android-safetynet.js';
+import { Google_Hardware_Attestation_Root_1, Google_Hardware_Attestation_Root_2, Google_Hardware_Attestation_Root_3, Google_Hardware_Attestation_Root_4, } from './defaultRootCerts/android-key.js';
+import { Apple_WebAuthn_Root_CA } from './defaultRootCerts/apple.js';
+import { GlobalSign_Root_CA_R3 } from './defaultRootCerts/mds.js';
+class BaseSettingsService {
+ constructor() {
+ // Certificates are stored as PEM-formatted strings
+ Object.defineProperty(this, "pemCertificates", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ this.pemCertificates = new Map();
+ }
+ setRootCertificates(opts) {
+ const { identifier, certificates } = opts;
+ const newCertificates = [];
+ for (const cert of certificates) {
+ if (cert instanceof Uint8Array) {
+ newCertificates.push(convertCertBufferToPEM(cert));
+ }
+ else {
+ newCertificates.push(cert);
+ }
+ }
+ this.pemCertificates.set(identifier, newCertificates);
+ }
+ getRootCertificates(opts) {
+ const { identifier } = opts;
+ return this.pemCertificates.get(identifier) ?? [];
+ }
+}
+/**
+ * A basic service for specifying acceptable root certificates for all supported attestation
+ * statement formats.
+ *
+ * In addition, default root certificates are included for the following statement formats:
+ *
+ * - `'android-key'`
+ * - `'android-safetynet'`
+ * - `'apple'`
+ * - `'android-mds'`
+ *
+ * These can be overwritten as needed by setting alternative root certificates for their format
+ * identifier using `setRootCertificates()`.
+ */
+export const SettingsService = new BaseSettingsService();
+// Initialize default certificates
+SettingsService.setRootCertificates({
+ identifier: 'android-key',
+ certificates: [
+ Google_Hardware_Attestation_Root_1,
+ Google_Hardware_Attestation_Root_2,
+ Google_Hardware_Attestation_Root_3,
+ Google_Hardware_Attestation_Root_4,
+ ],
+});
+SettingsService.setRootCertificates({
+ identifier: 'android-safetynet',
+ certificates: [GlobalSign_Root_CA],
+});
+SettingsService.setRootCertificates({
+ identifier: 'apple',
+ certificates: [Apple_WebAuthn_Root_CA],
+});
+SettingsService.setRootCertificates({
+ identifier: 'mds',
+ certificates: [GlobalSign_Root_CA_R3],
+});
diff --git a/node_modules/@simplewebauthn/server/esm/types/dom.d.ts b/node_modules/@simplewebauthn/server/esm/types/dom.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..29caf7fd9cb3e6a49f63845cb76c7a963244ecf7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/types/dom.d.ts
@@ -0,0 +1,329 @@
+/**
+ * DO NOT MODIFY THESE FILES!
+ *
+ * These files were copied from the **types** package. To update this file, make changes to those
+ * files instead and then run the following command from the monorepo root folder:
+ *
+ * deno task codegen:types
+ */
+/**
+ * Generated from typescript@5.6.3
+ * To regenerate, run the following command from the package root:
+ * deno task extract-dom-types
+ */
+/**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse)
+ */
+export interface AuthenticatorAssertionResponse extends AuthenticatorResponse {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData) */
+ readonly authenticatorData: ArrayBuffer;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/signature) */
+ readonly signature: ArrayBuffer;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/userHandle) */
+ readonly userHandle: ArrayBuffer | null;
+}
+/**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse)
+ */
+export interface AuthenticatorAttestationResponse extends AuthenticatorResponse {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/attestationObject) */
+ readonly attestationObject: ArrayBuffer;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getAuthenticatorData) */
+ getAuthenticatorData(): ArrayBuffer;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey) */
+ getPublicKey(): ArrayBuffer | null;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKeyAlgorithm) */
+ getPublicKeyAlgorithm(): COSEAlgorithmIdentifier;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getTransports) */
+ getTransports(): string[];
+}
+export interface AuthenticationExtensionsClientInputs {
+ appid?: string;
+ credProps?: boolean;
+ hmacCreateSecret?: boolean;
+ minPinLength?: boolean;
+}
+export interface AuthenticationExtensionsClientOutputs {
+ appid?: boolean;
+ credProps?: CredentialPropertiesOutput;
+ hmacCreateSecret?: boolean;
+}
+export interface AuthenticatorSelectionCriteria {
+ authenticatorAttachment?: AuthenticatorAttachment;
+ requireResidentKey?: boolean;
+ residentKey?: ResidentKeyRequirement;
+ userVerification?: UserVerificationRequirement;
+}
+/**
+ * Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto)
+ */
+export interface Crypto {
+ /**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
+ */
+ readonly subtle: SubtleCrypto;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
+ getRandomValues(array: T): T;
+ /**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
+ */
+ randomUUID(): `${string}-${string}-${string}-${string}-${string}`;
+}
+/**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential)
+ */
+export interface PublicKeyCredential extends Credential {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/authenticatorAttachment) */
+ readonly authenticatorAttachment: string | null;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/rawId) */
+ readonly rawId: ArrayBuffer;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/response) */
+ readonly response: AuthenticatorResponse;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/getClientExtensionResults) */
+ getClientExtensionResults(): AuthenticationExtensionsClientOutputs;
+}
+export interface PublicKeyCredentialCreationOptions {
+ attestation?: AttestationConveyancePreference;
+ authenticatorSelection?: AuthenticatorSelectionCriteria;
+ challenge: BufferSource;
+ excludeCredentials?: PublicKeyCredentialDescriptor[];
+ extensions?: AuthenticationExtensionsClientInputs;
+ pubKeyCredParams: PublicKeyCredentialParameters[];
+ rp: PublicKeyCredentialRpEntity;
+ timeout?: number;
+ user: PublicKeyCredentialUserEntity;
+}
+export interface PublicKeyCredentialDescriptor {
+ id: BufferSource;
+ transports?: AuthenticatorTransport[];
+ type: PublicKeyCredentialType;
+}
+export interface PublicKeyCredentialParameters {
+ alg: COSEAlgorithmIdentifier;
+ type: PublicKeyCredentialType;
+}
+export interface PublicKeyCredentialRequestOptions {
+ allowCredentials?: PublicKeyCredentialDescriptor[];
+ challenge: BufferSource;
+ extensions?: AuthenticationExtensionsClientInputs;
+ rpId?: string;
+ timeout?: number;
+ userVerification?: UserVerificationRequirement;
+}
+export interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity {
+ displayName: string;
+ id: BufferSource;
+}
+/**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse)
+ */
+export interface AuthenticatorResponse {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse/clientDataJSON) */
+ readonly clientDataJSON: ArrayBuffer;
+}
+export interface CredentialPropertiesOutput {
+ rk?: boolean;
+}
+/**
+ * This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
+ */
+export interface SubtleCrypto {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
+ decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
+ deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
+ deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
+ digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
+ encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
+ exportKey(format: "jwk", key: CryptoKey): Promise;
+ exportKey(format: Exclude, key: CryptoKey): Promise;
+ exportKey(format: KeyFormat, key: CryptoKey): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
+ generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise;
+ generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray): Promise;
+ generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray): Promise;
+ generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
+ importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray): Promise;
+ importKey(format: Exclude, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
+ sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, data: BufferSource): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
+ unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
+ verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
+ wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise;
+}
+/**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential)
+ */
+export interface Credential {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/id) */
+ readonly id: string;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/type) */
+ readonly type: string;
+}
+export interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity {
+ id?: string;
+}
+export interface PublicKeyCredentialEntity {
+ name: string;
+}
+export interface RsaOaepParams extends Algorithm {
+ label?: BufferSource;
+}
+export interface AesCtrParams extends Algorithm {
+ counter: BufferSource;
+ length: number;
+}
+export interface AesCbcParams extends Algorithm {
+ iv: BufferSource;
+}
+export interface AesGcmParams extends Algorithm {
+ additionalData?: BufferSource;
+ iv: BufferSource;
+ tagLength?: number;
+}
+/**
+ * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
+ */
+export interface CryptoKey {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
+ readonly algorithm: KeyAlgorithm;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
+ readonly extractable: boolean;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
+ readonly type: KeyType;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
+ readonly usages: KeyUsage[];
+}
+export interface EcdhKeyDeriveParams extends Algorithm {
+ public: CryptoKey;
+}
+export interface HkdfParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ info: BufferSource;
+ salt: BufferSource;
+}
+export interface Pbkdf2Params extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ iterations: number;
+ salt: BufferSource;
+}
+export interface AesDerivedKeyParams extends Algorithm {
+ length: number;
+}
+export interface HmacImportParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ length?: number;
+}
+export interface JsonWebKey {
+ alg?: string;
+ crv?: string;
+ d?: string;
+ dp?: string;
+ dq?: string;
+ e?: string;
+ ext?: boolean;
+ k?: string;
+ key_ops?: string[];
+ kty?: string;
+ n?: string;
+ oth?: RsaOtherPrimesInfo[];
+ p?: string;
+ q?: string;
+ qi?: string;
+ use?: string;
+ x?: string;
+ y?: string;
+}
+export interface CryptoKeyPair {
+ privateKey: CryptoKey;
+ publicKey: CryptoKey;
+}
+export interface RsaHashedKeyGenParams extends RsaKeyGenParams {
+ hash: HashAlgorithmIdentifier;
+}
+export interface EcKeyGenParams extends Algorithm {
+ namedCurve: NamedCurve;
+}
+export interface AesKeyGenParams extends Algorithm {
+ length: number;
+}
+export interface HmacKeyGenParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ length?: number;
+}
+export interface RsaHashedImportParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+}
+export interface EcKeyImportParams extends Algorithm {
+ namedCurve: NamedCurve;
+}
+export interface AesKeyAlgorithm extends KeyAlgorithm {
+ length: number;
+}
+export interface RsaPssParams extends Algorithm {
+ saltLength: number;
+}
+export interface EcdsaParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+}
+export interface Algorithm {
+ name: string;
+}
+export interface KeyAlgorithm {
+ name: string;
+}
+export interface RsaOtherPrimesInfo {
+ d?: string;
+ r?: string;
+ t?: string;
+}
+export interface RsaKeyGenParams extends Algorithm {
+ modulusLength: number;
+ publicExponent: BigInteger;
+}
+export type AttestationConveyancePreference = "direct" | "enterprise" | "indirect" | "none";
+export type AuthenticatorTransport = "ble" | "hybrid" | "internal" | "nfc" | "usb";
+export type COSEAlgorithmIdentifier = number;
+export type ResidentKeyRequirement = "discouraged" | "preferred" | "required";
+export type UserVerificationRequirement = "discouraged" | "preferred" | "required";
+export type AuthenticatorAttachment = "cross-platform" | "platform";
+export type BufferSource = ArrayBufferView | ArrayBuffer;
+export type PublicKeyCredentialType = "public-key";
+export type AlgorithmIdentifier = Algorithm | string;
+export type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
+export type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
+export type KeyType = "private" | "public" | "secret";
+export type HashAlgorithmIdentifier = AlgorithmIdentifier;
+export type NamedCurve = string;
+export type BigInteger = Uint8Array;
+//# sourceMappingURL=dom.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/types/dom.d.ts.map b/node_modules/@simplewebauthn/server/esm/types/dom.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f0be52b43bd410ad33b66057befb1636266c582f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/types/dom.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/types/dom.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH;;;;GAIG;AACH;;;;GAIG;AACH,MAAM,WAAW,8BAA+B,SAAQ,qBAAqB;IACzE,mHAAmH;IACnH,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC;IACxC,2GAA2G;IAC3G,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,4GAA4G;IAC5G,QAAQ,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;CAC3C;AAED;;;;GAIG;AACH,MAAM,WAAW,gCAAiC,SAAQ,qBAAqB;IAC3E,qHAAqH;IACrH,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC;IACxC,wHAAwH;IACxH,oBAAoB,IAAI,WAAW,CAAC;IACpC,gHAAgH;IAChH,YAAY,IAAI,WAAW,GAAG,IAAI,CAAC;IACnC,yHAAyH;IACzH,qBAAqB,IAAI,uBAAuB,CAAC;IACjD,iHAAiH;IACjH,aAAa,IAAI,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,oCAAoC;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,qC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 No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/types/dom.js b/node_modules/@simplewebauthn/server/esm/types/dom.js
new file mode 100644
index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/types/dom.js
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@simplewebauthn/server/esm/types/index.d.ts b/node_modules/@simplewebauthn/server/esm/types/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..45e05d53c956f06c4fbf2a8f639d2f2c7de52a52
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/types/index.d.ts
@@ -0,0 +1,220 @@
+/**
+ * DO NOT MODIFY THESE FILES!
+ *
+ * These files were copied from the **types** package. To update this file, make changes to those
+ * files instead and then run the following command from the monorepo root folder:
+ *
+ * deno task codegen:types
+ */
+import type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticationExtensionsClientOutputs, AuthenticatorAssertionResponse, AuthenticatorAttachment, AuthenticatorAttestationResponse, AuthenticatorSelectionCriteria, COSEAlgorithmIdentifier, PublicKeyCredential, PublicKeyCredentialCreationOptions, PublicKeyCredentialDescriptor, PublicKeyCredentialParameters, PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, UserVerificationRequirement } from './dom.js';
+export type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticationExtensionsClientOutputs, AuthenticatorAssertionResponse, AuthenticatorAttachment, AuthenticatorAttestationResponse, AuthenticatorSelectionCriteria, AuthenticatorTransport, COSEAlgorithmIdentifier, Crypto, PublicKeyCredential, PublicKeyCredentialCreationOptions, PublicKeyCredentialDescriptor, PublicKeyCredentialParameters, PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, PublicKeyCredentialUserEntity, ResidentKeyRequirement, UserVerificationRequirement, } from './dom.js';
+/**
+ * A variant of PublicKeyCredentialCreationOptions suitable for JSON transmission to the browser to
+ * (eventually) get passed into navigator.credentials.create(...) in the browser.
+ *
+ * This should eventually get replaced with official TypeScript DOM types when WebAuthn L3 types
+ * eventually make it into the language:
+ *
+ * https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptionsjson
+ */
+export interface PublicKeyCredentialCreationOptionsJSON {
+ rp: PublicKeyCredentialRpEntity;
+ user: PublicKeyCredentialUserEntityJSON;
+ challenge: Base64URLString;
+ pubKeyCredParams: PublicKeyCredentialParameters[];
+ timeout?: number;
+ excludeCredentials?: PublicKeyCredentialDescriptorJSON[];
+ authenticatorSelection?: AuthenticatorSelectionCriteria;
+ hints?: PublicKeyCredentialHint[];
+ attestation?: AttestationConveyancePreference;
+ attestationFormats?: AttestationFormat[];
+ extensions?: AuthenticationExtensionsClientInputs;
+}
+/**
+ * A variant of PublicKeyCredentialRequestOptions suitable for JSON transmission to the browser to
+ * (eventually) get passed into navigator.credentials.get(...) in the browser.
+ */
+export interface PublicKeyCredentialRequestOptionsJSON {
+ challenge: Base64URLString;
+ timeout?: number;
+ rpId?: string;
+ allowCredentials?: PublicKeyCredentialDescriptorJSON[];
+ userVerification?: UserVerificationRequirement;
+ hints?: PublicKeyCredentialHint[];
+ extensions?: AuthenticationExtensionsClientInputs;
+}
+/**
+ * https://w3c.github.io/webauthn/#dictdef-publickeycredentialdescriptorjson
+ */
+export interface PublicKeyCredentialDescriptorJSON {
+ id: Base64URLString;
+ type: PublicKeyCredentialType;
+ transports?: AuthenticatorTransportFuture[];
+}
+/**
+ * https://w3c.github.io/webauthn/#dictdef-publickeycredentialuserentityjson
+ */
+export interface PublicKeyCredentialUserEntityJSON {
+ id: string;
+ name: string;
+ displayName: string;
+}
+/**
+ * The value returned from navigator.credentials.create()
+ */
+export interface RegistrationCredential extends PublicKeyCredentialFuture {
+ response: AuthenticatorAttestationResponseFuture;
+}
+/**
+ * A slightly-modified RegistrationCredential to simplify working with ArrayBuffers that
+ * are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
+ *
+ * https://w3c.github.io/webauthn/#dictdef-registrationresponsejson
+ */
+export interface RegistrationResponseJSON {
+ id: Base64URLString;
+ rawId: Base64URLString;
+ response: AuthenticatorAttestationResponseJSON;
+ authenticatorAttachment?: AuthenticatorAttachment;
+ clientExtensionResults: AuthenticationExtensionsClientOutputs;
+ type: PublicKeyCredentialType;
+}
+/**
+ * The value returned from navigator.credentials.get()
+ */
+export interface AuthenticationCredential extends PublicKeyCredentialFuture {
+ response: AuthenticatorAssertionResponse;
+}
+/**
+ * A slightly-modified AuthenticationCredential to simplify working with ArrayBuffers that
+ * are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
+ *
+ * https://w3c.github.io/webauthn/#dictdef-authenticationresponsejson
+ */
+export interface AuthenticationResponseJSON {
+ id: Base64URLString;
+ rawId: Base64URLString;
+ response: AuthenticatorAssertionResponseJSON;
+ authenticatorAttachment?: AuthenticatorAttachment;
+ clientExtensionResults: AuthenticationExtensionsClientOutputs;
+ type: PublicKeyCredentialType;
+}
+/**
+ * A slightly-modified AuthenticatorAttestationResponse to simplify working with ArrayBuffers that
+ * are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
+ *
+ * https://w3c.github.io/webauthn/#dictdef-authenticatorattestationresponsejson
+ */
+export interface AuthenticatorAttestationResponseJSON {
+ clientDataJSON: Base64URLString;
+ attestationObject: Base64URLString;
+ authenticatorData?: Base64URLString;
+ transports?: AuthenticatorTransportFuture[];
+ publicKeyAlgorithm?: COSEAlgorithmIdentifier;
+ publicKey?: Base64URLString;
+}
+/**
+ * A slightly-modified AuthenticatorAssertionResponse to simplify working with ArrayBuffers that
+ * are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
+ *
+ * https://w3c.github.io/webauthn/#dictdef-authenticatorassertionresponsejson
+ */
+export interface AuthenticatorAssertionResponseJSON {
+ clientDataJSON: Base64URLString;
+ authenticatorData: Base64URLString;
+ signature: Base64URLString;
+ userHandle?: Base64URLString;
+}
+/**
+ * Public key credential information needed to verify authentication responses
+ */
+export type WebAuthnCredential = {
+ id: Base64URLString;
+ publicKey: Uint8Array_;
+ counter: number;
+ transports?: AuthenticatorTransportFuture[];
+};
+/**
+ * An attempt to communicate that this isn't just any string, but a Base64URL-encoded string
+ */
+export type Base64URLString = string;
+/**
+ * AuthenticatorAttestationResponse in TypeScript's DOM lib is outdated (up through v3.9.7).
+ * Maintain an augmented version here so we can implement additional properties as the WebAuthn
+ * spec evolves.
+ *
+ * See https://www.w3.org/TR/webauthn-2/#iface-authenticatorattestationresponse
+ *
+ * Properties marked optional are not supported in all browsers.
+ */
+export interface AuthenticatorAttestationResponseFuture extends AuthenticatorAttestationResponse {
+ getTransports(): AuthenticatorTransportFuture[];
+}
+/**
+ * A super class of TypeScript's `AuthenticatorTransport` that includes support for the latest
+ * transports. Should eventually be replaced by TypeScript's when TypeScript gets updated to
+ * know about it (sometime after 4.6.3)
+ */
+export type AuthenticatorTransportFuture = 'ble' | 'cable' | 'hybrid' | 'internal' | 'nfc' | 'smart-card' | 'usb';
+/**
+ * A super class of TypeScript's `PublicKeyCredentialDescriptor` that knows about the latest
+ * transports. Should eventually be replaced by TypeScript's when TypeScript gets updated to
+ * know about it (sometime after 4.6.3)
+ */
+export interface PublicKeyCredentialDescriptorFuture extends Omit {
+ transports?: AuthenticatorTransportFuture[];
+}
+/** */
+export type PublicKeyCredentialJSON = RegistrationResponseJSON | AuthenticationResponseJSON;
+/**
+ * A super class of TypeScript's `PublicKeyCredential` that knows about upcoming WebAuthn features
+ */
+export interface PublicKeyCredentialFuture extends PublicKeyCredential {
+ type: PublicKeyCredentialType;
+ isConditionalMediationAvailable?(): Promise;
+ parseCreationOptionsFromJSON?(options: PublicKeyCredentialCreationOptionsJSON): PublicKeyCredentialCreationOptions;
+ parseRequestOptionsFromJSON?(options: PublicKeyCredentialRequestOptionsJSON): PublicKeyCredentialRequestOptions;
+ toJSON?(): PublicKeyCredentialJSON;
+}
+/**
+ * The two types of credentials as defined by bit 3 ("Backup Eligibility") in authenticator data:
+ * - `"singleDevice"` credentials will never be backed up
+ * - `"multiDevice"` credentials can be backed up
+ */
+export type CredentialDeviceType = 'singleDevice' | 'multiDevice';
+/**
+ * Categories of authenticators that Relying Parties can pass along to browsers during
+ * registration. Browsers that understand these values can optimize their modal experience to
+ * start the user off in a particular registration flow:
+ *
+ * - `hybrid`: A platform authenticator on a mobile device
+ * - `security-key`: A portable FIDO2 authenticator capable of being used on multiple devices via a USB or NFC connection
+ * - `client-device`: The device that WebAuthn is being called on. Typically synonymous with platform authenticators
+ *
+ * See https://w3c.github.io/webauthn/#enumdef-publickeycredentialhint
+ *
+ * These values are less strict than `authenticatorAttachment`
+ */
+export type PublicKeyCredentialHint = 'hybrid' | 'security-key' | 'client-device';
+/**
+ * Values for an attestation object's `fmt`
+ *
+ * See https://www.iana.org/assignments/webauthn/webauthn.xhtml#webauthn-attestation-statement-format-ids
+ */
+export type AttestationFormat = 'fido-u2f' | 'packed' | 'android-safetynet' | 'android-key' | 'tpm' | 'apple' | 'none';
+/**
+ * Equivalent to `Uint8Array` before TypeScript 5.7, and `Uint8Array` in TypeScript 5.7
+ * and beyond.
+ *
+ * **Context**
+ *
+ * `Uint8Array` became a generic type in TypeScript 5.7, requiring types defined simply as
+ * `Uint8Array` to be refactored to `Uint8Array` starting in Deno 2.2. `Uint8Array` is
+ * _not_ generic in Deno 2.1.x and earlier, though, so this type helps bridge this gap.
+ *
+ * Inspired by Deno's std library:
+ *
+ * https://github.com/denoland/std/blob/b5a5fe4f96b91c1fe8dba5cc0270092dd11d3287/bytes/_types.ts#L11
+ */
+export type Uint8Array_ = ReturnType;
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/types/index.d.ts.map b/node_modules/@simplewebauthn/server/esm/types/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..bbe447a9050b6fc3438f5af9c2b6d1ffa63689a1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/types/index.d.ts.map
@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EAAE,uBAAuB,CAAC;IAE9B,+BAA+B,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAErD,4BAA4B,CAAC,CAC3B,OAAO,EAAE,sCAAsC,GAC9C,kCAAkC,CAAC;IAEtC,2BAA2B,CAAC,CAC1B,OAAO,EAAE,qCAAqC,GAC7C,iCAAiC,CAAC;IAErC,MAAM,CAAC,IAAI,uBAAuB,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,aAAa,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,cAAc,GAAG,eAAe,CAAC;AAElF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,QAAQ,GACR,mBAAmB,GACnB,aAAa,GACb,KAAK,GACL,OAAO,GACP,MAAM,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/esm/types/index.js b/node_modules/@simplewebauthn/server/esm/types/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/esm/types/index.js
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@simplewebauthn/server/package.json b/node_modules/@simplewebauthn/server/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..4ab1a300dd23199aeae71f2cc17b17b06426c8b1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/package.json
@@ -0,0 +1,65 @@
+{
+ "name": "@simplewebauthn/server",
+ "version": "13.3.1",
+ "description": "SimpleWebAuthn for Servers",
+ "keywords": [
+ "typescript",
+ "webauthn",
+ "passkeys",
+ "fido",
+ "node"
+ ],
+ "author": "Matthew Miller ",
+ "homepage": "https://github.com/MasterKale/SimpleWebAuthn/tree/master/packages/server#readme",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/MasterKale/SimpleWebAuthn.git",
+ "directory": "packages/server"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/MasterKale/SimpleWebAuthn/issues"
+ },
+ "main": "./script/index.js",
+ "module": "./esm/index.js",
+ "exports": {
+ ".": {
+ "import": "./esm/index.js",
+ "require": "./script/index.js"
+ },
+ "./helpers": {
+ "import": "./esm/helpers/index.js",
+ "require": "./script/helpers/index.js"
+ }
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "typesVersions": {
+ "*": {
+ ".": [
+ "esm/index.d.ts"
+ ],
+ "helpers": [
+ "esm/helpers/index.d.ts"
+ ]
+ }
+ },
+ "dependencies": {
+ "@hexagon/base64": "^1.1.27",
+ "@levischuck/tiny-cbor": "^0.2.2",
+ "@peculiar/asn1-android": "^2.6.0",
+ "@peculiar/asn1-ecc": "^2.6.1",
+ "@peculiar/asn1-rsa": "^2.6.1",
+ "@peculiar/asn1-schema": "^2.6.0",
+ "@peculiar/asn1-x509": "^2.6.1",
+ "@peculiar/x509": "^1.14.3"
+ },
+ "devDependencies": {
+ "@types/node": "^20.9.0"
+ },
+ "_generatedBy": "dnt@dev"
+}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/authentication/generateAuthenticationOptions.d.ts b/node_modules/@simplewebauthn/server/script/authentication/generateAuthenticationOptions.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..169709bb3591161d1383466fb56ed8ff537930fc
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/authentication/generateAuthenticationOptions.d.ts
@@ -0,0 +1,26 @@
+import type { AuthenticationExtensionsClientInputs, AuthenticatorTransportFuture, Base64URLString, PublicKeyCredentialRequestOptionsJSON, Uint8Array_ } from '../types/index.js';
+export type GenerateAuthenticationOptionsOpts = Parameters[0];
+/**
+ * Prepare a value to pass into navigator.credentials.get(...) for authenticator authentication
+ *
+ * **Options:**
+ *
+ * @param rpID - Valid domain name (after `https://`)
+ * @param allowCredentials **(Optional)** - Authenticators previously registered by the user, if any. If undefined the client will ask the user which credential they want to use
+ * @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back user for authentication. Defaults to generating a random value
+ * @param timeout **(Optional)** - How long (in ms) the user can take to complete authentication. Defaults to `60000`
+ * @param userVerification **(Optional)** - Set to `'discouraged'` when asserting as part of a 2FA flow, otherwise set to `'preferred'` or `'required'` as desired. Defaults to `"preferred"`
+ * @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during authentication
+ */
+export declare function generateAuthenticationOptions(options: {
+ rpID: string;
+ allowCredentials?: {
+ id: Base64URLString;
+ transports?: AuthenticatorTransportFuture[];
+ }[];
+ challenge?: string | Uint8Array_;
+ timeout?: number;
+ userVerification?: 'required' | 'preferred' | 'discouraged';
+ extensions?: AuthenticationExtensionsClientInputs;
+}): Promise;
+//# sourceMappingURL=generateAuthenticationOptions.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/authentication/generateAuthenticationOptions.d.ts.map b/node_modules/@simplewebauthn/server/script/authentication/generateAuthenticationOptions.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..5dd96c4f8c41a6d235ffd4f1dca83c40d03ec3cc
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/authentication/generateAuthenticationOptions.d.ts.map
@@ -0,0 +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,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAI3B,MAAM,MAAM,iCAAiC,GAAG,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpG;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE;IACP,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,WAAW,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;IAC5D,UAAU,CAAC,EAAE,oCAAoC,CAAC;CACnD,GACA,OAAO,CAAC,qCAAqC,CAAC,CAoChD"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/authentication/generateAuthenticationOptions.js b/node_modules/@simplewebauthn/server/script/authentication/generateAuthenticationOptions.js
new file mode 100644
index 0000000000000000000000000000000000000000..002cdd2f2626a87087bf6818c390f53001bad966
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/authentication/generateAuthenticationOptions.js
@@ -0,0 +1,44 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.generateAuthenticationOptions = generateAuthenticationOptions;
+const index_js_1 = require("../helpers/iso/index.js");
+const generateChallenge_js_1 = require("../helpers/generateChallenge.js");
+/**
+ * Prepare a value to pass into navigator.credentials.get(...) for authenticator authentication
+ *
+ * **Options:**
+ *
+ * @param rpID - Valid domain name (after `https://`)
+ * @param allowCredentials **(Optional)** - Authenticators previously registered by the user, if any. If undefined the client will ask the user which credential they want to use
+ * @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back user for authentication. Defaults to generating a random value
+ * @param timeout **(Optional)** - How long (in ms) the user can take to complete authentication. Defaults to `60000`
+ * @param userVerification **(Optional)** - Set to `'discouraged'` when asserting as part of a 2FA flow, otherwise set to `'preferred'` or `'required'` as desired. Defaults to `"preferred"`
+ * @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during authentication
+ */
+async function generateAuthenticationOptions(options) {
+ const { allowCredentials, challenge = await (0, generateChallenge_js_1.generateChallenge)(), timeout = 60000, userVerification = 'preferred', extensions, rpID, } = options;
+ /**
+ * Preserve ability to specify `string` values for challenges
+ */
+ let _challenge = challenge;
+ if (typeof _challenge === 'string') {
+ _challenge = index_js_1.isoUint8Array.fromUTF8String(_challenge);
+ }
+ return {
+ rpId: rpID,
+ challenge: index_js_1.isoBase64URL.fromBuffer(_challenge),
+ allowCredentials: allowCredentials?.map((cred) => {
+ if (!index_js_1.isoBase64URL.isBase64URL(cred.id)) {
+ throw new Error(`allowCredential id "${cred.id}" is not a valid base64url string`);
+ }
+ return {
+ ...cred,
+ id: index_js_1.isoBase64URL.trimPadding(cred.id),
+ type: 'public-key',
+ };
+ }),
+ timeout,
+ userVerification,
+ extensions,
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/script/authentication/verifyAuthenticationResponse.d.ts b/node_modules/@simplewebauthn/server/script/authentication/verifyAuthenticationResponse.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..71565af91a0d75b4d5aab5f66ae3c0461826187a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/authentication/verifyAuthenticationResponse.d.ts
@@ -0,0 +1,67 @@
+import type { AuthenticationResponseJSON, Base64URLString, CredentialDeviceType, UserVerificationRequirement, WebAuthnCredential } from '../types/index.js';
+import type { AuthenticationExtensionsAuthenticatorOutputs } from '../helpers/decodeAuthenticatorExtensions.js';
+/**
+ * Configurable options when calling `verifyAuthenticationResponse()`
+ */
+export type VerifyAuthenticationResponseOpts = Parameters[0];
+/**
+ * Verify that the user has legitimately completed the authentication process
+ *
+ * **Options:**
+ *
+ * @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`
+ * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateAuthenticationOptions()`
+ * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
+ * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
+ * @param credential - An internal {@link WebAuthnCredential} corresponding to `id` in the authentication response
+ * @param expectedType **(Optional)** - The response type expected ('webauthn.get')
+ * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
+ * @param advancedFIDOConfig **(Optional)** - Options for satisfying more stringent FIDO RP feature requirements
+ * @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"`
+ */
+export declare function verifyAuthenticationResponse(options: {
+ response: AuthenticationResponseJSON;
+ expectedChallenge: string | ((challenge: string) => boolean | Promise);
+ expectedOrigin: string | string[];
+ expectedRPID: string | string[];
+ credential: WebAuthnCredential;
+ expectedType?: string | string[];
+ requireUserVerification?: boolean;
+ advancedFIDOConfig?: {
+ userVerification?: UserVerificationRequirement;
+ };
+}): Promise;
+/**
+ * Result of authentication verification
+ *
+ * @param verified If the authentication response could be verified
+ * @param authenticationInfo.credentialID The ID of the authenticator used during authentication.
+ * Should be used to identify which DB authenticator entry needs its `counter` updated to the value
+ * below
+ * @param authenticationInfo.newCounter The number of times the authenticator identified above
+ * reported it has been used. **Should be kept in a DB for later reference to help prevent replay
+ * attacks!**
+ * @param authenticationInfo.credentialDeviceType Whether this is a single-device or multi-device
+ * credential. **Should be kept in a DB for later reference!**
+ * @param authenticationInfo.credentialBackedUp Whether or not the multi-device credential has been
+ * backed up. Always `false` for single-device credentials. **Should be kept in a DB for later
+ * reference!**
+ * @param authenticationInfo.origin The origin of the website that the authentication occurred on
+ * @param authenticationInfo.rpID The RP ID that the authentication occurred on
+ * @param authenticationInfo?.authenticatorExtensionResults The authenticator extensions returned
+ * by the browser
+ */
+export type VerifiedAuthenticationResponse = {
+ verified: boolean;
+ authenticationInfo: {
+ credentialID: Base64URLString;
+ newCounter: number;
+ userVerified: boolean;
+ credentialDeviceType: CredentialDeviceType;
+ credentialBackedUp: boolean;
+ origin: string;
+ rpID: string;
+ authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs;
+ };
+};
+//# sourceMappingURL=verifyAuthenticationResponse.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/authentication/verifyAuthenticationResponse.d.ts.map b/node_modules/@simplewebauthn/server/script/authentication/verifyAuthenticationResponse.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..29504d8454039dd34d6c2f0f716b12acf4397279
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/authentication/verifyAuthenticationResponse.d.ts.map
@@ -0,0 +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,mBAAmB,CAAC;AAM3B,OAAO,KAAK,EAAE,4CAA4C,EAAE,MAAM,6CAA6C,CAAC;AAIhH;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC;AAElG;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE;IACP,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,GACA,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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/authentication/verifyAuthenticationResponse.js b/node_modules/@simplewebauthn/server/script/authentication/verifyAuthenticationResponse.js
new file mode 100644
index 0000000000000000000000000000000000000000..90963558e8e87c2014e98d6c3cd08959610d67b9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/authentication/verifyAuthenticationResponse.js
@@ -0,0 +1,174 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyAuthenticationResponse = verifyAuthenticationResponse;
+const decodeClientDataJSON_js_1 = require("../helpers/decodeClientDataJSON.js");
+const toHash_js_1 = require("../helpers/toHash.js");
+const verifySignature_js_1 = require("../helpers/verifySignature.js");
+const parseAuthenticatorData_js_1 = require("../helpers/parseAuthenticatorData.js");
+const parseBackupFlags_js_1 = require("../helpers/parseBackupFlags.js");
+const matchExpectedRPID_js_1 = require("../helpers/matchExpectedRPID.js");
+const index_js_1 = require("../helpers/iso/index.js");
+/**
+ * Verify that the user has legitimately completed the authentication process
+ *
+ * **Options:**
+ *
+ * @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`
+ * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateAuthenticationOptions()`
+ * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
+ * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
+ * @param credential - An internal {@link WebAuthnCredential} corresponding to `id` in the authentication response
+ * @param expectedType **(Optional)** - The response type expected ('webauthn.get')
+ * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
+ * @param advancedFIDOConfig **(Optional)** - Options for satisfying more stringent FIDO RP feature requirements
+ * @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"`
+ */
+async function verifyAuthenticationResponse(options) {
+ const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, credential, requireUserVerification = true, advancedFIDOConfig, } = options;
+ const { id, rawId, type: credentialType, response: assertionResponse } = response;
+ // Ensure credential specified an ID
+ if (!id) {
+ throw new Error('Missing credential ID');
+ }
+ // Ensure ID is base64url-encoded
+ if (id !== rawId) {
+ throw new Error('Credential ID was not base64url-encoded');
+ }
+ // Make sure credential type is public-key
+ if (credentialType !== 'public-key') {
+ throw new Error(`Unexpected credential type ${credentialType}, expected "public-key"`);
+ }
+ if (!response) {
+ throw new Error('Credential missing response');
+ }
+ if (typeof assertionResponse?.clientDataJSON !== 'string') {
+ throw new Error('Credential response clientDataJSON was not a string');
+ }
+ const clientDataJSON = (0, decodeClientDataJSON_js_1.decodeClientDataJSON)(assertionResponse.clientDataJSON);
+ const { type, origin, challenge, tokenBinding } = clientDataJSON;
+ // Make sure we're handling an authentication
+ if (Array.isArray(expectedType)) {
+ if (!expectedType.includes(type)) {
+ const joinedExpectedType = expectedType.join(', ');
+ throw new Error(`Unexpected authentication response type "${type}", expected one of: ${joinedExpectedType}`);
+ }
+ }
+ else if (expectedType) {
+ if (type !== expectedType) {
+ throw new Error(`Unexpected authentication response type "${type}", expected "${expectedType}"`);
+ }
+ }
+ else if (type !== 'webauthn.get') {
+ throw new Error(`Unexpected authentication response type: ${type}`);
+ }
+ // Ensure the device provided the challenge we gave it
+ if (typeof expectedChallenge === 'function') {
+ if (!(await expectedChallenge(challenge))) {
+ throw new Error(`Custom challenge verifier returned false for registration response challenge "${challenge}"`);
+ }
+ }
+ else if (challenge !== expectedChallenge) {
+ throw new Error(`Unexpected authentication response challenge "${challenge}", expected "${expectedChallenge}"`);
+ }
+ // Check that the origin is our site
+ if (Array.isArray(expectedOrigin)) {
+ if (!expectedOrigin.includes(origin)) {
+ const joinedExpectedOrigin = expectedOrigin.join(', ');
+ throw new Error(`Unexpected authentication response origin "${origin}", expected one of: ${joinedExpectedOrigin}`);
+ }
+ }
+ else {
+ if (origin !== expectedOrigin) {
+ throw new Error(`Unexpected authentication response origin "${origin}", expected "${expectedOrigin}"`);
+ }
+ }
+ if (!index_js_1.isoBase64URL.isBase64URL(assertionResponse.authenticatorData)) {
+ throw new Error('Credential response authenticatorData was not a base64url string');
+ }
+ if (!index_js_1.isoBase64URL.isBase64URL(assertionResponse.signature)) {
+ throw new Error('Credential response signature was not a base64url string');
+ }
+ if (assertionResponse.userHandle &&
+ typeof assertionResponse.userHandle !== 'string') {
+ throw new Error('Credential response userHandle was not a string');
+ }
+ if (tokenBinding) {
+ if (typeof tokenBinding !== 'object') {
+ throw new Error('ClientDataJSON tokenBinding was not an object');
+ }
+ if (['present', 'supported', 'notSupported'].indexOf(tokenBinding.status) < 0) {
+ throw new Error(`Unexpected tokenBinding status ${tokenBinding.status}`);
+ }
+ }
+ const authDataBuffer = index_js_1.isoBase64URL.toBuffer(assertionResponse.authenticatorData);
+ const parsedAuthData = (0, parseAuthenticatorData_js_1.parseAuthenticatorData)(authDataBuffer);
+ const { rpIdHash, flags, counter, extensionsData } = parsedAuthData;
+ // Make sure the response's RP ID is ours
+ let expectedRPIDs = [];
+ if (typeof expectedRPID === 'string') {
+ expectedRPIDs = [expectedRPID];
+ }
+ else {
+ expectedRPIDs = expectedRPID;
+ }
+ const matchedRPID = await (0, matchExpectedRPID_js_1.matchExpectedRPID)(rpIdHash, expectedRPIDs);
+ if (advancedFIDOConfig !== undefined) {
+ const { userVerification: fidoUserVerification } = advancedFIDOConfig;
+ /**
+ * Use FIDO Conformance-defined rules for verifying UP and UV flags
+ */
+ if (fidoUserVerification === 'required') {
+ // Require `flags.uv` be true (implies `flags.up` is true)
+ if (!flags.uv) {
+ throw new Error('User verification required, but user could not be verified');
+ }
+ }
+ else if (fidoUserVerification === 'preferred' ||
+ fidoUserVerification === 'discouraged') {
+ // Ignore `flags.uv`
+ }
+ }
+ else {
+ /**
+ * Use WebAuthn spec-defined rules for verifying UP and UV flags
+ */
+ // WebAuthn only requires the user presence flag be true
+ if (!flags.up) {
+ throw new Error('User not present during authentication');
+ }
+ // Enforce user verification if required
+ if (requireUserVerification && !flags.uv) {
+ throw new Error('User verification required, but user could not be verified');
+ }
+ }
+ const clientDataHash = await (0, toHash_js_1.toHash)(index_js_1.isoBase64URL.toBuffer(assertionResponse.clientDataJSON));
+ const signatureBase = index_js_1.isoUint8Array.concat([authDataBuffer, clientDataHash]);
+ const signature = index_js_1.isoBase64URL.toBuffer(assertionResponse.signature);
+ if ((counter > 0 || credential.counter > 0) &&
+ counter <= credential.counter) {
+ // Error out when the counter in the DB is greater than or equal to the counter in the
+ // dataStruct. It's related to how the authenticator maintains the number of times its been
+ // used for this client. If this happens, then someone's somehow increased the counter
+ // on the device without going through this site
+ throw new Error(`Response counter value ${counter} was lower than expected ${credential.counter}`);
+ }
+ const { credentialDeviceType, credentialBackedUp } = (0, parseBackupFlags_js_1.parseBackupFlags)(flags);
+ const toReturn = {
+ verified: await (0, verifySignature_js_1.verifySignature)({
+ signature,
+ data: signatureBase,
+ credentialPublicKey: credential.publicKey,
+ }),
+ authenticationInfo: {
+ newCounter: counter,
+ credentialID: credential.id,
+ userVerified: flags.uv,
+ credentialDeviceType,
+ credentialBackedUp,
+ authenticatorExtensionResults: extensionsData,
+ origin: clientDataJSON.origin,
+ rpID: matchedRPID,
+ },
+ };
+ return toReturn;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertAAGUIDToString.d.ts b/node_modules/@simplewebauthn/server/script/helpers/convertAAGUIDToString.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..64f45fd20a463ad6e98aa722f20ef1042bf2d1a1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertAAGUIDToString.d.ts
@@ -0,0 +1,6 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Convert the aaguid buffer in authData into a UUID string
+ */
+export declare function convertAAGUIDToString(aaguid: Uint8Array_): string;
+//# sourceMappingURL=convertAAGUIDToString.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertAAGUIDToString.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/convertAAGUIDToString.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..38add2e808c1f7fc893b0746add24677eac20bba
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertAAGUIDToString.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"convertAAGUIDToString.d.ts","sourceRoot":"","sources":["../../src/helpers/convertAAGUIDToString.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAcjE"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertAAGUIDToString.js b/node_modules/@simplewebauthn/server/script/helpers/convertAAGUIDToString.js
new file mode 100644
index 0000000000000000000000000000000000000000..cabb3ac6e3196c9300f6719266584f61c04babed
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertAAGUIDToString.js
@@ -0,0 +1,20 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.convertAAGUIDToString = convertAAGUIDToString;
+const index_js_1 = require("./iso/index.js");
+/**
+ * Convert the aaguid buffer in authData into a UUID string
+ */
+function convertAAGUIDToString(aaguid) {
+ // Raw Hex: adce000235bcc60a648b0b25f1f05503
+ const hex = index_js_1.isoUint8Array.toHex(aaguid);
+ const segments = [
+ hex.slice(0, 8), // 8
+ hex.slice(8, 12), // 4
+ hex.slice(12, 16), // 4
+ hex.slice(16, 20), // 4
+ hex.slice(20, 32), // 8
+ ];
+ // Formatted: adce0002-35bc-c60a-648b-0b25f1f05503
+ return segments.join('-');
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertCOSEtoPKCS.d.ts b/node_modules/@simplewebauthn/server/script/helpers/convertCOSEtoPKCS.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c838350700bcf29fdf0db0a7558c75dc08f955e8
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertCOSEtoPKCS.d.ts
@@ -0,0 +1,6 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Takes COSE-encoded public key and converts it to PKCS key
+ */
+export declare function convertCOSEtoPKCS(cosePublicKey: Uint8Array_): Uint8Array_;
+//# sourceMappingURL=convertCOSEtoPKCS.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertCOSEtoPKCS.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/convertCOSEtoPKCS.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..acc72bf3f333a59750eec7e56b4e5b77140320c8
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertCOSEtoPKCS.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"convertCOSEtoPKCS.d.ts","sourceRoot":"","sources":["../../src/helpers/convertCOSEtoPKCS.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,WAAW,GAAG,WAAW,CAmBzE"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertCOSEtoPKCS.js b/node_modules/@simplewebauthn/server/script/helpers/convertCOSEtoPKCS.js
new file mode 100644
index 0000000000000000000000000000000000000000..7652951983d2469a14c3a51f4b135963a6391e00
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertCOSEtoPKCS.js
@@ -0,0 +1,24 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.convertCOSEtoPKCS = convertCOSEtoPKCS;
+const index_js_1 = require("./iso/index.js");
+const cose_js_1 = require("./cose.js");
+/**
+ * Takes COSE-encoded public key and converts it to PKCS key
+ */
+function convertCOSEtoPKCS(cosePublicKey) {
+ // This is a little sloppy, I'm using COSEPublicKeyEC2 since it could have both x and y, but when
+ // there's no y it means it's probably better typed as COSEPublicKeyOKP. I'll leave this for now
+ // and revisit it later if it ever becomes an actual problem.
+ const struct = index_js_1.isoCBOR.decodeFirst(cosePublicKey);
+ const tag = Uint8Array.from([0x04]);
+ const x = struct.get(cose_js_1.COSEKEYS.x);
+ const y = struct.get(cose_js_1.COSEKEYS.y);
+ if (!x) {
+ throw new Error('COSE public key was missing x');
+ }
+ if (y) {
+ return index_js_1.isoUint8Array.concat([tag, x, y]);
+ }
+ return index_js_1.isoUint8Array.concat([tag, x]);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertCertBufferToPEM.d.ts b/node_modules/@simplewebauthn/server/script/helpers/convertCertBufferToPEM.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..fdbcfdd5fa35f995e40c3c8be9208c96e4fa9979
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertCertBufferToPEM.d.ts
@@ -0,0 +1,6 @@
+import type { Base64URLString, Uint8Array_ } from '../types/index.js';
+/**
+ * Convert buffer to an OpenSSL-compatible PEM text format.
+ */
+export declare function convertCertBufferToPEM(certBuffer: Uint8Array_ | Base64URLString): string;
+//# sourceMappingURL=convertCertBufferToPEM.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertCertBufferToPEM.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/convertCertBufferToPEM.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f96cc65b226e7bdba283b596878b79bb6bdede3c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertCertBufferToPEM.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"convertCertBufferToPEM.d.ts","sourceRoot":"","sources":["../../src/helpers/convertCertBufferToPEM.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGtE;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,WAAW,GAAG,eAAe,GACxC,MAAM,CA4BR"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertCertBufferToPEM.js b/node_modules/@simplewebauthn/server/script/helpers/convertCertBufferToPEM.js
new file mode 100644
index 0000000000000000000000000000000000000000..55b92e14b586db973687a244dd32e28d8ba7672f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertCertBufferToPEM.js
@@ -0,0 +1,34 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.convertCertBufferToPEM = convertCertBufferToPEM;
+const index_js_1 = require("./iso/index.js");
+/**
+ * Convert buffer to an OpenSSL-compatible PEM text format.
+ */
+function convertCertBufferToPEM(certBuffer) {
+ let b64cert;
+ /**
+ * Get certBuffer to a base64 representation
+ */
+ if (typeof certBuffer === 'string') {
+ if (index_js_1.isoBase64URL.isBase64URL(certBuffer)) {
+ b64cert = index_js_1.isoBase64URL.toBase64(certBuffer);
+ }
+ else if (index_js_1.isoBase64URL.isBase64(certBuffer)) {
+ b64cert = certBuffer;
+ }
+ else {
+ throw new Error('Certificate is not a valid base64 or base64url string');
+ }
+ }
+ else {
+ b64cert = index_js_1.isoBase64URL.fromBuffer(certBuffer, 'base64');
+ }
+ let PEMKey = '';
+ for (let i = 0; i < Math.ceil(b64cert.length / 64); i += 1) {
+ const start = 64 * i;
+ PEMKey += `${b64cert.substr(start, 64)}\n`;
+ }
+ PEMKey = `-----BEGIN CERTIFICATE-----\n${PEMKey}-----END CERTIFICATE-----\n`;
+ return PEMKey;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertPEMToBytes.d.ts b/node_modules/@simplewebauthn/server/script/helpers/convertPEMToBytes.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6a301c6d9ab7dcb45a431a2b4b18b6fef4a6e0f1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertPEMToBytes.d.ts
@@ -0,0 +1,6 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Take a certificate in PEM format and convert it to bytes
+ */
+export declare function convertPEMToBytes(pem: string): Uint8Array_;
+//# sourceMappingURL=convertPEMToBytes.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertPEMToBytes.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/convertPEMToBytes.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..cadf6182be323de6ed6bb17471bb02024136a575
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertPEMToBytes.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"convertPEMToBytes.d.ts","sourceRoot":"","sources":["../../src/helpers/convertPEMToBytes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAO1D"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertPEMToBytes.js b/node_modules/@simplewebauthn/server/script/helpers/convertPEMToBytes.js
new file mode 100644
index 0000000000000000000000000000000000000000..f077bf0c640d4e276873c47ba371e6425b6c4b70
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertPEMToBytes.js
@@ -0,0 +1,14 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.convertPEMToBytes = convertPEMToBytes;
+const index_js_1 = require("./iso/index.js");
+/**
+ * Take a certificate in PEM format and convert it to bytes
+ */
+function convertPEMToBytes(pem) {
+ const certBase64 = pem
+ .replace('-----BEGIN CERTIFICATE-----', '')
+ .replace('-----END CERTIFICATE-----', '')
+ .replace(/[\n ]/g, '');
+ return index_js_1.isoBase64URL.toBuffer(certBase64, 'base64');
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertX509PublicKeyToCOSE.d.ts b/node_modules/@simplewebauthn/server/script/helpers/convertX509PublicKeyToCOSE.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d7c18ef85b08f2854a7afe365572555fb63a65af
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertX509PublicKeyToCOSE.d.ts
@@ -0,0 +1,4 @@
+import { COSEPublicKey } from './cose.js';
+import type { Uint8Array_ } from '../types/index.js';
+export declare function convertX509PublicKeyToCOSE(x509Certificate: Uint8Array_): COSEPublicKey;
+//# sourceMappingURL=convertX509PublicKeyToCOSE.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertX509PublicKeyToCOSE.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/convertX509PublicKeyToCOSE.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..2ae83908e43942b2f6370afb5baff3b4cbb26edf
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertX509PublicKeyToCOSE.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"convertX509PublicKeyToCOSE.d.ts","sourceRoot":"","sources":["../../src/helpers/convertX509PublicKeyToCOSE.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,aAAa,EAGd,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,WAAW,GAC3B,aAAa,CA+Ff"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/convertX509PublicKeyToCOSE.js b/node_modules/@simplewebauthn/server/script/helpers/convertX509PublicKeyToCOSE.js
new file mode 100644
index 0000000000000000000000000000000000000000..1bc938a8c9d6f2001770521e795d6cc514da2869
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/convertX509PublicKeyToCOSE.js
@@ -0,0 +1,76 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.convertX509PublicKeyToCOSE = convertX509PublicKeyToCOSE;
+const asn1_schema_1 = require("@peculiar/asn1-schema");
+const asn1_x509_1 = require("@peculiar/asn1-x509");
+const asn1_ecc_1 = require("@peculiar/asn1-ecc");
+const asn1_rsa_1 = require("@peculiar/asn1-rsa");
+const cose_js_1 = require("./cose.js");
+const mapX509SignatureAlgToCOSEAlg_js_1 = require("./mapX509SignatureAlgToCOSEAlg.js");
+function convertX509PublicKeyToCOSE(x509Certificate) {
+ let cosePublicKey = new Map();
+ /**
+ * Time to extract the public key from an X.509 certificate
+ */
+ const x509 = asn1_schema_1.AsnParser.parse(x509Certificate, asn1_x509_1.Certificate);
+ const { tbsCertificate } = x509;
+ const { subjectPublicKeyInfo, signature: _tbsSignature } = tbsCertificate;
+ const signatureAlgorithm = _tbsSignature.algorithm;
+ const publicKeyAlgorithmID = subjectPublicKeyInfo.algorithm.algorithm;
+ if (publicKeyAlgorithmID === asn1_ecc_1.id_ecPublicKey) {
+ /**
+ * EC2 Public Key
+ */
+ if (!subjectPublicKeyInfo.algorithm.parameters) {
+ throw new Error('Certificate public key was missing parameters (EC2)');
+ }
+ const ecParameters = asn1_schema_1.AsnParser.parse(new Uint8Array(subjectPublicKeyInfo.algorithm.parameters), asn1_ecc_1.ECParameters);
+ let crv = -999;
+ const { namedCurve } = ecParameters;
+ if (namedCurve === asn1_ecc_1.id_secp256r1) {
+ crv = cose_js_1.COSECRV.P256;
+ }
+ else if (namedCurve === asn1_ecc_1.id_secp384r1) {
+ crv = cose_js_1.COSECRV.P384;
+ }
+ else {
+ throw new Error(`Certificate public key contained unexpected namedCurve ${namedCurve} (EC2)`);
+ }
+ const subjectPublicKey = new Uint8Array(subjectPublicKeyInfo.subjectPublicKey);
+ let x;
+ let y;
+ if (subjectPublicKey[0] === 0x04) {
+ // Public key is in "uncompressed form", so we can split the remaining bytes in half
+ let pointer = 1;
+ const halfLength = (subjectPublicKey.length - 1) / 2;
+ x = subjectPublicKey.slice(pointer, pointer += halfLength);
+ y = subjectPublicKey.slice(pointer);
+ }
+ else {
+ throw new Error('TODO: Figure out how to handle public keys in "compressed form"');
+ }
+ const coseEC2PubKey = new Map();
+ coseEC2PubKey.set(cose_js_1.COSEKEYS.kty, cose_js_1.COSEKTY.EC2);
+ coseEC2PubKey.set(cose_js_1.COSEKEYS.alg, (0, mapX509SignatureAlgToCOSEAlg_js_1.mapX509SignatureAlgToCOSEAlg)(signatureAlgorithm));
+ coseEC2PubKey.set(cose_js_1.COSEKEYS.crv, crv);
+ coseEC2PubKey.set(cose_js_1.COSEKEYS.x, x);
+ coseEC2PubKey.set(cose_js_1.COSEKEYS.y, y);
+ cosePublicKey = coseEC2PubKey;
+ }
+ else if (publicKeyAlgorithmID === asn1_rsa_1.id_rsaEncryption) {
+ /**
+ * RSA public key
+ */
+ const rsaPublicKey = asn1_schema_1.AsnParser.parse(subjectPublicKeyInfo.subjectPublicKey, asn1_rsa_1.RSAPublicKey);
+ const coseRSAPubKey = new Map();
+ coseRSAPubKey.set(cose_js_1.COSEKEYS.kty, cose_js_1.COSEKTY.RSA);
+ coseRSAPubKey.set(cose_js_1.COSEKEYS.alg, (0, mapX509SignatureAlgToCOSEAlg_js_1.mapX509SignatureAlgToCOSEAlg)(signatureAlgorithm));
+ coseRSAPubKey.set(cose_js_1.COSEKEYS.n, new Uint8Array(rsaPublicKey.modulus));
+ coseRSAPubKey.set(cose_js_1.COSEKEYS.e, new Uint8Array(rsaPublicKey.publicExponent));
+ cosePublicKey = coseRSAPubKey;
+ }
+ else {
+ throw new Error(`Certificate public key contained unexpected algorithm ID ${publicKeyAlgorithmID}`);
+ }
+ return cosePublicKey;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/cose.d.ts b/node_modules/@simplewebauthn/server/script/helpers/cose.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..58429bb5a1eda35bcf980c0295c0f34be4ce00a2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/cose.d.ts
@@ -0,0 +1,122 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Fundamental values that are needed to discern the more specific COSE public key types below.
+ *
+ * The use of `Maps` here is due to CBOR encoding being used with public keys, and the CBOR "Map"
+ * type is being decoded to JavaScript's `Map` type instead of, say, a basic Object as us JS
+ * developers might prefer.
+ *
+ * These types are an unorthodox way of saying "these Maps should involve these discrete lists of
+ * keys", but it works.
+ * @module
+ */
+/**
+ * COSE public key common values
+ */
+export type COSEPublicKey = {
+ get(key: COSEKEYS.kty): COSEKTY | undefined;
+ get(key: COSEKEYS.alg): COSEALG | undefined;
+ set(key: COSEKEYS.kty, value: COSEKTY): void;
+ set(key: COSEKEYS.alg, value: COSEALG): void;
+};
+/**
+ * Values specific to Octet Key Pair public keys
+ */
+export type COSEPublicKeyOKP = COSEPublicKey & {
+ get(key: COSEKEYS.crv): number | undefined;
+ get(key: COSEKEYS.x): Uint8Array_ | undefined;
+ set(key: COSEKEYS.crv, value: number): void;
+ set(key: COSEKEYS.x, value: Uint8Array_): void;
+};
+/**
+ * Values specific to Elliptic Curve Cryptography public keys
+ */
+export type COSEPublicKeyEC2 = COSEPublicKey & {
+ get(key: COSEKEYS.crv): number | undefined;
+ get(key: COSEKEYS.x): Uint8Array_ | undefined;
+ get(key: COSEKEYS.y): Uint8Array_ | undefined;
+ set(key: COSEKEYS.crv, value: number): void;
+ set(key: COSEKEYS.x, value: Uint8Array_): void;
+ set(key: COSEKEYS.y, value: Uint8Array_): void;
+};
+/**
+ * Values specific to RSA public keys
+ */
+export type COSEPublicKeyRSA = COSEPublicKey & {
+ get(key: COSEKEYS.n): Uint8Array_ | undefined;
+ get(key: COSEKEYS.e): Uint8Array_ | undefined;
+ set(key: COSEKEYS.n, value: Uint8Array_): void;
+ set(key: COSEKEYS.e, value: Uint8Array_): void;
+};
+/**
+ * A type guard for determining if a COSE public key is an OKP key pair
+ */
+export declare function isCOSEPublicKeyOKP(cosePublicKey: COSEPublicKey): cosePublicKey is COSEPublicKeyOKP;
+/**
+ * A type guard for determining if a COSE public key is an EC2 key pair
+ */
+export declare function isCOSEPublicKeyEC2(cosePublicKey: COSEPublicKey): cosePublicKey is COSEPublicKeyEC2;
+/**
+ * A type guard for determining if a COSE public key is an RSA key pair
+ */
+export declare function isCOSEPublicKeyRSA(cosePublicKey: COSEPublicKey): cosePublicKey is COSEPublicKeyRSA;
+/**
+ * COSE Keys
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-common-parameters
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters
+ */
+export declare enum COSEKEYS {
+ kty = 1,
+ alg = 3,
+ crv = -1,
+ x = -2,
+ y = -3,
+ n = -1,
+ e = -2
+}
+/**
+ * COSE Key Types
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-type
+ */
+export declare enum COSEKTY {
+ OKP = 1,
+ EC2 = 2,
+ RSA = 3
+}
+export declare function isCOSEKty(kty: number | undefined): kty is COSEKTY;
+/**
+ * COSE Curves
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves
+ */
+export declare enum COSECRV {
+ P256 = 1,
+ P384 = 2,
+ P521 = 3,
+ ED25519 = 6,
+ SECP256K1 = 8
+}
+export declare function isCOSECrv(crv: number | undefined): crv is COSECRV;
+/**
+ * COSE Algorithms
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#algorithms
+ */
+export declare enum COSEALG {
+ ES256 = -7,
+ EdDSA = -8,
+ ES384 = -35,
+ ES512 = -36,
+ PS256 = -37,
+ PS384 = -38,
+ PS512 = -39,
+ ES256K = -47,
+ RS256 = -257,
+ RS384 = -258,
+ RS512 = -259,
+ RS1 = -65535
+}
+export declare function isCOSEAlg(alg: number | undefined): alg is COSEALG;
+//# sourceMappingURL=cose.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/cose.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/cose.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..c9724c743e1e423c82cd90fcf7572cd03ad2deb9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/cose.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"cose.d.ts","sourceRoot":"","sources":["../../src/helpers/cose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAE1B,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,GAAG,OAAO,GAAG,SAAS,CAAC;IAC5C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,GAAG,OAAO,GAAG,SAAS,CAAC;IAE5C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAE7C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,GAAG,WAAW,GAAG,SAAS,CAAC;IAE9C,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,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I,gBAAgB,CAGnC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,aAAa,GAC3B,aAAa,IAAI,gBAAgB,CAGnC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,aAAa,GAC3B,aAAa,IAAI,gBAAgB,CAGnC;AAED;;;;;GAKG;AACH,oBAAY,QAAQ;IAClB,GAAG,IAAI;IACP,GAAG,IAAI;IACP,GAAG,KAAK;IACR,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;CACP;AAED;;;;GAIG;AACH,oBAAY,OAAO;IACjB,GAAG,IAAI;IACP,GAAG,IAAI;IACP,GAAG,IAAI;CACR;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,IAAI,OAAO,CAEjE;AAED;;;;GAIG;AACH,oBAAY,OAAO;IACjB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,OAAO,IAAI;IACX,SAAS,IAAI;CACd;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,IAAI,OAAO,CAEjE;AAED;;;;GAIG;AACH,oBAAY,OAAO;IACjB,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,MAAM,MAAM;IACZ,KAAK,OAAO;IACZ,KAAK,OAAO;IACZ,KAAK,OAAO;IACZ,GAAG,SAAS;CACb;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,IAAI,OAAO,CAEjE"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/cose.js b/node_modules/@simplewebauthn/server/script/helpers/cose.js
new file mode 100644
index 0000000000000000000000000000000000000000..d66651b93db7a05197174a2760026e5a34385bcb
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/cose.js
@@ -0,0 +1,99 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.COSEALG = exports.COSECRV = exports.COSEKTY = exports.COSEKEYS = void 0;
+exports.isCOSEPublicKeyOKP = isCOSEPublicKeyOKP;
+exports.isCOSEPublicKeyEC2 = isCOSEPublicKeyEC2;
+exports.isCOSEPublicKeyRSA = isCOSEPublicKeyRSA;
+exports.isCOSEKty = isCOSEKty;
+exports.isCOSECrv = isCOSECrv;
+exports.isCOSEAlg = isCOSEAlg;
+/**
+ * A type guard for determining if a COSE public key is an OKP key pair
+ */
+function isCOSEPublicKeyOKP(cosePublicKey) {
+ const kty = cosePublicKey.get(COSEKEYS.kty);
+ return isCOSEKty(kty) && kty === COSEKTY.OKP;
+}
+/**
+ * A type guard for determining if a COSE public key is an EC2 key pair
+ */
+function isCOSEPublicKeyEC2(cosePublicKey) {
+ const kty = cosePublicKey.get(COSEKEYS.kty);
+ return isCOSEKty(kty) && kty === COSEKTY.EC2;
+}
+/**
+ * A type guard for determining if a COSE public key is an RSA key pair
+ */
+function isCOSEPublicKeyRSA(cosePublicKey) {
+ const kty = cosePublicKey.get(COSEKEYS.kty);
+ return isCOSEKty(kty) && kty === COSEKTY.RSA;
+}
+/**
+ * COSE Keys
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-common-parameters
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters
+ */
+var COSEKEYS;
+(function (COSEKEYS) {
+ COSEKEYS[COSEKEYS["kty"] = 1] = "kty";
+ COSEKEYS[COSEKEYS["alg"] = 3] = "alg";
+ COSEKEYS[COSEKEYS["crv"] = -1] = "crv";
+ COSEKEYS[COSEKEYS["x"] = -2] = "x";
+ COSEKEYS[COSEKEYS["y"] = -3] = "y";
+ COSEKEYS[COSEKEYS["n"] = -1] = "n";
+ COSEKEYS[COSEKEYS["e"] = -2] = "e";
+})(COSEKEYS || (exports.COSEKEYS = COSEKEYS = {}));
+/**
+ * COSE Key Types
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#key-type
+ */
+var COSEKTY;
+(function (COSEKTY) {
+ COSEKTY[COSEKTY["OKP"] = 1] = "OKP";
+ COSEKTY[COSEKTY["EC2"] = 2] = "EC2";
+ COSEKTY[COSEKTY["RSA"] = 3] = "RSA";
+})(COSEKTY || (exports.COSEKTY = COSEKTY = {}));
+function isCOSEKty(kty) {
+ return Object.values(COSEKTY).indexOf(kty) >= 0;
+}
+/**
+ * COSE Curves
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves
+ */
+var COSECRV;
+(function (COSECRV) {
+ COSECRV[COSECRV["P256"] = 1] = "P256";
+ COSECRV[COSECRV["P384"] = 2] = "P384";
+ COSECRV[COSECRV["P521"] = 3] = "P521";
+ COSECRV[COSECRV["ED25519"] = 6] = "ED25519";
+ COSECRV[COSECRV["SECP256K1"] = 8] = "SECP256K1";
+})(COSECRV || (exports.COSECRV = COSECRV = {}));
+function isCOSECrv(crv) {
+ return Object.values(COSECRV).indexOf(crv) >= 0;
+}
+/**
+ * COSE Algorithms
+ *
+ * https://www.iana.org/assignments/cose/cose.xhtml#algorithms
+ */
+var COSEALG;
+(function (COSEALG) {
+ COSEALG[COSEALG["ES256"] = -7] = "ES256";
+ COSEALG[COSEALG["EdDSA"] = -8] = "EdDSA";
+ COSEALG[COSEALG["ES384"] = -35] = "ES384";
+ COSEALG[COSEALG["ES512"] = -36] = "ES512";
+ COSEALG[COSEALG["PS256"] = -37] = "PS256";
+ COSEALG[COSEALG["PS384"] = -38] = "PS384";
+ COSEALG[COSEALG["PS512"] = -39] = "PS512";
+ COSEALG[COSEALG["ES256K"] = -47] = "ES256K";
+ COSEALG[COSEALG["RS256"] = -257] = "RS256";
+ COSEALG[COSEALG["RS384"] = -258] = "RS384";
+ COSEALG[COSEALG["RS512"] = -259] = "RS512";
+ COSEALG[COSEALG["RS1"] = -65535] = "RS1";
+})(COSEALG || (exports.COSEALG = COSEALG = {}));
+function isCOSEAlg(alg) {
+ return Object.values(COSEALG).indexOf(alg) >= 0;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeAttestationObject.d.ts b/node_modules/@simplewebauthn/server/script/helpers/decodeAttestationObject.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0629694d8f3512f01e45f3085ffc114d08666fd0
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeAttestationObject.d.ts
@@ -0,0 +1,35 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Convert an AttestationObject buffer to a proper object
+ *
+ * @param base64AttestationObject Attestation Object buffer
+ */
+export declare function decodeAttestationObject(attestationObject: Uint8Array_): AttestationObject;
+export type AttestationFormat = 'fido-u2f' | 'packed' | 'android-safetynet' | 'android-key' | 'tpm' | 'apple' | 'none';
+export type AttestationObject = {
+ get(key: 'fmt'): AttestationFormat;
+ get(key: 'attStmt'): AttestationStatement;
+ get(key: 'authData'): Uint8Array_;
+};
+/**
+ * `AttestationStatement` will be an instance of `Map`, but these keys help make finite the list of
+ * possible values within it.
+ */
+export type AttestationStatement = {
+ get(key: 'sig'): Uint8Array_ | undefined;
+ get(key: 'x5c'): Uint8Array_[] | undefined;
+ get(key: 'response'): Uint8Array_ | undefined;
+ get(key: 'alg'): number | undefined;
+ get(key: 'ver'): string | undefined;
+ get(key: 'certInfo'): Uint8Array_ | undefined;
+ get(key: 'pubArea'): Uint8Array_ | undefined;
+ readonly size: number;
+};
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _decodeAttestationObjectInternals: {
+ stubThis: (value: AttestationObject) => AttestationObject;
+};
+//# sourceMappingURL=decodeAttestationObject.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeAttestationObject.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/decodeAttestationObject.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..1ef71541e185edb39687c9a45d24eb4ade621278
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeAttestationObject.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeAttestationObject.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeAttestationObject.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,iBAAiB,EAAE,WAAW,GAC7B,iBAAiB,CAInB;AAED,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,QAAQ,GACR,mBAAmB,GACnB,aAAa,GACb,KAAK,GACL,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,iBAAiB,CAAC;IACnC,GAAG,CAAC,GAAG,EAAE,SAAS,GAAG,oBAAoB,CAAC;IAC1C,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,CAAC;CACnC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,WAAW,EAAE,GAAG,SAAS,CAAC;IAC3C,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,GAAG,CAAC,GAAG,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IAE7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC;sBAC1B,iBAAiB;CACpC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeAttestationObject.js b/node_modules/@simplewebauthn/server/script/helpers/decodeAttestationObject.js
new file mode 100644
index 0000000000000000000000000000000000000000..18a76a4663bb23dbc9084109016ec5d0ad5c193a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeAttestationObject.js
@@ -0,0 +1,20 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports._decodeAttestationObjectInternals = void 0;
+exports.decodeAttestationObject = decodeAttestationObject;
+const index_js_1 = require("./iso/index.js");
+/**
+ * Convert an AttestationObject buffer to a proper object
+ *
+ * @param base64AttestationObject Attestation Object buffer
+ */
+function decodeAttestationObject(attestationObject) {
+ return exports._decodeAttestationObjectInternals.stubThis(index_js_1.isoCBOR.decodeFirst(attestationObject));
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+exports._decodeAttestationObjectInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeAuthenticatorExtensions.d.ts b/node_modules/@simplewebauthn/server/script/helpers/decodeAuthenticatorExtensions.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..706e8ea70dee9b5af23390e05398949a8f20a397
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeAuthenticatorExtensions.d.ts
@@ -0,0 +1,12 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Convert authenticator extension data buffer to a proper object
+ *
+ * @param extensionData Authenticator Extension Data buffer
+ */
+export declare function decodeAuthenticatorExtensions(extensionData: Uint8Array_): AuthenticationExtensionsAuthenticatorOutputs | undefined;
+/**
+ * Attempt to support authenticator extensions we might not know about in WebAuthn
+ */
+export type AuthenticationExtensionsAuthenticatorOutputs = unknown;
+//# sourceMappingURL=decodeAuthenticatorExtensions.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeAuthenticatorExtensions.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/decodeAuthenticatorExtensions.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..aba9c4f56a287a3b4792262d2a37ebef87fbd878
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeAuthenticatorExtensions.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeAuthenticatorExtensions.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeAuthenticatorExtensions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,EAAE,WAAW,GACzB,4CAA4C,GAAG,SAAS,CAU1D;AAED;;GAEG;AACH,MAAM,MAAM,4CAA4C,GAAG,OAAO,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeAuthenticatorExtensions.js b/node_modules/@simplewebauthn/server/script/helpers/decodeAuthenticatorExtensions.js
new file mode 100644
index 0000000000000000000000000000000000000000..9eda541e078c67417f7ce74b7abd02e14ac70ced
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeAuthenticatorExtensions.js
@@ -0,0 +1,37 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.decodeAuthenticatorExtensions = decodeAuthenticatorExtensions;
+const index_js_1 = require("./iso/index.js");
+/**
+ * Convert authenticator extension data buffer to a proper object
+ *
+ * @param extensionData Authenticator Extension Data buffer
+ */
+function decodeAuthenticatorExtensions(extensionData) {
+ let toCBOR;
+ try {
+ toCBOR = index_js_1.isoCBOR.decodeFirst(extensionData);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`Error decoding authenticator extensions: ${_err.message}`);
+ }
+ return convertMapToObjectDeep(toCBOR);
+}
+/**
+ * CBOR-encoded extensions can be deeply-nested Maps, which are too deep for a simple
+ * `Object.entries()`. This method will recursively make sure that all Maps are converted into
+ * basic objects.
+ */
+function convertMapToObjectDeep(input) {
+ const mapped = {};
+ for (const [key, value] of input) {
+ if (value instanceof Map) {
+ mapped[key] = convertMapToObjectDeep(value);
+ }
+ else {
+ mapped[key] = value;
+ }
+ }
+ return mapped;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeClientDataJSON.d.ts b/node_modules/@simplewebauthn/server/script/helpers/decodeClientDataJSON.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..814b560c01c0236691e1e869f4f1553f3cf998cf
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeClientDataJSON.d.ts
@@ -0,0 +1,23 @@
+import type { Base64URLString } from '../types/index.js';
+/**
+ * Decode an authenticator's base64url-encoded clientDataJSON to JSON
+ */
+export declare function decodeClientDataJSON(data: Base64URLString): ClientDataJSON;
+export type ClientDataJSON = {
+ type: string;
+ challenge: string;
+ origin: string;
+ crossOrigin?: boolean;
+ tokenBinding?: {
+ id?: string;
+ status: 'present' | 'supported' | 'not-supported';
+ };
+};
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _decodeClientDataJSONInternals: {
+ stubThis: (value: ClientDataJSON) => ClientDataJSON;
+};
+//# sourceMappingURL=decodeClientDataJSON.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeClientDataJSON.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/decodeClientDataJSON.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..1768c3de3868723dc8795c86f459b772c2383da6
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeClientDataJSON.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeClientDataJSON.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeClientDataJSON.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,eAAe,GAAG,cAAc,CAK1E;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE;QACb,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,eAAe,CAAC;KACnD,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,8BAA8B;sBACvB,cAAc;CACjC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeClientDataJSON.js b/node_modules/@simplewebauthn/server/script/helpers/decodeClientDataJSON.js
new file mode 100644
index 0000000000000000000000000000000000000000..63f78b3c12e8fa46d5d992df52bb764aee8a7c38
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeClientDataJSON.js
@@ -0,0 +1,20 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports._decodeClientDataJSONInternals = void 0;
+exports.decodeClientDataJSON = decodeClientDataJSON;
+const index_js_1 = require("./iso/index.js");
+/**
+ * Decode an authenticator's base64url-encoded clientDataJSON to JSON
+ */
+function decodeClientDataJSON(data) {
+ const toString = index_js_1.isoBase64URL.toUTF8String(data);
+ const clientData = JSON.parse(toString);
+ return exports._decodeClientDataJSONInternals.stubThis(clientData);
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+exports._decodeClientDataJSONInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeCredentialPublicKey.d.ts b/node_modules/@simplewebauthn/server/script/helpers/decodeCredentialPublicKey.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1610b3a2c1758f3350f36019c823db8976213f9c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeCredentialPublicKey.d.ts
@@ -0,0 +1,11 @@
+import type { COSEPublicKey } from './cose.js';
+import type { Uint8Array_ } from '../types/index.js';
+export declare function decodeCredentialPublicKey(publicKey: Uint8Array_): COSEPublicKey;
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _decodeCredentialPublicKeyInternals: {
+ stubThis: (value: COSEPublicKey) => COSEPublicKey;
+};
+//# sourceMappingURL=decodeCredentialPublicKey.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeCredentialPublicKey.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/decodeCredentialPublicKey.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..e2e6ca73b7a926994739662dbc19c9368d6b4901
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeCredentialPublicKey.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeCredentialPublicKey.d.ts","sourceRoot":"","sources":["../../src/helpers/decodeCredentialPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,WAAW,GACrB,aAAa,CAIf;AAED;;;GAGG;AACH,eAAO,MAAM,mCAAmC;sBAC5B,aAAa;CAChC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/decodeCredentialPublicKey.js b/node_modules/@simplewebauthn/server/script/helpers/decodeCredentialPublicKey.js
new file mode 100644
index 0000000000000000000000000000000000000000..c45eee32b08e1262fb3e376b11d4fe2577afc529
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/decodeCredentialPublicKey.js
@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports._decodeCredentialPublicKeyInternals = void 0;
+exports.decodeCredentialPublicKey = decodeCredentialPublicKey;
+const index_js_1 = require("./iso/index.js");
+function decodeCredentialPublicKey(publicKey) {
+ return exports._decodeCredentialPublicKeyInternals.stubThis(index_js_1.isoCBOR.decodeFirst(publicKey));
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+exports._decodeCredentialPublicKeyInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/script/helpers/fetch.d.ts b/node_modules/@simplewebauthn/server/script/helpers/fetch.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ee4f94663f07066ca34023cda92eee4b07c1bd06
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/fetch.d.ts
@@ -0,0 +1,13 @@
+/**
+ * A simple method for requesting data via standard `fetch`. Should work
+ * across multiple runtimes.
+ */
+export declare function fetch(url: string): Promise;
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _fetchInternals: {
+ stubThis: (url: string) => Promise;
+};
+//# sourceMappingURL=fetch.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/fetch.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/fetch.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f5494bb75fd427704476426d34b9770f4602020c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/fetch.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/helpers/fetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEpD;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe;oBACV,MAAM;CACvB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/fetch.js b/node_modules/@simplewebauthn/server/script/helpers/fetch.js
new file mode 100644
index 0000000000000000000000000000000000000000..a753c0d038db4d59f4a4b66e197094515e010a5a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/fetch.js
@@ -0,0 +1,18 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports._fetchInternals = void 0;
+exports.fetch = fetch;
+/**
+ * A simple method for requesting data via standard `fetch`. Should work
+ * across multiple runtimes.
+ */
+function fetch(url) {
+ return exports._fetchInternals.stubThis(url);
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+exports._fetchInternals = {
+ stubThis: (url) => globalThis.fetch(url),
+};
diff --git a/node_modules/@simplewebauthn/server/script/helpers/generateChallenge.d.ts b/node_modules/@simplewebauthn/server/script/helpers/generateChallenge.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0b37847f71d8875f069908ab7bc46d89466071a9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/generateChallenge.d.ts
@@ -0,0 +1,13 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Generate a suitably random value to be used as an attestation or assertion challenge
+ */
+export declare function generateChallenge(): Promise;
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _generateChallengeInternals: {
+ stubThis: (value: Uint8Array_) => Uint8Array;
+};
+//# sourceMappingURL=generateChallenge.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/generateChallenge.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/generateChallenge.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..9eb5fda80c53a60bf9299df0794ecfd0e069a737
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/generateChallenge.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"generateChallenge.d.ts","sourceRoot":"","sources":["../../src/helpers/generateChallenge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,WAAW,CAAC,CAc9D;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B;sBACpB,WAAW;CAC9B,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/generateChallenge.js b/node_modules/@simplewebauthn/server/script/helpers/generateChallenge.js
new file mode 100644
index 0000000000000000000000000000000000000000..68043f33fe31fcc0ead6b96943185bbbb3abb608
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/generateChallenge.js
@@ -0,0 +1,28 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports._generateChallengeInternals = void 0;
+exports.generateChallenge = generateChallenge;
+const index_js_1 = require("./iso/index.js");
+/**
+ * Generate a suitably random value to be used as an attestation or assertion challenge
+ */
+async function generateChallenge() {
+ /**
+ * WebAuthn spec says that 16 bytes is a good minimum:
+ *
+ * "In order to prevent replay attacks, the challenges MUST contain enough entropy to make
+ * guessing them infeasible. Challenges SHOULD therefore be at least 16 bytes long."
+ *
+ * Just in case, let's double it
+ */
+ const challenge = new Uint8Array(32);
+ await index_js_1.isoCrypto.getRandomValues(challenge);
+ return exports._generateChallengeInternals.stubThis(challenge);
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+exports._generateChallengeInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/script/helpers/generateUserID.d.ts b/node_modules/@simplewebauthn/server/script/helpers/generateUserID.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2b3350933ef9abb223e9ba7904a1fae8081eb3eb
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/generateUserID.d.ts
@@ -0,0 +1,13 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Generate a suitably random value to be used as user ID
+ */
+export declare function generateUserID(): Promise;
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _generateUserIDInternals: {
+ stubThis: (value: Uint8Array_) => Uint8Array;
+};
+//# sourceMappingURL=generateUserID.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/generateUserID.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/generateUserID.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..777c1664afc447bf0f4d408f56a7acac08ab5b4c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/generateUserID.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"generateUserID.d.ts","sourceRoot":"","sources":["../../src/helpers/generateUserID.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAU3D;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB;sBACjB,WAAW;CAC9B,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/generateUserID.js b/node_modules/@simplewebauthn/server/script/helpers/generateUserID.js
new file mode 100644
index 0000000000000000000000000000000000000000..d3a24e06faacbbf2b0ff1978d93840619f651771
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/generateUserID.js
@@ -0,0 +1,24 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports._generateUserIDInternals = void 0;
+exports.generateUserID = generateUserID;
+const index_js_1 = require("./iso/index.js");
+/**
+ * Generate a suitably random value to be used as user ID
+ */
+async function generateUserID() {
+ /**
+ * WebAuthn spec says user.id has a max length of 64 bytes. I prefer how 32 random bytes look
+ * after they're base64url-encoded so I'm choosing to go with that here.
+ */
+ const newUserID = new Uint8Array(32);
+ await index_js_1.isoCrypto.getRandomValues(newUserID);
+ return exports._generateUserIDInternals.stubThis(newUserID);
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+exports._generateUserIDInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/script/helpers/getCertificateInfo.d.ts b/node_modules/@simplewebauthn/server/script/helpers/getCertificateInfo.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..480bcba6b464d50d313867236c66622f4395b91e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/getCertificateInfo.d.ts
@@ -0,0 +1,33 @@
+import { Certificate } from '@peculiar/asn1-x509';
+import type { Uint8Array_ } from '../types/index.js';
+export type CertificateInfo = {
+ issuer: Issuer;
+ subject: Subject;
+ version: number;
+ basicConstraintsCA: boolean;
+ notBefore: Date;
+ notAfter: Date;
+ parsedCertificate: Certificate;
+};
+type Issuer = {
+ C?: string;
+ O?: string;
+ OU?: string;
+ CN?: string;
+ combined: string;
+};
+type Subject = {
+ C?: string;
+ O?: string;
+ OU?: string;
+ CN?: string;
+ combined: string;
+};
+/**
+ * Extract PEM certificate info
+ *
+ * @param pemCertificate Result from call to `convertASN1toPEM(x5c[0])`
+ */
+export declare function getCertificateInfo(leafCertBuffer: Uint8Array_): CertificateInfo;
+export {};
+//# sourceMappingURL=getCertificateInfo.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/getCertificateInfo.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/getCertificateInfo.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..23fde1cb810ceefba3c6f99de760654bd7bc858e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/getCertificateInfo.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"getCertificateInfo.d.ts","sourceRoot":"","sources":["../../src/helpers/getCertificateInfo.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,WAAW,EAA0B,MAAM,qBAAqB,CAAC;AAE5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,IAAI,CAAC;IACf,iBAAiB,EAAE,WAAW,CAAC;CAChC,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AASF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,WAAW,GAC1B,eAAe,CA+CjB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/getCertificateInfo.js b/node_modules/@simplewebauthn/server/script/helpers/getCertificateInfo.js
new file mode 100644
index 0000000000000000000000000000000000000000..72d9d40a7f738a3f65ee8c116d27473f935c6066
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/getCertificateInfo.js
@@ -0,0 +1,80 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getCertificateInfo = getCertificateInfo;
+const asn1_schema_1 = require("@peculiar/asn1-schema");
+const asn1_x509_1 = require("@peculiar/asn1-x509");
+const issuerSubjectIDKey = {
+ '2.5.4.6': 'C',
+ '2.5.4.10': 'O',
+ '2.5.4.11': 'OU',
+ '2.5.4.3': 'CN',
+};
+/**
+ * Extract PEM certificate info
+ *
+ * @param pemCertificate Result from call to `convertASN1toPEM(x5c[0])`
+ */
+function getCertificateInfo(leafCertBuffer) {
+ const x509 = asn1_schema_1.AsnParser.parse(leafCertBuffer, asn1_x509_1.Certificate);
+ const parsedCert = x509.tbsCertificate;
+ // Issuer
+ const issuer = { combined: '' };
+ parsedCert.issuer.forEach(([iss]) => {
+ const key = issuerSubjectIDKey[iss.type];
+ if (key) {
+ issuer[key] = iss.value.toString();
+ }
+ });
+ issuer.combined = issuerSubjectToString(issuer);
+ // Subject
+ const subject = { combined: '' };
+ parsedCert.subject.forEach(([iss]) => {
+ const key = issuerSubjectIDKey[iss.type];
+ if (key) {
+ subject[key] = iss.value.toString();
+ }
+ });
+ subject.combined = issuerSubjectToString(subject);
+ let basicConstraintsCA = false;
+ if (parsedCert.extensions) {
+ // console.log(parsedCert.extensions);
+ for (const ext of parsedCert.extensions) {
+ if (ext.extnID === asn1_x509_1.id_ce_basicConstraints) {
+ const basicConstraints = asn1_schema_1.AsnParser.parse(ext.extnValue, asn1_x509_1.BasicConstraints);
+ basicConstraintsCA = basicConstraints.cA;
+ }
+ }
+ }
+ return {
+ issuer,
+ subject,
+ version: parsedCert.version,
+ basicConstraintsCA,
+ notBefore: parsedCert.validity.notBefore.getTime(),
+ notAfter: parsedCert.validity.notAfter.getTime(),
+ parsedCertificate: x509,
+ };
+}
+/**
+ * Stringify the parts of Issuer or Subject info for easier comparison of subject issuers with
+ * issuer subjects.
+ *
+ * The order might seem arbitrary, because it is. It should be enough that the two are stringified
+ * in the same order.
+ */
+function issuerSubjectToString(input) {
+ const parts = [];
+ if (input.C) {
+ parts.push(input.C);
+ }
+ if (input.O) {
+ parts.push(input.O);
+ }
+ if (input.OU) {
+ parts.push(input.OU);
+ }
+ if (input.CN) {
+ parts.push(input.CN);
+ }
+ return parts.join(' : ');
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/index.d.ts b/node_modules/@simplewebauthn/server/script/helpers/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1297a5259ce1f6fa685a4ee32fdc810a349b94be
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/index.d.ts
@@ -0,0 +1,18 @@
+export * from './convertAAGUIDToString.js';
+export * from './convertCertBufferToPEM.js';
+export * from './convertCOSEtoPKCS.js';
+export * from './decodeAttestationObject.js';
+export * from './decodeClientDataJSON.js';
+export * from './decodeCredentialPublicKey.js';
+export * from './generateChallenge.js';
+export * from './generateUserID.js';
+export * from './getCertificateInfo.js';
+export * from './isCertRevoked.js';
+export * from './parseAuthenticatorData.js';
+export * from './toHash.js';
+export * from './validateCertificatePath.js';
+export * from './verifySignature.js';
+export * from './iso/index.js';
+export * from '../metadata/verifyMDSBlob.js';
+export * as cose from './cose.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/index.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..ae168084e7148bb1d994565d156ff1aafd9c110e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/index.js b/node_modules/@simplewebauthn/server/script/helpers/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..e547a466283f8ce8eabef70b1f2b85e266e31d15
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/index.js
@@ -0,0 +1,46 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.cose = void 0;
+__exportStar(require("./convertAAGUIDToString.js"), exports);
+__exportStar(require("./convertCertBufferToPEM.js"), exports);
+__exportStar(require("./convertCOSEtoPKCS.js"), exports);
+__exportStar(require("./decodeAttestationObject.js"), exports);
+__exportStar(require("./decodeClientDataJSON.js"), exports);
+__exportStar(require("./decodeCredentialPublicKey.js"), exports);
+__exportStar(require("./generateChallenge.js"), exports);
+__exportStar(require("./generateUserID.js"), exports);
+__exportStar(require("./getCertificateInfo.js"), exports);
+__exportStar(require("./isCertRevoked.js"), exports);
+__exportStar(require("./parseAuthenticatorData.js"), exports);
+__exportStar(require("./toHash.js"), exports);
+__exportStar(require("./validateCertificatePath.js"), exports);
+__exportStar(require("./verifySignature.js"), exports);
+__exportStar(require("./iso/index.js"), exports);
+__exportStar(require("../metadata/verifyMDSBlob.js"), exports);
+exports.cose = __importStar(require("./cose.js"));
diff --git a/node_modules/@simplewebauthn/server/script/helpers/isCertRevoked.d.ts b/node_modules/@simplewebauthn/server/script/helpers/isCertRevoked.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2d1c2bf3957acba59c9f0332d0d65e00ab4e7d9e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/isCertRevoked.d.ts
@@ -0,0 +1,9 @@
+import { type X509Certificate } from '@peculiar/x509';
+/**
+ * A method to pull a CRL from a certificate and compare its serial number to the list of revoked
+ * certificate serial numbers within the CRL.
+ *
+ * CRL certificate structure referenced from https://tools.ietf.org/html/rfc5280#page-117
+ */
+export declare function isCertRevoked(cert: X509Certificate): Promise;
+//# sourceMappingURL=isCertRevoked.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/isCertRevoked.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/isCertRevoked.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..74516b92258e14ee6c4e82287f559a13ed28e28d
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/isCertRevoked.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"isCertRevoked.d.ts","sourceRoot":"","sources":["../../src/helpers/isCertRevoked.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAexB;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAkG3E"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/isCertRevoked.js b/node_modules/@simplewebauthn/server/script/helpers/isCertRevoked.js
new file mode 100644
index 0000000000000000000000000000000000000000..e7d59fd1dc642fb7dcda4782e65c37b6f1db5bd5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/isCertRevoked.js
@@ -0,0 +1,99 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isCertRevoked = isCertRevoked;
+const x509_1 = require("@peculiar/x509");
+const fetch_js_1 = require("./fetch.js");
+const cacheRevokedCerts = {};
+/**
+ * A method to pull a CRL from a certificate and compare its serial number to the list of revoked
+ * certificate serial numbers within the CRL.
+ *
+ * CRL certificate structure referenced from https://tools.ietf.org/html/rfc5280#page-117
+ */
+async function isCertRevoked(cert) {
+ const { extensions } = cert;
+ if (!extensions) {
+ return false;
+ }
+ let extAuthorityKeyID;
+ let extSubjectKeyID;
+ let extCRLDistributionPoints;
+ extensions.forEach((ext) => {
+ if (ext instanceof x509_1.AuthorityKeyIdentifierExtension) {
+ extAuthorityKeyID = ext;
+ }
+ else if (ext instanceof x509_1.SubjectKeyIdentifierExtension) {
+ extSubjectKeyID = ext;
+ }
+ else if (ext instanceof x509_1.CRLDistributionPointsExtension) {
+ extCRLDistributionPoints = ext;
+ }
+ });
+ // Check to see if we've got cached info for the cert's CA
+ let keyIdentifier = undefined;
+ if (extAuthorityKeyID && extAuthorityKeyID.keyId) {
+ keyIdentifier = extAuthorityKeyID.keyId;
+ }
+ else if (extSubjectKeyID) {
+ /**
+ * We might be dealing with a self-signed root certificate. Check the
+ * Subject key Identifier extension next.
+ */
+ keyIdentifier = extSubjectKeyID.keyId;
+ }
+ if (keyIdentifier) {
+ const cached = cacheRevokedCerts[keyIdentifier];
+ if (cached) {
+ const now = new Date();
+ // If there's a nextUpdate then make sure we're before it
+ if (!cached.nextUpdate || cached.nextUpdate > now) {
+ return cached.revokedCerts.indexOf(cert.serialNumber) >= 0;
+ }
+ }
+ }
+ const crlURL = extCRLDistributionPoints?.distributionPoints?.[0].distributionPoint?.fullName?.[0]
+ .uniformResourceIdentifier;
+ // If no URL is provided then we have nothing to check
+ if (!crlURL) {
+ return false;
+ }
+ // Download and read the CRL
+ let certListBytes;
+ try {
+ const respCRL = await (0, fetch_js_1.fetch)(crlURL);
+ certListBytes = await respCRL.arrayBuffer();
+ }
+ catch (_err) {
+ return false;
+ }
+ let data;
+ try {
+ data = new x509_1.X509Crl(certListBytes);
+ }
+ catch (_err) {
+ // Something was malformed with the CRL, so pass
+ return false;
+ }
+ const newCached = {
+ revokedCerts: [],
+ nextUpdate: undefined,
+ };
+ // nextUpdate
+ if (data.nextUpdate) {
+ newCached.nextUpdate = data.nextUpdate;
+ }
+ // revokedCertificates
+ const revokedCerts = data.entries;
+ if (revokedCerts) {
+ for (const cert of revokedCerts) {
+ const revokedHex = cert.serialNumber;
+ newCached.revokedCerts.push(revokedHex);
+ }
+ // Cache the results
+ if (keyIdentifier) {
+ cacheRevokedCerts[keyIdentifier] = newCached;
+ }
+ return newCached.revokedCerts.indexOf(cert.serialNumber) >= 0;
+ }
+ return false;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/index.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7ad61a1bb28ab04559b8d90857737160dc7afc97
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/index.d.ts
@@ -0,0 +1,12 @@
+/**
+ * A collection of methods for isomorphic manipulation of trickier data types
+ *
+ * The goal with these is to make it easier to replace dependencies later that might not play well
+ * with specific server-like runtimes that expose global Web APIs (CloudFlare Workers, Deno, Bun,
+ * etc...), while also supporting execution in Node.
+ */
+export * as isoBase64URL from './isoBase64URL.js';
+export * as isoCBOR from './isoCBOR.js';
+export * as isoCrypto from './isoCrypto/index.js';
+export * as isoUint8Array from './isoUint8Array.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/index.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..ee4f18b17cac403b5127964d1acb48e582cfefe5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/iso/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/index.js b/node_modules/@simplewebauthn/server/script/helpers/iso/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..bd0039ab8e30175f8d04168c03e1e1ec31acc148
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/index.js
@@ -0,0 +1,37 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isoUint8Array = exports.isoCrypto = exports.isoCBOR = exports.isoBase64URL = void 0;
+/**
+ * A collection of methods for isomorphic manipulation of trickier data types
+ *
+ * The goal with these is to make it easier to replace dependencies later that might not play well
+ * with specific server-like runtimes that expose global Web APIs (CloudFlare Workers, Deno, Bun,
+ * etc...), while also supporting execution in Node.
+ */
+exports.isoBase64URL = __importStar(require("./isoBase64URL.js"));
+exports.isoCBOR = __importStar(require("./isoCBOR.js"));
+exports.isoCrypto = __importStar(require("./isoCrypto/index.js"));
+exports.isoUint8Array = __importStar(require("./isoUint8Array.js"));
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoBase64URL.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoBase64URL.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..085e34cdfb075883f4e14f6e4d07087b161f1313
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoBase64URL.d.ts
@@ -0,0 +1,43 @@
+import type { Base64URLString, Uint8Array_ } from '../../types/index.js';
+/**
+ * Decode from a Base64URL-encoded string to an ArrayBuffer. Best used when converting a
+ * credential ID from a JSON string to an ArrayBuffer, like in allowCredentials or
+ * excludeCredentials.
+ *
+ * @param buffer Value to decode from base64
+ * @param to (optional) The decoding to use, in case it's desirable to decode from base64 instead
+ */
+export declare function toBuffer(base64urlString: string, from?: 'base64' | 'base64url'): Uint8Array_;
+/**
+ * Encode the given array buffer into a Base64URL-encoded string. Ideal for converting various
+ * credential response ArrayBuffers to string for sending back to the server as JSON.
+ *
+ * @param buffer Value to encode to base64
+ * @param to (optional) The encoding to use, in case it's desirable to encode to base64 instead
+ */
+export declare function fromBuffer(buffer: Uint8Array_, to?: 'base64' | 'base64url'): string;
+/**
+ * Convert a base64url string into base64
+ */
+export declare function toBase64(base64urlString: string): string;
+/**
+ * Encode a UTF-8 string to base64url
+ */
+export declare function fromUTF8String(utf8String: string): string;
+/**
+ * Decode a base64url string into its original UTF-8 string
+ */
+export declare function toUTF8String(base64urlString: string): string;
+/**
+ * Confirm that the string is encoded into base64
+ */
+export declare function isBase64(input: string): boolean;
+/**
+ * Confirm that the string is encoded into base64url, with support for optional padding
+ */
+export declare function isBase64URL(input: string): boolean;
+/**
+ * Remove optional padding from a base64url-encoded string
+ */
+export declare function trimPadding(input: Base64URLString): Base64URLString;
+//# sourceMappingURL=isoBase64URL.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoBase64URL.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoBase64URL.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..8636ef644c3a50676c43901b45dd775940aceca1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoBase64URL.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"isoBase64URL.d.ts","sourceRoot":"","sources":["../../../src/helpers/iso/isoBase64URL.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,eAAe,EAAE,MAAM,EACvB,IAAI,GAAE,QAAQ,GAAG,WAAyB,GACzC,WAAW,CAGb;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,WAAW,EACnB,EAAE,GAAE,QAAQ,GAAG,WAAyB,GACvC,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAIxD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIlD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAEnE"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoBase64URL.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoBase64URL.js
new file mode 100644
index 0000000000000000000000000000000000000000..bce4ffef7464072807f731ebf51ba04b965cf00b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoBase64URL.js
@@ -0,0 +1,85 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.toBuffer = toBuffer;
+exports.fromBuffer = fromBuffer;
+exports.toBase64 = toBase64;
+exports.fromUTF8String = fromUTF8String;
+exports.toUTF8String = toUTF8String;
+exports.isBase64 = isBase64;
+exports.isBase64URL = isBase64URL;
+exports.trimPadding = trimPadding;
+/**
+ * A runtime-agnostic collection of methods for working with Base64URL encoding
+ * @module
+ */
+const base64_1 = __importDefault(require("@hexagon/base64"));
+/**
+ * Decode from a Base64URL-encoded string to an ArrayBuffer. Best used when converting a
+ * credential ID from a JSON string to an ArrayBuffer, like in allowCredentials or
+ * excludeCredentials.
+ *
+ * @param buffer Value to decode from base64
+ * @param to (optional) The decoding to use, in case it's desirable to decode from base64 instead
+ */
+function toBuffer(base64urlString, from = 'base64url') {
+ const _buffer = base64_1.default.toArrayBuffer(base64urlString, from === 'base64url');
+ return new Uint8Array(_buffer);
+}
+/**
+ * Encode the given array buffer into a Base64URL-encoded string. Ideal for converting various
+ * credential response ArrayBuffers to string for sending back to the server as JSON.
+ *
+ * @param buffer Value to encode to base64
+ * @param to (optional) The encoding to use, in case it's desirable to encode to base64 instead
+ */
+function fromBuffer(buffer, to = 'base64url') {
+ /**
+ * Gracefully handle Uint8Array subclass types, like Node's Buffer, that can have a large
+ * ArrayBuffer backing it.
+ */
+ const _normalized = new Uint8Array(buffer);
+ return base64_1.default.fromArrayBuffer(_normalized.buffer, to === 'base64url');
+}
+/**
+ * Convert a base64url string into base64
+ */
+function toBase64(base64urlString) {
+ const fromBase64Url = base64_1.default.toArrayBuffer(base64urlString, true);
+ const toBase64 = base64_1.default.fromArrayBuffer(fromBase64Url);
+ return toBase64;
+}
+/**
+ * Encode a UTF-8 string to base64url
+ */
+function fromUTF8String(utf8String) {
+ return base64_1.default.fromString(utf8String, true);
+}
+/**
+ * Decode a base64url string into its original UTF-8 string
+ */
+function toUTF8String(base64urlString) {
+ return base64_1.default.toString(base64urlString, true);
+}
+/**
+ * Confirm that the string is encoded into base64
+ */
+function isBase64(input) {
+ return base64_1.default.validate(input, false);
+}
+/**
+ * Confirm that the string is encoded into base64url, with support for optional padding
+ */
+function isBase64URL(input) {
+ // Trim padding characters from the string if present
+ input = trimPadding(input);
+ return base64_1.default.validate(input, true);
+}
+/**
+ * Remove optional padding from a base64url-encoded string
+ */
+function trimPadding(input) {
+ return input.replace(/=/g, '');
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCBOR.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCBOR.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b9441fb7626adc29cda5a206ff5c480ef177fdb7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCBOR.d.ts
@@ -0,0 +1,29 @@
+/**
+ * A runtime-agnostic collection of methods for working with CBOR encoding
+ * @module
+ */
+import * as tinyCbor from '@levischuck/tiny-cbor';
+import type { Uint8Array_ } from '../../types/index.js';
+/**
+ * Whatever CBOR encoder is used should keep CBOR data the same length when data is re-encoded
+ *
+ * MOST CRITICALLY, this means the following needs to be true of whatever CBOR library we use:
+ * - CBOR Map type values MUST decode to JavaScript Maps
+ * - CBOR tag 64 (uint8 Typed Array) MUST NOT be used when encoding Uint8Arrays back to CBOR
+ *
+ * So long as these requirements are maintained, then CBOR sequences can be encoded and decoded
+ * freely while maintaining their lengths for the most accurate pointer movement across them.
+ */
+/**
+ * Decode and return the first item in a sequence of CBOR-encoded values
+ *
+ * @param input The CBOR data to decode
+ * @param asObject (optional) Whether to convert any CBOR Maps into JavaScript Objects. Defaults to
+ * `false`
+ */
+export declare function decodeFirst(input: Uint8Array_): Type;
+/**
+ * Encode data to CBOR
+ */
+export declare function encode(input: tinyCbor.CBORType): Uint8Array_;
+//# sourceMappingURL=isoCBOR.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCBOR.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCBOR.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..0aad3bc552672c5fe63b2b52a7189e28aa1cb2c2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCBOR.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"isoCBOR.d.ts","sourceRoot":"","sources":["../../../src/helpers/iso/isoCBOR.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;GASG;AAEH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAQ1D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,GAAG,WAAW,CAE5D"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCBOR.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCBOR.js
new file mode 100644
index 0000000000000000000000000000000000000000..0828832f45eec8ab8c805edd6ef0f325704a3119
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCBOR.js
@@ -0,0 +1,62 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.decodeFirst = decodeFirst;
+exports.encode = encode;
+/**
+ * A runtime-agnostic collection of methods for working with CBOR encoding
+ * @module
+ */
+const tinyCbor = __importStar(require("@levischuck/tiny-cbor"));
+/**
+ * Whatever CBOR encoder is used should keep CBOR data the same length when data is re-encoded
+ *
+ * MOST CRITICALLY, this means the following needs to be true of whatever CBOR library we use:
+ * - CBOR Map type values MUST decode to JavaScript Maps
+ * - CBOR tag 64 (uint8 Typed Array) MUST NOT be used when encoding Uint8Arrays back to CBOR
+ *
+ * So long as these requirements are maintained, then CBOR sequences can be encoded and decoded
+ * freely while maintaining their lengths for the most accurate pointer movement across them.
+ */
+/**
+ * Decode and return the first item in a sequence of CBOR-encoded values
+ *
+ * @param input The CBOR data to decode
+ * @param asObject (optional) Whether to convert any CBOR Maps into JavaScript Objects. Defaults to
+ * `false`
+ */
+function decodeFirst(input) {
+ // Make a copy so we don't mutate the original
+ const _input = new Uint8Array(input);
+ const decoded = tinyCbor.decodePartialCBOR(_input, 0);
+ const [first] = decoded;
+ return first;
+}
+/**
+ * Encode data to CBOR
+ */
+function encode(input) {
+ return tinyCbor.encodeCBOR(input);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/digest.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/digest.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7dab1d51c0f683dc6795ac3e0b8b56d2221d21e7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/digest.d.ts
@@ -0,0 +1,10 @@
+import type { COSEALG } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Generate a digest of the provided data.
+ *
+ * @param data The data to generate a digest of
+ * @param algorithm A COSE algorithm ID that maps to a desired SHA algorithm
+ */
+export declare function digest(data: Uint8Array_, algorithm: COSEALG): Promise;
+//# sourceMappingURL=digest.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/digest.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/digest.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..49f3ef3607c1c9e1cbd8880d083c4e76fa71b10b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/digest.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/digest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAsB,MAAM,CAC1B,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,WAAW,CAAC,CAQtB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/digest.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/digest.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8e9ee9b712410d8df32cc58680cbe0ed4301b18
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/digest.js
@@ -0,0 +1,17 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.digest = digest;
+const mapCoseAlgToWebCryptoAlg_js_1 = require("./mapCoseAlgToWebCryptoAlg.js");
+const getWebCrypto_js_1 = require("./getWebCrypto.js");
+/**
+ * Generate a digest of the provided data.
+ *
+ * @param data The data to generate a digest of
+ * @param algorithm A COSE algorithm ID that maps to a desired SHA algorithm
+ */
+async function digest(data, algorithm) {
+ const WebCrypto = await (0, getWebCrypto_js_1.getWebCrypto)();
+ const subtleAlgorithm = (0, mapCoseAlgToWebCryptoAlg_js_1.mapCoseAlgToWebCryptoAlg)(algorithm);
+ const hashed = await WebCrypto.subtle.digest(subtleAlgorithm, data);
+ return new Uint8Array(hashed);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getRandomValues.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getRandomValues.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a7c210d427ab142a9bba342dd11def0e2961f018
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getRandomValues.d.ts
@@ -0,0 +1,8 @@
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Fill up the provided bytes array with random bytes equal to its length.
+ *
+ * @returns the same bytes array passed into the method
+ */
+export declare function getRandomValues(array: Uint8Array_): Promise;
+//# sourceMappingURL=getRandomValues.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getRandomValues.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getRandomValues.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..fdb5d206a33313b41cf772b9e8c8c57a1ffed46b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getRandomValues.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"getRandomValues.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/getRandomValues.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAM9E"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getRandomValues.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getRandomValues.js
new file mode 100644
index 0000000000000000000000000000000000000000..030cf4ac5043b648c904811f6b18525a6d730e47
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getRandomValues.js
@@ -0,0 +1,14 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getRandomValues = getRandomValues;
+const getWebCrypto_js_1 = require("./getWebCrypto.js");
+/**
+ * Fill up the provided bytes array with random bytes equal to its length.
+ *
+ * @returns the same bytes array passed into the method
+ */
+async function getRandomValues(array) {
+ const WebCrypto = await (0, getWebCrypto_js_1.getWebCrypto)();
+ WebCrypto.getRandomValues(array);
+ return array;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getWebCrypto.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getWebCrypto.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5ccbb6326d1068ab5e7bb5cfacb51a6f8766bb46
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getWebCrypto.d.ts
@@ -0,0 +1,14 @@
+import type { Crypto } from '../../../types/index.js';
+/**
+ * Try to get an instance of the Crypto API from the current runtime. Should support Node,
+ * as well as others, like Deno, that implement Web APIs.
+ */
+export declare function getWebCrypto(): Promise;
+export declare class MissingWebCrypto extends Error {
+ constructor();
+}
+export declare const _getWebCryptoInternals: {
+ stubThisGlobalThisCrypto: () => import("crypto").webcrypto.Crypto;
+ setCachedCrypto: (newCrypto: Crypto | undefined) => void;
+};
+//# sourceMappingURL=getWebCrypto.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getWebCrypto.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getWebCrypto.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..b1a4a797bf67d97c4bbe72723114641cca2acf95
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getWebCrypto.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"getWebCrypto.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/getWebCrypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAgC9C;AAED,qBAAa,gBAAiB,SAAQ,KAAK;;CAM1C;AAGD,eAAO,MAAM,sBAAsB;;iCAGJ,MAAM,GAAG,SAAS;CAGhD,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getWebCrypto.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getWebCrypto.js
new file mode 100644
index 0000000000000000000000000000000000000000..bcc17cb95535800e93b249f1f7eccb450ef5f324
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getWebCrypto.js
@@ -0,0 +1,54 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports._getWebCryptoInternals = exports.MissingWebCrypto = void 0;
+exports.getWebCrypto = getWebCrypto;
+let webCrypto = undefined;
+/**
+ * Try to get an instance of the Crypto API from the current runtime. Should support Node,
+ * as well as others, like Deno, that implement Web APIs.
+ */
+function getWebCrypto() {
+ /**
+ * Hello there! If you came here wondering why this method is asynchronous when use of
+ * `globalThis.crypto` is not, it's to minimize a bunch of refactor related to making this
+ * synchronous. For example, `generateRegistrationOptions()` and `generateAuthenticationOptions()`
+ * become synchronous if we make this synchronous (since nothing else in that method is async)
+ * which represents a breaking API change in this library's core API.
+ *
+ * TODO: If it's after February 2025 when you read this then consider whether it still makes sense
+ * to keep this method asynchronous.
+ */
+ const toResolve = new Promise((resolve, reject) => {
+ if (webCrypto) {
+ return resolve(webCrypto);
+ }
+ /**
+ * Naively attempt to access Crypto as a global object, which popular ESM-centric run-times
+ * support (and Node v20+)
+ */
+ const _globalThisCrypto = exports._getWebCryptoInternals.stubThisGlobalThisCrypto();
+ if (_globalThisCrypto) {
+ webCrypto = _globalThisCrypto;
+ return resolve(webCrypto);
+ }
+ // We tried to access it both in Node and globally, so bail out
+ return reject(new MissingWebCrypto());
+ });
+ return toResolve;
+}
+class MissingWebCrypto extends Error {
+ constructor() {
+ const message = 'An instance of the Crypto API could not be located';
+ super(message);
+ this.name = 'MissingWebCrypto';
+ }
+}
+exports.MissingWebCrypto = MissingWebCrypto;
+// Make it possible to stub return values during testing
+exports._getWebCryptoInternals = {
+ stubThisGlobalThisCrypto: () => globalThis.crypto,
+ // Make it possible to reset the `webCrypto` at the top of the file
+ setCachedCrypto: (newCrypto) => {
+ webCrypto = newCrypto;
+ },
+};
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/importKey.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/importKey.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2401d44dd4f9b51493a4e9180e1fb1233c4ff00c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/importKey.d.ts
@@ -0,0 +1,5 @@
+export declare function importKey(opts: {
+ keyData: JsonWebKey;
+ algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams;
+}): Promise;
+//# sourceMappingURL=importKey.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/importKey.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/importKey.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..40f49973aca9c347123c82ea636d5ad9eb28e9c4
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/importKey.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"importKey.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/importKey.ts"],"names":[],"mappings":"AAEA,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,OAAO,EAAE,UAAU,CAAC;IACpB,SAAS,EAAE,mBAAmB,GAAG,qBAAqB,GAAG,iBAAiB,CAAC;CAC5E,GAAG,OAAO,CAAC,SAAS,CAAC,CAQrB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/importKey.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/importKey.js
new file mode 100644
index 0000000000000000000000000000000000000000..6d5276b7634f20f90cfc93d6654ea3187a86b199
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/importKey.js
@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.importKey = importKey;
+const getWebCrypto_js_1 = require("./getWebCrypto.js");
+async function importKey(opts) {
+ const WebCrypto = await (0, getWebCrypto_js_1.getWebCrypto)();
+ const { keyData, algorithm } = opts;
+ return WebCrypto.subtle.importKey('jwk', keyData, algorithm, false, [
+ 'verify',
+ ]);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/index.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3e74dd3ff86829fa0e807c71b9c55e8ea85abf65
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/index.d.ts
@@ -0,0 +1,8 @@
+/**
+ * A runtime-agnostic collection of methods for working with the WebCrypto API
+ * @module
+ */
+export { digest } from './digest.js';
+export { getRandomValues } from './getRandomValues.js';
+export { verify } from './verify.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/index.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..e7c72dfb0bd00dfe7b0a879035d6b699d629fe05
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/index.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..0a814c74ae14b876014706a807e91266cb98ba4b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/index.js
@@ -0,0 +1,13 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verify = exports.getRandomValues = exports.digest = void 0;
+/**
+ * A runtime-agnostic collection of methods for working with the WebCrypto API
+ * @module
+ */
+var digest_js_1 = require("./digest.js");
+Object.defineProperty(exports, "digest", { enumerable: true, get: function () { return digest_js_1.digest; } });
+var getRandomValues_js_1 = require("./getRandomValues.js");
+Object.defineProperty(exports, "getRandomValues", { enumerable: true, get: function () { return getRandomValues_js_1.getRandomValues; } });
+var verify_js_1 = require("./verify.js");
+Object.defineProperty(exports, "verify", { enumerable: true, get: function () { return verify_js_1.verify; } });
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..65188c61f11461aca38dd74eecfa9e3a6a9d50a7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts
@@ -0,0 +1,7 @@
+import { SubtleCryptoAlg } from './structs.js';
+import { COSEALG } from '../../cose.js';
+/**
+ * Convert a COSE alg ID into a corresponding string value that WebCrypto APIs expect
+ */
+export declare function mapCoseAlgToWebCryptoAlg(alg: COSEALG): SubtleCryptoAlg;
+//# sourceMappingURL=mapCoseAlgToWebCryptoAlg.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..eb97769be85130aebe3d5c127f463e739198a8e1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mapCoseAlgToWebCryptoAlg.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAetE"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js
new file mode 100644
index 0000000000000000000000000000000000000000..b383bd9e455dc5bc556b391e02d0992b7c5ea495
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js
@@ -0,0 +1,23 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.mapCoseAlgToWebCryptoAlg = mapCoseAlgToWebCryptoAlg;
+const cose_js_1 = require("../../cose.js");
+/**
+ * Convert a COSE alg ID into a corresponding string value that WebCrypto APIs expect
+ */
+function mapCoseAlgToWebCryptoAlg(alg) {
+ if ([cose_js_1.COSEALG.RS1].indexOf(alg) >= 0) {
+ return 'SHA-1';
+ }
+ else if ([cose_js_1.COSEALG.ES256, cose_js_1.COSEALG.PS256, cose_js_1.COSEALG.RS256].indexOf(alg) >= 0) {
+ return 'SHA-256';
+ }
+ else if ([cose_js_1.COSEALG.ES384, cose_js_1.COSEALG.PS384, cose_js_1.COSEALG.RS384].indexOf(alg) >= 0) {
+ return 'SHA-384';
+ }
+ else if ([cose_js_1.COSEALG.ES512, cose_js_1.COSEALG.PS512, cose_js_1.COSEALG.RS512, cose_js_1.COSEALG.EdDSA].indexOf(alg) >=
+ 0) {
+ return 'SHA-512';
+ }
+ throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto alg`);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..aff93860b716d39969c5a862d2964bb36626fc79
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts
@@ -0,0 +1,7 @@
+import { COSEALG } from '../../cose.js';
+import { SubtleCryptoKeyAlgName } from './structs.js';
+/**
+ * Convert a COSE alg ID into a corresponding key algorithm string value that WebCrypto APIs expect
+ */
+export declare function mapCoseAlgToWebCryptoKeyAlgName(alg: COSEALG): SubtleCryptoKeyAlgName;
+//# sourceMappingURL=mapCoseAlgToWebCryptoKeyAlgName.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..376b94bb48c955d08c1fe2bfc974ddbc30af8e64
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mapCoseAlgToWebCryptoKeyAlgName.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,OAAO,GACX,sBAAsB,CAoBxB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js
new file mode 100644
index 0000000000000000000000000000000000000000..e41484302f9de4465bbe2e95bd7e775320d08eaf
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js
@@ -0,0 +1,22 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.mapCoseAlgToWebCryptoKeyAlgName = mapCoseAlgToWebCryptoKeyAlgName;
+const cose_js_1 = require("../../cose.js");
+/**
+ * Convert a COSE alg ID into a corresponding key algorithm string value that WebCrypto APIs expect
+ */
+function mapCoseAlgToWebCryptoKeyAlgName(alg) {
+ if ([cose_js_1.COSEALG.EdDSA].indexOf(alg) >= 0) {
+ return 'Ed25519';
+ }
+ else if ([cose_js_1.COSEALG.ES256, cose_js_1.COSEALG.ES384, cose_js_1.COSEALG.ES512, cose_js_1.COSEALG.ES256K].indexOf(alg) >= 0) {
+ return 'ECDSA';
+ }
+ else if ([cose_js_1.COSEALG.RS256, cose_js_1.COSEALG.RS384, cose_js_1.COSEALG.RS512, cose_js_1.COSEALG.RS1].indexOf(alg) >= 0) {
+ return 'RSASSA-PKCS1-v1_5';
+ }
+ else if ([cose_js_1.COSEALG.PS256, cose_js_1.COSEALG.PS384, cose_js_1.COSEALG.PS512].indexOf(alg) >= 0) {
+ return 'RSA-PSS';
+ }
+ throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto key alg name`);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/structs.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/structs.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4e68064dc26ee67de25625692b81d8b988d154c0
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/structs.d.ts
@@ -0,0 +1,4 @@
+export type SubtleCryptoAlg = 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
+export type SubtleCryptoCrv = 'P-256' | 'P-384' | 'P-521' | 'Ed25519';
+export type SubtleCryptoKeyAlgName = 'ECDSA' | 'Ed25519' | 'RSASSA-PKCS1-v1_5' | 'RSA-PSS';
+//# sourceMappingURL=structs.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/structs.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/structs.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..2ec1f4e30f80fbf1cb2f9be459370a5a6e3641c2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/structs.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"structs.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/structs.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AACtE,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,SAAS,GACT,mBAAmB,GACnB,SAAS,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/structs.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/structs.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/structs.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..58b63a1baf8d74f713d46d6919c504296fc1c288
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts
@@ -0,0 +1,9 @@
+import { COSECRV } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * In WebAuthn, EC2 signatures are wrapped in ASN.1 structure so we need to peel r and s apart.
+ *
+ * See https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types
+ */
+export declare function unwrapEC2Signature(signature: Uint8Array_, crv: COSECRV): Uint8Array_;
+//# sourceMappingURL=unwrapEC2Signature.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..4ab842a51b1a1d8d5d19a81a7b5f7f704c2f7ad0
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"unwrapEC2Signature.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/unwrapEC2Signature.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,OAAO,GAAG,WAAW,CAepF"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/unwrapEC2Signature.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/unwrapEC2Signature.js
new file mode 100644
index 0000000000000000000000000000000000000000..dfd5af73a71d1740974242cb8becfd7a6ff7207b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/unwrapEC2Signature.js
@@ -0,0 +1,76 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.unwrapEC2Signature = unwrapEC2Signature;
+const asn1_schema_1 = require("@peculiar/asn1-schema");
+const asn1_ecc_1 = require("@peculiar/asn1-ecc");
+const cose_js_1 = require("../../cose.js");
+const index_js_1 = require("../index.js");
+/**
+ * In WebAuthn, EC2 signatures are wrapped in ASN.1 structure so we need to peel r and s apart.
+ *
+ * See https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types
+ */
+function unwrapEC2Signature(signature, crv) {
+ const parsedSignature = asn1_schema_1.AsnParser.parse(signature, asn1_ecc_1.ECDSASigValue);
+ const rBytes = new Uint8Array(parsedSignature.r);
+ const sBytes = new Uint8Array(parsedSignature.s);
+ const componentLength = getSignatureComponentLength(crv);
+ const rNormalizedBytes = toNormalizedBytes(rBytes, componentLength);
+ const sNormalizedBytes = toNormalizedBytes(sBytes, componentLength);
+ const finalSignature = index_js_1.isoUint8Array.concat([
+ rNormalizedBytes,
+ sNormalizedBytes,
+ ]);
+ return finalSignature;
+}
+/**
+ * The SubtleCrypto Web Crypto API expects ECDSA signatures with `r` and `s` values to be encoded
+ * to a specific length depending on the order of the curve. This function returns the expected
+ * byte-length for each of the `r` and `s` signature components.
+ *
+ * See
+ */
+function getSignatureComponentLength(crv) {
+ switch (crv) {
+ case cose_js_1.COSECRV.P256:
+ return 32;
+ case cose_js_1.COSECRV.P384:
+ return 48;
+ case cose_js_1.COSECRV.P521:
+ return 66;
+ default:
+ throw new Error(`Unexpected COSE crv value of ${crv} (EC2)`);
+ }
+}
+/**
+ * Converts the ASN.1 integer representation to bytes of a specific length `n`.
+ *
+ * DER encodes integers as big-endian byte arrays, with as small as possible representation and
+ * requires a leading `0` byte to disambiguate between negative and positive numbers. This means
+ * that `r` and `s` can potentially not be the expected byte-length that is needed by the
+ * SubtleCrypto Web Crypto API: if there are leading `0`s it can be shorter than expected, and if
+ * it has a leading `1` bit, it can be one byte longer.
+ *
+ * See
+ * See
+ */
+function toNormalizedBytes(bytes, componentLength) {
+ let normalizedBytes;
+ if (bytes.length < componentLength) {
+ // In case the bytes are shorter than expected, we need to pad it with leading `0`s.
+ normalizedBytes = new Uint8Array(componentLength);
+ normalizedBytes.set(bytes, componentLength - bytes.length);
+ }
+ else if (bytes.length === componentLength) {
+ normalizedBytes = bytes;
+ }
+ else if (bytes.length === componentLength + 1 && bytes[0] === 0 && (bytes[1] & 0x80) === 0x80) {
+ // The bytes contain a leading `0` to encode that the integer is positive. This leading `0`
+ // needs to be removed for compatibility with the SubtleCrypto Web Crypto API.
+ normalizedBytes = bytes.subarray(1);
+ }
+ else {
+ throw new Error(`Invalid signature component length ${bytes.length}, expected ${componentLength}`);
+ }
+ return normalizedBytes;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verify.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verify.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f64e05ea6054631ec5c79cb3d51f781a41970fb6
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verify.d.ts
@@ -0,0 +1,12 @@
+import { type COSEALG, type COSEPublicKey } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Verify signatures with their public key. Supports EC2 and RSA public keys.
+ */
+export declare function verify(opts: {
+ cosePublicKey: COSEPublicKey;
+ signature: Uint8Array_;
+ data: Uint8Array_;
+ shaHashOverride?: COSEALG;
+}): Promise;
+//# sourceMappingURL=verify.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verify.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verify.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..65c9d7d6980da2c06ec7ca668d41992ff917e5d7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verify.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,aAAa,EAKnB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBnB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verify.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verify.js
new file mode 100644
index 0000000000000000000000000000000000000000..f660001e526a7819a3c2e30f1878d7f9536a1f45
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verify.js
@@ -0,0 +1,35 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verify = verify;
+const cose_js_1 = require("../../cose.js");
+const verifyEC2_js_1 = require("./verifyEC2.js");
+const verifyRSA_js_1 = require("./verifyRSA.js");
+const verifyOKP_js_1 = require("./verifyOKP.js");
+const unwrapEC2Signature_js_1 = require("./unwrapEC2Signature.js");
+/**
+ * Verify signatures with their public key. Supports EC2 and RSA public keys.
+ */
+function verify(opts) {
+ const { cosePublicKey, signature, data, shaHashOverride } = opts;
+ if ((0, cose_js_1.isCOSEPublicKeyEC2)(cosePublicKey)) {
+ const crv = cosePublicKey.get(cose_js_1.COSEKEYS.crv);
+ if (!(0, cose_js_1.isCOSECrv)(crv)) {
+ throw new Error(`unknown COSE curve ${crv}`);
+ }
+ const unwrappedSignature = (0, unwrapEC2Signature_js_1.unwrapEC2Signature)(signature, crv);
+ return (0, verifyEC2_js_1.verifyEC2)({
+ cosePublicKey,
+ signature: unwrappedSignature,
+ data,
+ shaHashOverride,
+ });
+ }
+ else if ((0, cose_js_1.isCOSEPublicKeyRSA)(cosePublicKey)) {
+ return (0, verifyRSA_js_1.verifyRSA)({ cosePublicKey, signature, data, shaHashOverride });
+ }
+ else if ((0, cose_js_1.isCOSEPublicKeyOKP)(cosePublicKey)) {
+ return (0, verifyOKP_js_1.verifyOKP)({ cosePublicKey, signature, data });
+ }
+ const kty = cosePublicKey.get(cose_js_1.COSEKEYS.kty);
+ throw new Error(`Signature verification with public key of kty ${kty} is not supported by this method`);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyEC2.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyEC2.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9d6643412470a00b52ea5f787d66fb97a3af14c6
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyEC2.d.ts
@@ -0,0 +1,12 @@
+import { type COSEALG, type COSEPublicKeyEC2 } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Verify a signature using an EC2 public key
+ */
+export declare function verifyEC2(opts: {
+ cosePublicKey: COSEPublicKeyEC2;
+ signature: Uint8Array_;
+ data: Uint8Array_;
+ shaHashOverride?: COSEALG;
+}): Promise;
+//# sourceMappingURL=verifyEC2.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyEC2.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyEC2.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..c80307d915017aaf30947b07cdb8430a85c7cfa9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyEC2.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyEC2.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verifyEC2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAMvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CA0EnB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyEC2.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyEC2.js
new file mode 100644
index 0000000000000000000000000000000000000000..4eff623d5e978f296920433e0f446d24216edf7e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyEC2.js
@@ -0,0 +1,76 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyEC2 = verifyEC2;
+const cose_js_1 = require("../../cose.js");
+const mapCoseAlgToWebCryptoAlg_js_1 = require("./mapCoseAlgToWebCryptoAlg.js");
+const importKey_js_1 = require("./importKey.js");
+const index_js_1 = require("../index.js");
+const getWebCrypto_js_1 = require("./getWebCrypto.js");
+/**
+ * Verify a signature using an EC2 public key
+ */
+async function verifyEC2(opts) {
+ const { cosePublicKey, signature, data, shaHashOverride } = opts;
+ const WebCrypto = await (0, getWebCrypto_js_1.getWebCrypto)();
+ // Import the public key
+ const alg = cosePublicKey.get(cose_js_1.COSEKEYS.alg);
+ const crv = cosePublicKey.get(cose_js_1.COSEKEYS.crv);
+ const x = cosePublicKey.get(cose_js_1.COSEKEYS.x);
+ const y = cosePublicKey.get(cose_js_1.COSEKEYS.y);
+ if (!alg) {
+ throw new Error('Public key was missing alg (EC2)');
+ }
+ if (!crv) {
+ throw new Error('Public key was missing crv (EC2)');
+ }
+ if (!x) {
+ throw new Error('Public key was missing x (EC2)');
+ }
+ if (!y) {
+ throw new Error('Public key was missing y (EC2)');
+ }
+ let _crv;
+ if (crv === cose_js_1.COSECRV.P256) {
+ _crv = 'P-256';
+ }
+ else if (crv === cose_js_1.COSECRV.P384) {
+ _crv = 'P-384';
+ }
+ else if (crv === cose_js_1.COSECRV.P521) {
+ _crv = 'P-521';
+ }
+ else {
+ throw new Error(`Unexpected COSE crv value of ${crv} (EC2)`);
+ }
+ const keyData = {
+ kty: 'EC',
+ crv: _crv,
+ x: index_js_1.isoBase64URL.fromBuffer(x),
+ y: index_js_1.isoBase64URL.fromBuffer(y),
+ ext: false,
+ };
+ const keyAlgorithm = {
+ /**
+ * Note to future self: you can't use `mapCoseAlgToWebCryptoKeyAlgName()` here because some
+ * leaf certs from actual devices specified an RSA SHA value for `alg` (e.g. `-257`) which
+ * would then map here to `'RSASSA-PKCS1-v1_5'`. We always want `'ECDSA'` here so we'll
+ * hard-code this.
+ */
+ name: 'ECDSA',
+ namedCurve: _crv,
+ };
+ const key = await (0, importKey_js_1.importKey)({
+ keyData,
+ algorithm: keyAlgorithm,
+ });
+ // Determine which SHA algorithm to use for signature verification
+ let subtleAlg = (0, mapCoseAlgToWebCryptoAlg_js_1.mapCoseAlgToWebCryptoAlg)(alg);
+ if (shaHashOverride) {
+ subtleAlg = (0, mapCoseAlgToWebCryptoAlg_js_1.mapCoseAlgToWebCryptoAlg)(shaHashOverride);
+ }
+ const verifyAlgorithm = {
+ name: 'ECDSA',
+ hash: { name: subtleAlg },
+ };
+ return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyOKP.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyOKP.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4c7663f81170b8c07c0041cdb509d3a8838ba909
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyOKP.d.ts
@@ -0,0 +1,8 @@
+import { type COSEPublicKeyOKP } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+export declare function verifyOKP(opts: {
+ cosePublicKey: COSEPublicKeyOKP;
+ signature: Uint8Array_;
+ data: Uint8Array_;
+}): Promise;
+//# sourceMappingURL=verifyOKP.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyOKP.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyOKP.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..fe778027ac68f06aa58514f9f5529a698b5b1da9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyOKP.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyOKP.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verifyOKP.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,gBAAgB,EAAa,MAAM,eAAe,CAAC;AAKpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;CACnB,GAAG,OAAO,CAAC,OAAO,CAAC,CAyDnB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyOKP.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyOKP.js
new file mode 100644
index 0000000000000000000000000000000000000000..cc958034c90b82d1a2d7e02c695fb3de2f275b2d
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyOKP.js
@@ -0,0 +1,54 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyOKP = verifyOKP;
+const cose_js_1 = require("../../cose.js");
+const index_js_1 = require("../../index.js");
+const importKey_js_1 = require("./importKey.js");
+const getWebCrypto_js_1 = require("./getWebCrypto.js");
+async function verifyOKP(opts) {
+ const { cosePublicKey, signature, data } = opts;
+ const WebCrypto = await (0, getWebCrypto_js_1.getWebCrypto)();
+ const alg = cosePublicKey.get(cose_js_1.COSEKEYS.alg);
+ const crv = cosePublicKey.get(cose_js_1.COSEKEYS.crv);
+ const x = cosePublicKey.get(cose_js_1.COSEKEYS.x);
+ if (!alg) {
+ throw new Error('Public key was missing alg (OKP)');
+ }
+ if (!(0, cose_js_1.isCOSEAlg)(alg)) {
+ throw new Error(`Public key had invalid alg ${alg} (OKP)`);
+ }
+ if (!crv) {
+ throw new Error('Public key was missing crv (OKP)');
+ }
+ if (!x) {
+ throw new Error('Public key was missing x (OKP)');
+ }
+ // Pulled key import steps from here:
+ // https://wicg.github.io/webcrypto-secure-curves/#ed25519-operations
+ let _crv;
+ if (crv === cose_js_1.COSECRV.ED25519) {
+ _crv = 'Ed25519';
+ }
+ else {
+ throw new Error(`Unexpected COSE crv value of ${crv} (OKP)`);
+ }
+ const keyData = {
+ kty: 'OKP',
+ crv: _crv,
+ alg: 'EdDSA',
+ x: index_js_1.isoBase64URL.fromBuffer(x),
+ ext: false,
+ };
+ const keyAlgorithm = {
+ name: _crv,
+ namedCurve: _crv,
+ };
+ const key = await (0, importKey_js_1.importKey)({
+ keyData,
+ algorithm: keyAlgorithm,
+ });
+ const verifyAlgorithm = {
+ name: _crv,
+ };
+ return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyRSA.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyRSA.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..67ba29c2240f9ddea5744b6c0d8bed8e4b368c23
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyRSA.d.ts
@@ -0,0 +1,12 @@
+import { type COSEALG, type COSEPublicKeyRSA } from '../../cose.js';
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Verify a signature using an RSA public key
+ */
+export declare function verifyRSA(opts: {
+ cosePublicKey: COSEPublicKeyRSA;
+ signature: Uint8Array_;
+ data: Uint8Array_;
+ shaHashOverride?: COSEALG;
+}): Promise;
+//# sourceMappingURL=verifyRSA.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyRSA.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyRSA.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..5b78feaf25468fae03ce3ce02db26205366dcbc2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyRSA.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyRSA.d.ts","sourceRoot":"","sources":["../../../../src/helpers/iso/isoCrypto/verifyRSA.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAY,KAAK,gBAAgB,EAAa,MAAM,eAAe,CAAC;AAMzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CA2FnB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyRSA.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyRSA.js
new file mode 100644
index 0000000000000000000000000000000000000000..251a9e4b8b059d2c648d3b9585048eb1eb9b24c3
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyRSA.js
@@ -0,0 +1,94 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyRSA = verifyRSA;
+const cose_js_1 = require("../../cose.js");
+const mapCoseAlgToWebCryptoAlg_js_1 = require("./mapCoseAlgToWebCryptoAlg.js");
+const importKey_js_1 = require("./importKey.js");
+const index_js_1 = require("../index.js");
+const mapCoseAlgToWebCryptoKeyAlgName_js_1 = require("./mapCoseAlgToWebCryptoKeyAlgName.js");
+const getWebCrypto_js_1 = require("./getWebCrypto.js");
+/**
+ * Verify a signature using an RSA public key
+ */
+async function verifyRSA(opts) {
+ const { cosePublicKey, signature, data, shaHashOverride } = opts;
+ const WebCrypto = await (0, getWebCrypto_js_1.getWebCrypto)();
+ const alg = cosePublicKey.get(cose_js_1.COSEKEYS.alg);
+ const n = cosePublicKey.get(cose_js_1.COSEKEYS.n);
+ const e = cosePublicKey.get(cose_js_1.COSEKEYS.e);
+ if (!alg) {
+ throw new Error('Public key was missing alg (RSA)');
+ }
+ if (!(0, cose_js_1.isCOSEAlg)(alg)) {
+ throw new Error(`Public key had invalid alg ${alg} (RSA)`);
+ }
+ if (!n) {
+ throw new Error('Public key was missing n (RSA)');
+ }
+ if (!e) {
+ throw new Error('Public key was missing e (RSA)');
+ }
+ const keyData = {
+ kty: 'RSA',
+ alg: '',
+ n: index_js_1.isoBase64URL.fromBuffer(n),
+ e: index_js_1.isoBase64URL.fromBuffer(e),
+ ext: false,
+ };
+ const keyAlgorithm = {
+ name: (0, mapCoseAlgToWebCryptoKeyAlgName_js_1.mapCoseAlgToWebCryptoKeyAlgName)(alg),
+ hash: { name: (0, mapCoseAlgToWebCryptoAlg_js_1.mapCoseAlgToWebCryptoAlg)(alg) },
+ };
+ const verifyAlgorithm = {
+ name: (0, mapCoseAlgToWebCryptoKeyAlgName_js_1.mapCoseAlgToWebCryptoKeyAlgName)(alg),
+ };
+ if (shaHashOverride) {
+ keyAlgorithm.hash.name = (0, mapCoseAlgToWebCryptoAlg_js_1.mapCoseAlgToWebCryptoAlg)(shaHashOverride);
+ }
+ if (keyAlgorithm.name === 'RSASSA-PKCS1-v1_5') {
+ if (keyAlgorithm.hash.name === 'SHA-256') {
+ keyData.alg = 'RS256';
+ }
+ else if (keyAlgorithm.hash.name === 'SHA-384') {
+ keyData.alg = 'RS384';
+ }
+ else if (keyAlgorithm.hash.name === 'SHA-512') {
+ keyData.alg = 'RS512';
+ }
+ else if (keyAlgorithm.hash.name === 'SHA-1') {
+ keyData.alg = 'RS1';
+ }
+ }
+ else if (keyAlgorithm.name === 'RSA-PSS') {
+ /**
+ * salt length. The default value is 20 but the convention is to use hLen, the length of the
+ * output of the hash function in bytes. A salt length of zero is permitted and will result in
+ * a deterministic signature value. The actual salt length used can be determined from the
+ * signature value.
+ *
+ * From https://www.cryptosys.net/pki/manpki/pki_rsaschemes.html
+ */
+ let saltLength = 0;
+ if (keyAlgorithm.hash.name === 'SHA-256') {
+ keyData.alg = 'PS256';
+ saltLength = 32; // 256 bits => 32 bytes
+ }
+ else if (keyAlgorithm.hash.name === 'SHA-384') {
+ keyData.alg = 'PS384';
+ saltLength = 48; // 384 bits => 48 bytes
+ }
+ else if (keyAlgorithm.hash.name === 'SHA-512') {
+ keyData.alg = 'PS512';
+ saltLength = 64; // 512 bits => 64 bytes
+ }
+ verifyAlgorithm.saltLength = saltLength;
+ }
+ else {
+ throw new Error(`Unexpected RSA key algorithm ${alg} (${keyAlgorithm.name})`);
+ }
+ const key = await (0, importKey_js_1.importKey)({
+ keyData,
+ algorithm: keyAlgorithm,
+ });
+ return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoUint8Array.d.ts b/node_modules/@simplewebauthn/server/script/helpers/iso/isoUint8Array.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0edbf7984fc2d1ff577c0a93fdd3cbf34d2eb1ea
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoUint8Array.d.ts
@@ -0,0 +1,42 @@
+import type { Uint8Array_ } from '../../types/index.js';
+/**
+ * A runtime-agnostic collection of methods for working with Uint8Arrays
+ * @module
+ */
+/**
+ * Make sure two Uint8Arrays are deeply equivalent
+ */
+export declare function areEqual(array1: Uint8Array_, array2: Uint8Array_): boolean;
+/**
+ * Convert a Uint8Array to Hexadecimal.
+ *
+ * A replacement for `Buffer.toString('hex')`
+ */
+export declare function toHex(array: Uint8Array_): string;
+/**
+ * Convert a hexadecimal string to isoUint8Array.
+ *
+ * A replacement for `Buffer.from('...', 'hex')`
+ */
+export declare function fromHex(hex: string): Uint8Array_;
+/**
+ * Combine multiple Uint8Arrays into a single Uint8Array
+ */
+export declare function concat(arrays: Uint8Array_[]): Uint8Array_;
+/**
+ * Convert bytes into a UTF-8 string
+ */
+export declare function toUTF8String(array: Uint8Array_): string;
+/**
+ * Convert a UTF-8 string back into bytes
+ */
+export declare function fromUTF8String(utf8String: string): Uint8Array_;
+/**
+ * Convert an ASCII string to Uint8Array
+ */
+export declare function fromASCIIString(value: string): Uint8Array_;
+/**
+ * Prepare a DataView we can slice our way around in as we parse the bytes in a Uint8Array
+ */
+export declare function toDataView(array: Uint8Array_): DataView;
+//# sourceMappingURL=isoUint8Array.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoUint8Array.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/iso/isoUint8Array.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..9d5e4a024648949967589ec48a82a30bf910068c
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoUint8Array.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"isoUint8Array.d.ts","sourceRoot":"","sources":["../../../src/helpers/iso/isoUint8Array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAM1E;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAKhD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAehD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAYzD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAGvD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAG9D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAE1D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,CAEvD"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/iso/isoUint8Array.js b/node_modules/@simplewebauthn/server/script/helpers/iso/isoUint8Array.js
new file mode 100644
index 0000000000000000000000000000000000000000..f68abe0e40d3a8e9fa56b5df07a95eb7ad1f4986
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/iso/isoUint8Array.js
@@ -0,0 +1,89 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.areEqual = areEqual;
+exports.toHex = toHex;
+exports.fromHex = fromHex;
+exports.concat = concat;
+exports.toUTF8String = toUTF8String;
+exports.fromUTF8String = fromUTF8String;
+exports.fromASCIIString = fromASCIIString;
+exports.toDataView = toDataView;
+/**
+ * A runtime-agnostic collection of methods for working with Uint8Arrays
+ * @module
+ */
+/**
+ * Make sure two Uint8Arrays are deeply equivalent
+ */
+function areEqual(array1, array2) {
+ if (array1.length != array2.length) {
+ return false;
+ }
+ return array1.every((val, i) => val === array2[i]);
+}
+/**
+ * Convert a Uint8Array to Hexadecimal.
+ *
+ * A replacement for `Buffer.toString('hex')`
+ */
+function toHex(array) {
+ const hexParts = Array.from(array, (i) => i.toString(16).padStart(2, '0'));
+ // adce000235bcc60a648b0b25f1f05503
+ return hexParts.join('');
+}
+/**
+ * Convert a hexadecimal string to isoUint8Array.
+ *
+ * A replacement for `Buffer.from('...', 'hex')`
+ */
+function fromHex(hex) {
+ if (!hex) {
+ return Uint8Array.from([]);
+ }
+ const isValid = hex.length !== 0 && hex.length % 2 === 0 &&
+ !/[^a-fA-F0-9]/u.test(hex);
+ if (!isValid) {
+ throw new Error('Invalid hex string');
+ }
+ const byteStrings = hex.match(/.{1,2}/g) ?? [];
+ return Uint8Array.from(byteStrings.map((byte) => parseInt(byte, 16)));
+}
+/**
+ * Combine multiple Uint8Arrays into a single Uint8Array
+ */
+function concat(arrays) {
+ let pointer = 0;
+ const totalLength = arrays.reduce((prev, curr) => prev + curr.length, 0);
+ const toReturn = new Uint8Array(totalLength);
+ arrays.forEach((arr) => {
+ toReturn.set(arr, pointer);
+ pointer += arr.length;
+ });
+ return toReturn;
+}
+/**
+ * Convert bytes into a UTF-8 string
+ */
+function toUTF8String(array) {
+ const decoder = new globalThis.TextDecoder('utf-8');
+ return decoder.decode(array);
+}
+/**
+ * Convert a UTF-8 string back into bytes
+ */
+function fromUTF8String(utf8String) {
+ const encoder = new globalThis.TextEncoder();
+ return encoder.encode(utf8String);
+}
+/**
+ * Convert an ASCII string to Uint8Array
+ */
+function fromASCIIString(value) {
+ return Uint8Array.from(value.split('').map((x) => x.charCodeAt(0)));
+}
+/**
+ * Prepare a DataView we can slice our way around in as we parse the bytes in a Uint8Array
+ */
+function toDataView(array) {
+ return new DataView(array.buffer, array.byteOffset, array.length);
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/logging.d.ts b/node_modules/@simplewebauthn/server/script/helpers/logging.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5a721ebc799b5172764667900babe9eecd499170
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/logging.d.ts
@@ -0,0 +1,16 @@
+/**
+ * Generate an instance of a `debug` logger that extends off of the "simplewebauthn" namespace for
+ * consistent naming.
+ *
+ * See https://www.npmjs.com/package/debug for information on how to control logging output when
+ * using @simplewebauthn/server
+ *
+ * Example:
+ *
+ * ```
+ * const log = getLogger('mds');
+ * log('hello'); // simplewebauthn:mds hello +0ms
+ * ```
+ */
+export declare function getLogger(_name: string): (message: string, ..._rest: unknown[]) => void;
+//# sourceMappingURL=logging.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/logging.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/logging.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..91e9b378e760b821386683d4f643c2bc7c7c2033
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/logging.d.ts.map
@@ -0,0 +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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/logging.js b/node_modules/@simplewebauthn/server/script/helpers/logging.js
new file mode 100644
index 0000000000000000000000000000000000000000..a9b701d2182470110c2b6e2e805fdce651e72850
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/logging.js
@@ -0,0 +1,22 @@
+"use strict";
+// const defaultLogger = debug('SimpleWebAuthn');
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getLogger = getLogger;
+/**
+ * Generate an instance of a `debug` logger that extends off of the "simplewebauthn" namespace for
+ * consistent naming.
+ *
+ * See https://www.npmjs.com/package/debug for information on how to control logging output when
+ * using @simplewebauthn/server
+ *
+ * Example:
+ *
+ * ```
+ * const log = getLogger('mds');
+ * log('hello'); // simplewebauthn:mds hello +0ms
+ * ```
+ */
+function getLogger(_name) {
+ // This is a noop for now while I search for a better debug logger technique
+ return (_message, ..._rest) => { };
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts b/node_modules/@simplewebauthn/server/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9ca5bea7849c9c3b505be00920ae2b79308f4db5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts
@@ -0,0 +1,9 @@
+import { COSEALG } from './cose.js';
+/**
+ * Map X.509 signature algorithm OIDs to COSE algorithm IDs
+ *
+ * - EC2 OIDs: https://oidref.com/1.2.840.10045.4.3
+ * - RSA OIDs: https://oidref.com/1.2.840.113549.1.1
+ */
+export declare function mapX509SignatureAlgToCOSEAlg(signatureAlgorithm: string): COSEALG;
+//# sourceMappingURL=mapX509SignatureAlgToCOSEAlg.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..41bdd730e05c8b3956f3addfbda8539c39334c0e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map
@@ -0,0 +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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/mapX509SignatureAlgToCOSEAlg.js b/node_modules/@simplewebauthn/server/script/helpers/mapX509SignatureAlgToCOSEAlg.js
new file mode 100644
index 0000000000000000000000000000000000000000..baaaebeae346aa4e84fc57261ec4e0ea06944e94
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/mapX509SignatureAlgToCOSEAlg.js
@@ -0,0 +1,38 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.mapX509SignatureAlgToCOSEAlg = mapX509SignatureAlgToCOSEAlg;
+const cose_js_1 = require("./cose.js");
+/**
+ * Map X.509 signature algorithm OIDs to COSE algorithm IDs
+ *
+ * - EC2 OIDs: https://oidref.com/1.2.840.10045.4.3
+ * - RSA OIDs: https://oidref.com/1.2.840.113549.1.1
+ */
+function mapX509SignatureAlgToCOSEAlg(signatureAlgorithm) {
+ let alg;
+ if (signatureAlgorithm === '1.2.840.10045.4.3.2') {
+ alg = cose_js_1.COSEALG.ES256;
+ }
+ else if (signatureAlgorithm === '1.2.840.10045.4.3.3') {
+ alg = cose_js_1.COSEALG.ES384;
+ }
+ else if (signatureAlgorithm === '1.2.840.10045.4.3.4') {
+ alg = cose_js_1.COSEALG.ES512;
+ }
+ else if (signatureAlgorithm === '1.2.840.113549.1.1.11') {
+ alg = cose_js_1.COSEALG.RS256;
+ }
+ else if (signatureAlgorithm === '1.2.840.113549.1.1.12') {
+ alg = cose_js_1.COSEALG.RS384;
+ }
+ else if (signatureAlgorithm === '1.2.840.113549.1.1.13') {
+ alg = cose_js_1.COSEALG.RS512;
+ }
+ else if (signatureAlgorithm === '1.2.840.113549.1.1.5') {
+ alg = cose_js_1.COSEALG.RS1;
+ }
+ else {
+ throw new Error(`Unable to map X.509 signature algorithm ${signatureAlgorithm} to a COSE algorithm`);
+ }
+ return alg;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/matchExpectedRPID.d.ts b/node_modules/@simplewebauthn/server/script/helpers/matchExpectedRPID.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..df407c80f6dd7359fb52ab9316c201f29bf02441
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/matchExpectedRPID.d.ts
@@ -0,0 +1,9 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Go through each expected RP ID and try to find one that matches. Returns the unhashed RP ID
+ * that matched the hash in the response.
+ *
+ * Raises an `UnexpectedRPIDHash` error if no match is found
+ */
+export declare function matchExpectedRPID(rpIDHash: Uint8Array_, expectedRPIDs: string[]): Promise;
+//# sourceMappingURL=matchExpectedRPID.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/matchExpectedRPID.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/matchExpectedRPID.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..0b1634c16426bf2f357ad746b66cbc0ee5fd439a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/matchExpectedRPID.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"matchExpectedRPID.d.ts","sourceRoot":"","sources":["../../src/helpers/matchExpectedRPID.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,WAAW,EACrB,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,MAAM,CAAC,CA8BjB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/matchExpectedRPID.js b/node_modules/@simplewebauthn/server/script/helpers/matchExpectedRPID.js
new file mode 100644
index 0000000000000000000000000000000000000000..691ef57d906aee48f242980857c2b1bc702b58e1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/matchExpectedRPID.js
@@ -0,0 +1,44 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.matchExpectedRPID = matchExpectedRPID;
+const toHash_js_1 = require("./toHash.js");
+const index_js_1 = require("./iso/index.js");
+/**
+ * Go through each expected RP ID and try to find one that matches. Returns the unhashed RP ID
+ * that matched the hash in the response.
+ *
+ * Raises an `UnexpectedRPIDHash` error if no match is found
+ */
+async function matchExpectedRPID(rpIDHash, expectedRPIDs) {
+ try {
+ const matchedRPID = await Promise.any(expectedRPIDs.map((expected) => {
+ return new Promise((resolve, reject) => {
+ (0, toHash_js_1.toHash)(index_js_1.isoUint8Array.fromASCIIString(expected)).then((expectedRPIDHash) => {
+ if (index_js_1.isoUint8Array.areEqual(rpIDHash, expectedRPIDHash)) {
+ resolve(expected);
+ }
+ else {
+ reject();
+ }
+ });
+ });
+ }));
+ return matchedRPID;
+ }
+ catch (err) {
+ const _err = err;
+ // This means no matches were found
+ if (_err.name === 'AggregateError') {
+ throw new UnexpectedRPIDHash();
+ }
+ // An unexpected error occurred
+ throw err;
+ }
+}
+class UnexpectedRPIDHash extends Error {
+ constructor() {
+ const message = 'Unexpected RP ID hash';
+ super(message);
+ this.name = 'UnexpectedRPIDHash';
+ }
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/parseAuthenticatorData.d.ts b/node_modules/@simplewebauthn/server/script/helpers/parseAuthenticatorData.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9a9c5898fb2ddafbdd1379061225f14339a5d7df
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/parseAuthenticatorData.d.ts
@@ -0,0 +1,34 @@
+import { type AuthenticationExtensionsAuthenticatorOutputs } from './decodeAuthenticatorExtensions.js';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Make sense of the authData buffer contained in an Attestation
+ */
+export declare function parseAuthenticatorData(authData: Uint8Array_): ParsedAuthenticatorData;
+export type ParsedAuthenticatorData = {
+ rpIdHash: Uint8Array_;
+ flagsBuf: Uint8Array_;
+ flags: {
+ up: boolean;
+ uv: boolean;
+ be: boolean;
+ bs: boolean;
+ at: boolean;
+ ed: boolean;
+ flagsInt: number;
+ };
+ counter: number;
+ counterBuf: Uint8Array_;
+ aaguid?: Uint8Array_;
+ credentialID?: Uint8Array_;
+ credentialPublicKey?: Uint8Array_;
+ extensionsData?: AuthenticationExtensionsAuthenticatorOutputs;
+ extensionsDataBuffer?: Uint8Array_;
+};
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _parseAuthenticatorDataInternals: {
+ stubThis: (value: ParsedAuthenticatorData) => ParsedAuthenticatorData;
+};
+//# sourceMappingURL=parseAuthenticatorData.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/parseAuthenticatorData.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/parseAuthenticatorData.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..2ae207592c6cdaef56824eb5277dcaa67401db60
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/parseAuthenticatorData.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"parseAuthenticatorData.d.ts","sourceRoot":"","sources":["../../src/helpers/parseAuthenticatorData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,4CAA4C,EAElD,MAAM,oCAAoC,CAAC;AAG5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,WAAW,GACpB,uBAAuB,CAwHzB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,WAAW,CAAC;IACtB,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,WAAW,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,cAAc,CAAC,EAAE,4CAA4C,CAAC;IAC9D,oBAAoB,CAAC,EAAE,WAAW,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gCAAgC;sBACzB,uBAAuB;CAC1C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/parseAuthenticatorData.js b/node_modules/@simplewebauthn/server/script/helpers/parseAuthenticatorData.js
new file mode 100644
index 0000000000000000000000000000000000000000..9d50150e5abcd134cecfc1da0a6f6b6f1c2618b8
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/parseAuthenticatorData.js
@@ -0,0 +1,110 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports._parseAuthenticatorDataInternals = void 0;
+exports.parseAuthenticatorData = parseAuthenticatorData;
+const decodeAuthenticatorExtensions_js_1 = require("./decodeAuthenticatorExtensions.js");
+const index_js_1 = require("./iso/index.js");
+/**
+ * Make sense of the authData buffer contained in an Attestation
+ */
+function parseAuthenticatorData(authData) {
+ if (authData.byteLength < 37) {
+ throw new Error(`Authenticator data was ${authData.byteLength} bytes, expected at least 37 bytes`);
+ }
+ let pointer = 0;
+ const dataView = index_js_1.isoUint8Array.toDataView(authData);
+ const rpIdHash = authData.slice(pointer, pointer += 32);
+ const flagsBuf = authData.slice(pointer, pointer += 1);
+ const flagsInt = flagsBuf[0];
+ // Bit positions can be referenced here:
+ // https://www.w3.org/TR/webauthn-2/#flags
+ const flags = {
+ up: !!(flagsInt & (1 << 0)), // User Presence
+ uv: !!(flagsInt & (1 << 2)), // User Verified
+ be: !!(flagsInt & (1 << 3)), // Backup Eligibility
+ bs: !!(flagsInt & (1 << 4)), // Backup State
+ at: !!(flagsInt & (1 << 6)), // Attested Credential Data Present
+ ed: !!(flagsInt & (1 << 7)), // Extension Data Present
+ flagsInt,
+ };
+ const counterBuf = authData.slice(pointer, pointer + 4);
+ const counter = dataView.getUint32(pointer, false);
+ pointer += 4;
+ let aaguid = undefined;
+ let credentialID = undefined;
+ let credentialPublicKey = undefined;
+ if (flags.at) {
+ aaguid = authData.slice(pointer, pointer += 16);
+ const credIDLen = dataView.getUint16(pointer);
+ pointer += 2;
+ credentialID = authData.slice(pointer, pointer += credIDLen);
+ /**
+ * Firefox 117 incorrectly CBOR-encodes authData when EdDSA (-8) is used for the public key.
+ * A CBOR "Map of 3 items" (0xa3) should be "Map of 4 items" (0xa4), and if we manually adjust
+ * the single byte there's a good chance the authData can be correctly parsed.
+ *
+ * This browser release also incorrectly uses the string labels "OKP" and "Ed25519" instead of
+ * their integer representations for kty and crv respectively. That's why the COSE public key
+ * in the hex below looks so odd.
+ */
+ // Bytes decode to `{ 1: "OKP", 3: -8, -1: "Ed25519" }` (it's missing key -2 a.k.a. COSEKEYS.x)
+ const badEdDSACBOR = index_js_1.isoUint8Array.fromHex('a301634f4b500327206745643235353139');
+ const bytesAtCurrentPosition = authData.slice(pointer, pointer + badEdDSACBOR.byteLength);
+ let foundBadCBOR = false;
+ if (index_js_1.isoUint8Array.areEqual(badEdDSACBOR, bytesAtCurrentPosition)) {
+ // Change the bad CBOR 0xa3 to 0xa4 so that the credential public key can be recognized
+ foundBadCBOR = true;
+ authData[pointer] = 0xa4;
+ }
+ // Decode the next CBOR item in the buffer, then re-encode it back to a Buffer
+ const firstDecoded = index_js_1.isoCBOR.decodeFirst(authData.slice(pointer));
+ const firstEncoded = Uint8Array.from(
+ /**
+ * Casting to `Map` via `as unknown` here because TS doesn't make it possible to define Maps
+ * with discrete keys and properties with known types per pair, and CBOR libs typically parse
+ * CBOR Major Type 5 to `Map` because you can have numbers for keys. A `COSEPublicKey` can be
+ * generalized as "a Map with numbers for keys and either numbers or bytes for values" though.
+ * If this presumption falls apart then other parts of verification later on will fail so we
+ * should be safe doing this here.
+ */
+ index_js_1.isoCBOR.encode(firstDecoded));
+ if (foundBadCBOR) {
+ // Restore the bit we changed so that `authData` is the same as it came in and won't break
+ // signature verification.
+ authData[pointer] = 0xa3;
+ }
+ credentialPublicKey = firstEncoded;
+ pointer += firstEncoded.byteLength;
+ }
+ let extensionsData = undefined;
+ let extensionsDataBuffer = undefined;
+ if (flags.ed) {
+ const firstDecoded = index_js_1.isoCBOR.decodeFirst(authData.slice(pointer));
+ extensionsDataBuffer = Uint8Array.from(index_js_1.isoCBOR.encode(firstDecoded));
+ extensionsData = (0, decodeAuthenticatorExtensions_js_1.decodeAuthenticatorExtensions)(extensionsDataBuffer);
+ pointer += extensionsDataBuffer.byteLength;
+ }
+ // Pointer should be at the end of the authenticator data, otherwise too much data was sent
+ if (authData.byteLength > pointer) {
+ throw new Error('Leftover bytes detected while parsing authenticator data');
+ }
+ return exports._parseAuthenticatorDataInternals.stubThis({
+ rpIdHash,
+ flagsBuf,
+ flags,
+ counter,
+ counterBuf,
+ aaguid,
+ credentialID,
+ credentialPublicKey,
+ extensionsData,
+ extensionsDataBuffer,
+ });
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+exports._parseAuthenticatorDataInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/script/helpers/parseBackupFlags.d.ts b/node_modules/@simplewebauthn/server/script/helpers/parseBackupFlags.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..284a6cc5c7c059e83458feb249b81dfa97f85879
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/parseBackupFlags.d.ts
@@ -0,0 +1,20 @@
+import type { CredentialDeviceType } from '../types/index.js';
+/**
+ * Make sense of Bits 3 and 4 in authenticator indicating:
+ *
+ * - Whether the credential can be used on multiple devices
+ * - Whether the credential is backed up or not
+ *
+ * Invalid configurations will raise an `Error`
+ */
+export declare function parseBackupFlags({ be, bs }: {
+ be: boolean;
+ bs: boolean;
+}): {
+ credentialDeviceType: CredentialDeviceType;
+ credentialBackedUp: boolean;
+};
+export declare class InvalidBackupFlags extends Error {
+ constructor(message: string);
+}
+//# sourceMappingURL=parseBackupFlags.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/parseBackupFlags.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/parseBackupFlags.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..69ed26edd983b1a7270994a6d0e28cf7ec31588f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/parseBackupFlags.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"parseBackupFlags.d.ts","sourceRoot":"","sources":["../../src/helpers/parseBackupFlags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;;;;;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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/parseBackupFlags.js b/node_modules/@simplewebauthn/server/script/helpers/parseBackupFlags.js
new file mode 100644
index 0000000000000000000000000000000000000000..61385c5b269003d96320dc158460094bdc65728d
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/parseBackupFlags.js
@@ -0,0 +1,30 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.InvalidBackupFlags = void 0;
+exports.parseBackupFlags = parseBackupFlags;
+/**
+ * Make sense of Bits 3 and 4 in authenticator indicating:
+ *
+ * - Whether the credential can be used on multiple devices
+ * - Whether the credential is backed up or not
+ *
+ * Invalid configurations will raise an `Error`
+ */
+function parseBackupFlags({ be, bs }) {
+ const credentialBackedUp = bs;
+ let credentialDeviceType = 'singleDevice';
+ if (be) {
+ credentialDeviceType = 'multiDevice';
+ }
+ if (credentialDeviceType === 'singleDevice' && credentialBackedUp) {
+ throw new InvalidBackupFlags('Single-device credential indicated that it was backed up, which should be impossible.');
+ }
+ return { credentialDeviceType, credentialBackedUp };
+}
+class InvalidBackupFlags extends Error {
+ constructor(message) {
+ super(message);
+ this.name = 'InvalidBackupFlags';
+ }
+}
+exports.InvalidBackupFlags = InvalidBackupFlags;
diff --git a/node_modules/@simplewebauthn/server/script/helpers/toHash.d.ts b/node_modules/@simplewebauthn/server/script/helpers/toHash.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1a0039fe5ad1d77b9481d4136c1a04c30f08c56e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/toHash.d.ts
@@ -0,0 +1,8 @@
+import type { COSEALG } from './cose.js';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Returns hash digest of the given data, using the given algorithm when provided. Defaults to using
+ * SHA-256.
+ */
+export declare function toHash(data: Uint8Array_ | string, algorithm?: COSEALG): Promise;
+//# sourceMappingURL=toHash.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/toHash.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/toHash.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..00c9c61d7804638b195470509d29b0002b9f2b74
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/toHash.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"toHash.d.ts","sourceRoot":"","sources":["../../src/helpers/toHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;GAGG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,WAAW,GAAG,MAAM,EAC1B,SAAS,GAAE,OAAY,GACtB,OAAO,CAAC,WAAW,CAAC,CAQtB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/toHash.js b/node_modules/@simplewebauthn/server/script/helpers/toHash.js
new file mode 100644
index 0000000000000000000000000000000000000000..50cb936e00badd849a667011f5c6cd186313e4ba
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/toHash.js
@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.toHash = toHash;
+const index_js_1 = require("./iso/index.js");
+/**
+ * Returns hash digest of the given data, using the given algorithm when provided. Defaults to using
+ * SHA-256.
+ */
+function toHash(data, algorithm = -7) {
+ if (typeof data === 'string') {
+ data = index_js_1.isoUint8Array.fromUTF8String(data);
+ }
+ const digest = index_js_1.isoCrypto.digest(data, algorithm);
+ return digest;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/validateCertificatePath.d.ts b/node_modules/@simplewebauthn/server/script/helpers/validateCertificatePath.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a9bcf6a9d38ff8cd44463f6f617a26682f5dd9df
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/validateCertificatePath.d.ts
@@ -0,0 +1,7 @@
+/**
+ * Traverse an array of PEM certificates and ensure they form a proper chain
+ * @param x5cCertsPEM Typically the result of `x5c.map(convertASN1toPEM)`
+ * @param trustAnchorsPEM PEM-formatted certs that an attestation statement x5c may chain back to
+ */
+export declare function validateCertificatePath(x5cCertsPEM: string[], trustAnchorsPEM?: string[]): Promise;
+//# sourceMappingURL=validateCertificatePath.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/validateCertificatePath.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/validateCertificatePath.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..9063cfd1f4652f5cac699e04c1fe42d1492ce1e4
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/validateCertificatePath.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"validateCertificatePath.d.ts","sourceRoot":"","sources":["../../src/helpers/validateCertificatePath.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EAAE,EACrB,eAAe,GAAE,MAAM,EAAO,GAC7B,OAAO,CAAC,OAAO,CAAC,CA6HlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/validateCertificatePath.js b/node_modules/@simplewebauthn/server/script/helpers/validateCertificatePath.js
new file mode 100644
index 0000000000000000000000000000000000000000..8efa190ecadc0132f00ec4bec79cef4a00108e3a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/validateCertificatePath.js
@@ -0,0 +1,143 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.validateCertificatePath = validateCertificatePath;
+const x509_1 = require("@peculiar/x509");
+const isCertRevoked_js_1 = require("./isCertRevoked.js");
+const getWebCrypto_js_1 = require("./iso/isoCrypto/getWebCrypto.js");
+/**
+ * Traverse an array of PEM certificates and ensure they form a proper chain
+ * @param x5cCertsPEM Typically the result of `x5c.map(convertASN1toPEM)`
+ * @param trustAnchorsPEM PEM-formatted certs that an attestation statement x5c may chain back to
+ */
+async function validateCertificatePath(x5cCertsPEM, trustAnchorsPEM = []) {
+ if (trustAnchorsPEM.length === 0) {
+ // We have no trust anchors to chain back to, so skip path validation
+ return true;
+ }
+ const WebCrypto = await (0, getWebCrypto_js_1.getWebCrypto)();
+ // Prepare to work with x5c certs
+ const x5cCertsParsed = x5cCertsPEM.map((certPEM) => new x509_1.X509Certificate(certPEM));
+ // Check for any expired or temporally invalid certs in x5c
+ for (let i = 0; i < x5cCertsParsed.length; i++) {
+ const cert = x5cCertsParsed[i];
+ const certPEM = x5cCertsPEM[i];
+ try {
+ await assertCertNotRevoked(cert);
+ }
+ catch (_err) {
+ throw new Error(`Found revoked certificate in x5c:\n${certPEM}`);
+ }
+ try {
+ assertCertIsWithinValidTimeWindow(cert.notBefore, cert.notAfter);
+ }
+ catch (_err) {
+ throw new Error(`Found certificate out of validity period in x5c:\n${certPEM}`);
+ }
+ }
+ // Prepare to work with trust anchor certs
+ const trustAnchorsParsed = trustAnchorsPEM.map((certPEM) => {
+ try {
+ return new x509_1.X509Certificate(certPEM);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`Could not parse trust anchor certificate:\n${certPEM}`, { cause: _err });
+ }
+ });
+ // Filter out any expired or temporally invalid trust anchors certs
+ const validTrustAnchors = [];
+ for (let i = 0; i < trustAnchorsParsed.length; i++) {
+ const cert = trustAnchorsParsed[i];
+ try {
+ await assertCertNotRevoked(cert);
+ }
+ catch (_err) {
+ // Continue processing the other certs
+ continue;
+ }
+ try {
+ assertCertIsWithinValidTimeWindow(cert.notBefore, cert.notAfter);
+ }
+ catch (_err) {
+ // Continue processing the other certs
+ continue;
+ }
+ validTrustAnchors.push(cert);
+ }
+ if (validTrustAnchors.length === 0) {
+ throw new Error('No specified trust anchor was valid for verifying x5c');
+ }
+ // Try to verify x5c with each trust anchor
+ let invalidSubjectAndIssuerError = false;
+ for (const anchor of trustAnchorsParsed) {
+ try {
+ const x5cWithTrustAnchor = x5cCertsParsed.concat([anchor]);
+ if (new Set(x5cWithTrustAnchor).size !== x5cWithTrustAnchor.length) {
+ throw new Error('Invalid certificate path: found duplicate certificates');
+ }
+ // Check signatures, and notBefore and notAfter
+ for (let i = 0; i < x5cWithTrustAnchor.length - 1; i++) {
+ const subject = x5cWithTrustAnchor[i];
+ const issuer = x5cWithTrustAnchor[i + 1];
+ // Leaf or intermediate cert, make sure the next cert in the chain signed it
+ const issuerSignedSubject = await subject.verify({ publicKey: issuer.publicKey, signatureOnly: true }, WebCrypto);
+ if (!issuerSignedSubject) {
+ throw new InvalidSubjectAndIssuer();
+ }
+ if (issuer.subject === issuer.issuer) {
+ // Root cert detected, make sure it signed itself
+ const issuerSignedIssuer = await issuer.verify({ publicKey: issuer.publicKey, signatureOnly: true }, WebCrypto);
+ if (!issuerSignedIssuer) {
+ throw new InvalidSubjectAndIssuer();
+ }
+ // Don't process anything else after a root cert
+ break;
+ }
+ }
+ // If we successfully validated a path then there's no need to continue. Reset any existing
+ // errors that were thrown by earlier trust anchors
+ invalidSubjectAndIssuerError = false;
+ break;
+ }
+ catch (err) {
+ if (err instanceof InvalidSubjectAndIssuer) {
+ invalidSubjectAndIssuerError = true;
+ }
+ else {
+ throw new Error('Unexpected error while validating certificate path', { cause: err });
+ }
+ }
+ }
+ // We tried multiple trust anchors and none of them worked
+ if (invalidSubjectAndIssuerError) {
+ throw new InvalidSubjectAndIssuer();
+ }
+ return true;
+}
+/**
+ * Check if the certificate is revoked or not. If it is, raise an error
+ */
+async function assertCertNotRevoked(certificate) {
+ // Check for certificate revocation
+ const subjectCertRevoked = await (0, isCertRevoked_js_1.isCertRevoked)(certificate);
+ if (subjectCertRevoked) {
+ throw new Error('Found revoked certificate in certificate path');
+ }
+}
+/**
+ * Require the cert to be within its notBefore and notAfter time window
+ */
+function assertCertIsWithinValidTimeWindow(certNotBefore, certNotAfter) {
+ const now = new Date(Date.now());
+ if (certNotBefore > now || certNotAfter < now) {
+ throw new Error('Certificate is not yet valid or expired');
+ }
+}
+// Custom errors to help pass on certain errors
+class InvalidSubjectAndIssuer extends Error {
+ constructor() {
+ const message = 'Subject issuer did not match issuer subject';
+ super(message);
+ this.name = 'InvalidSubjectAndIssuer';
+ }
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/validateExtFIDOGenCEAAGUID.d.ts b/node_modules/@simplewebauthn/server/script/helpers/validateExtFIDOGenCEAAGUID.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b8264e9695b8c41285e38d8f434451ff1812d782
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/validateExtFIDOGenCEAAGUID.d.ts
@@ -0,0 +1,8 @@
+import type { Extensions } from '@peculiar/asn1-x509';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Look for the id-fido-gen-ce-aaguid certificate extension. If it's present then check it against
+ * the attestation statement AAGUID.
+ */
+export declare function validateExtFIDOGenCEAAGUID(certExtensions: Extensions | undefined, aaguid: Uint8Array_): boolean;
+//# sourceMappingURL=validateExtFIDOGenCEAAGUID.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/validateExtFIDOGenCEAAGUID.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/validateExtFIDOGenCEAAGUID.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..99ab7e7a81943da5e2a47a28979cdd23b4b251e0
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/validateExtFIDOGenCEAAGUID.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"validateExtFIDOGenCEAAGUID.d.ts","sourceRoot":"","sources":["../../src/helpers/validateExtFIDOGenCEAAGUID.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AASrD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,UAAU,GAAG,SAAS,EACtC,MAAM,EAAE,WAAW,GAClB,OAAO,CA6BT"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/validateExtFIDOGenCEAAGUID.js b/node_modules/@simplewebauthn/server/script/helpers/validateExtFIDOGenCEAAGUID.js
new file mode 100644
index 0000000000000000000000000000000000000000..25928b13f0fe3ec47d4ac502662e68d79a122642
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/validateExtFIDOGenCEAAGUID.js
@@ -0,0 +1,37 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.validateExtFIDOGenCEAAGUID = validateExtFIDOGenCEAAGUID;
+const asn1_schema_1 = require("@peculiar/asn1-schema");
+const index_js_1 = require("./iso/index.js");
+/**
+ * Attestation Certificate Extension OID: `id-fido-gen-ce-aaguid`
+ *
+ * Sourced from https://fidoalliance.org/specs/fido-v2.0-ps-20150904/fido-key-attestation-v2.0-ps-20150904.html#verifying-an-attestation-statement
+ */
+const id_fido_gen_ce_aaguid = '1.3.6.1.4.1.45724.1.1.4';
+/**
+ * Look for the id-fido-gen-ce-aaguid certificate extension. If it's present then check it against
+ * the attestation statement AAGUID.
+ */
+function validateExtFIDOGenCEAAGUID(certExtensions, aaguid) {
+ // The certificate had no extensions so there's nothing to validate
+ if (!certExtensions) {
+ return true;
+ }
+ const extFIDOGenCEAAGUID = certExtensions.find((ext) => ext.extnID === id_fido_gen_ce_aaguid);
+ // The extension isn't present so there's nothing to validate
+ if (!extFIDOGenCEAAGUID) {
+ return true;
+ }
+ // Parse the extension value
+ const parsedExtFIDOGenCEAAGUID = asn1_schema_1.AsnParser.parse(extFIDOGenCEAAGUID.extnValue, asn1_schema_1.OctetString);
+ const extValue = new Uint8Array(parsedExtFIDOGenCEAAGUID.buffer);
+ // Compare the two values
+ const aaguidAndExtAreEqual = index_js_1.isoUint8Array.areEqual(aaguid, extValue);
+ if (!aaguidAndExtAreEqual) {
+ const _debugExtHex = index_js_1.isoUint8Array.toHex(extValue);
+ const _debugAAGUIDHex = index_js_1.isoUint8Array.toHex(aaguid);
+ 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}"`);
+ }
+ return true;
+}
diff --git a/node_modules/@simplewebauthn/server/script/helpers/verifySignature.d.ts b/node_modules/@simplewebauthn/server/script/helpers/verifySignature.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2faaff74731ee8d903997c8a3995b79adc8b4f00
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/verifySignature.d.ts
@@ -0,0 +1,20 @@
+import { COSEALG } from './cose.js';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Verify an authenticator's signature
+ */
+export declare function verifySignature(opts: {
+ signature: Uint8Array_;
+ data: Uint8Array_;
+ credentialPublicKey?: Uint8Array_;
+ x509Certificate?: Uint8Array_;
+ hashAlgorithm?: COSEALG;
+}): Promise;
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+export declare const _verifySignatureInternals: {
+ stubThis: (value: Promise) => Promise;
+};
+//# sourceMappingURL=verifySignature.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/verifySignature.d.ts.map b/node_modules/@simplewebauthn/server/script/helpers/verifySignature.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..8afaec9be99caa443c9a7d6feedc9796960c1974
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/verifySignature.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifySignature.d.ts","sourceRoot":"","sources":["../../src/helpers/verifySignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,MAAM,WAAW,CAAC;AAInD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,OAAO,CAAC,CAmCnB;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB;sBAClB,OAAO,CAAC,OAAO,CAAC;CACnC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/helpers/verifySignature.js b/node_modules/@simplewebauthn/server/script/helpers/verifySignature.js
new file mode 100644
index 0000000000000000000000000000000000000000..6a855f76489848eeb3f5dcdce537ef6a45b30038
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/helpers/verifySignature.js
@@ -0,0 +1,39 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports._verifySignatureInternals = void 0;
+exports.verifySignature = verifySignature;
+const index_js_1 = require("./iso/index.js");
+const decodeCredentialPublicKey_js_1 = require("./decodeCredentialPublicKey.js");
+const convertX509PublicKeyToCOSE_js_1 = require("./convertX509PublicKeyToCOSE.js");
+/**
+ * Verify an authenticator's signature
+ */
+function verifySignature(opts) {
+ const { signature, data, credentialPublicKey, x509Certificate, hashAlgorithm, } = opts;
+ if (!x509Certificate && !credentialPublicKey) {
+ throw new Error('Must declare either "leafCert" or "credentialPublicKey"');
+ }
+ if (x509Certificate && credentialPublicKey) {
+ throw new Error('Must not declare both "leafCert" and "credentialPublicKey"');
+ }
+ let cosePublicKey = new Map();
+ if (credentialPublicKey) {
+ cosePublicKey = (0, decodeCredentialPublicKey_js_1.decodeCredentialPublicKey)(credentialPublicKey);
+ }
+ else if (x509Certificate) {
+ cosePublicKey = (0, convertX509PublicKeyToCOSE_js_1.convertX509PublicKeyToCOSE)(x509Certificate);
+ }
+ return exports._verifySignatureInternals.stubThis(index_js_1.isoCrypto.verify({
+ cosePublicKey,
+ signature,
+ data,
+ shaHashOverride: hashAlgorithm,
+ }));
+}
+/**
+ * Make it possible to stub the return value during testing
+ * @ignore Don't include this in docs output
+ */
+exports._verifySignatureInternals = {
+ stubThis: (value) => value,
+};
diff --git a/node_modules/@simplewebauthn/server/script/index.d.ts b/node_modules/@simplewebauthn/server/script/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cdfb603bf10902e0443d7157fde5b324ef784444
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/index.d.ts
@@ -0,0 +1,9 @@
+export * from './registration/generateRegistrationOptions.js';
+export * from './registration/verifyRegistrationResponse.js';
+export * from './authentication/generateAuthenticationOptions.js';
+export * from './authentication/verifyAuthenticationResponse.js';
+export * from './services/metadataService.js';
+export * from './services/settingsService.js';
+export * from './metadata/mdsTypes.js';
+export * from './types/index.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/index.d.ts.map b/node_modules/@simplewebauthn/server/script/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f2eeb61d453eb91dd1a93f6c21aa825d7b76057f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC;AAClE,cAAc,kDAAkD,CAAC;AACjE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/index.js b/node_modules/@simplewebauthn/server/script/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..54290d52862be8245b95fddd9652c0fa3ba038e1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/index.js
@@ -0,0 +1,24 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("./registration/generateRegistrationOptions.js"), exports);
+__exportStar(require("./registration/verifyRegistrationResponse.js"), exports);
+__exportStar(require("./authentication/generateAuthenticationOptions.js"), exports);
+__exportStar(require("./authentication/verifyAuthenticationResponse.js"), exports);
+__exportStar(require("./services/metadataService.js"), exports);
+__exportStar(require("./services/settingsService.js"), exports);
+__exportStar(require("./metadata/mdsTypes.js"), exports);
+__exportStar(require("./types/index.js"), exports);
diff --git a/node_modules/@simplewebauthn/server/script/metadata/mdsTypes.d.ts b/node_modules/@simplewebauthn/server/script/metadata/mdsTypes.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..45557a4317f70fd3e055bdf3dbe66614337c5f1e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/mdsTypes.d.ts
@@ -0,0 +1,221 @@
+import type { Base64URLString } from '../types/index.js';
+/**
+ * Metadata Service structures
+ * https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html
+ */
+/** */
+export type MDSJWTHeader = {
+ alg: string;
+ typ: string;
+ x5c: Base64URLString[];
+};
+export type MDSJWTPayload = {
+ legalHeader: string;
+ no: number;
+ nextUpdate: string;
+ entries: MetadataBLOBPayloadEntry[];
+};
+export type MetadataBLOBPayloadEntry = {
+ aaid?: string;
+ aaguid?: string;
+ attestationCertificateKeyIdentifiers?: string[];
+ metadataStatement?: MetadataStatement;
+ biometricStatusReports?: BiometricStatusReport[];
+ statusReports: StatusReport[];
+ timeOfLastStatusChange: string;
+ rogueListURL?: string;
+ rogueListHash?: string;
+};
+export type BiometricStatusReport = {
+ certLevel: number;
+ modality: UserVerify;
+ effectiveDate?: string;
+ certificationDescriptor?: string;
+ certificateNumber?: string;
+ certificationPolicyVersion?: string;
+ certificationRequirementsVersion?: string;
+};
+export type StatusReport = {
+ status: AuthenticatorStatus;
+ effectiveDate?: string;
+ authenticatorVersion?: number;
+ certificate?: string;
+ url?: string;
+ certificationDescriptor?: string;
+ certificateNumber?: string;
+ certificationPolicyVersion?: string;
+ certificationRequirementsVersion?: string;
+};
+export type AuthenticatorStatus = 'NOT_FIDO_CERTIFIED' | 'FIDO_CERTIFIED' | 'USER_VERIFICATION_BYPASS' | 'ATTESTATION_KEY_COMPROMISE' | 'USER_KEY_REMOTE_COMPROMISE' | 'USER_KEY_PHYSICAL_COMPROMISE' | 'UPDATE_AVAILABLE' | 'REVOKED' | 'SELF_ASSERTION_SUBMITTED' | 'FIDO_CERTIFIED_L1' | 'FIDO_CERTIFIED_L1plus' | 'FIDO_CERTIFIED_L2' | 'FIDO_CERTIFIED_L2plus' | 'FIDO_CERTIFIED_L3' | 'FIDO_CERTIFIED_L3plus';
+/**
+ * Types defined in the FIDO Metadata Statement spec
+ *
+ * See https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html
+ */
+export type CodeAccuracyDescriptor = {
+ base: number;
+ minLength: number;
+ maxRetries?: number;
+ blockSlowdown?: number;
+};
+export type BiometricAccuracyDescriptor = {
+ selfAttestedFRR?: number;
+ selfAttestedFAR?: number;
+ maxTemplates?: number;
+ maxRetries?: number;
+ blockSlowdown?: number;
+};
+export type PatternAccuracyDescriptor = {
+ minComplexity: number;
+ maxRetries?: number;
+ blockSlowdown?: number;
+};
+export type VerificationMethodDescriptor = {
+ userVerificationMethod: UserVerify;
+ caDesc?: CodeAccuracyDescriptor;
+ baDesc?: BiometricAccuracyDescriptor;
+ paDesc?: PatternAccuracyDescriptor;
+};
+export type VerificationMethodANDCombinations = VerificationMethodDescriptor[];
+export type rgbPaletteEntry = {
+ r: number;
+ g: number;
+ b: number;
+};
+export type DisplayPNGCharacteristicsDescriptor = {
+ width: number;
+ height: number;
+ bitDepth: number;
+ colorType: number;
+ compression: number;
+ filter: number;
+ interlace: number;
+ plte?: rgbPaletteEntry[];
+};
+export type EcdaaTrustAnchor = {
+ X: string;
+ Y: string;
+ c: string;
+ sx: string;
+ sy: string;
+ G1Curve: string;
+};
+export type ExtensionDescriptor = {
+ id: string;
+ tag?: number;
+ data?: string;
+ fail_if_unknown: boolean;
+};
+/**
+ * langCode -> "en-US", "ja-JP", etc...
+ */
+export type AlternativeDescriptions = {
+ [langCode: string]: string;
+};
+export type MetadataStatement = {
+ legalHeader?: string;
+ aaid?: string;
+ aaguid?: string;
+ attestationCertificateKeyIdentifiers?: string[];
+ description: string;
+ alternativeDescriptions?: AlternativeDescriptions;
+ authenticatorVersion: number;
+ protocolFamily: string;
+ schema: number;
+ upv: Version[];
+ authenticationAlgorithms: AlgSign[];
+ publicKeyAlgAndEncodings: AlgKey[];
+ attestationTypes: Attestation[];
+ userVerificationDetails: VerificationMethodANDCombinations[];
+ keyProtection: KeyProtection[];
+ isKeyRestricted?: boolean;
+ isFreshUserVerificationRequired?: boolean;
+ matcherProtection: MatcherProtection[];
+ cryptoStrength?: number;
+ attachmentHint?: AttachmentHint[];
+ tcDisplay: TransactionConfirmationDisplay[];
+ tcDisplayContentType?: string;
+ tcDisplayPNGCharacteristics?: DisplayPNGCharacteristicsDescriptor[];
+ attestationRootCertificates: string[];
+ ecdaaTrustAnchors?: EcdaaTrustAnchor[];
+ icon?: string;
+ supportedExtensions?: ExtensionDescriptor[];
+ authenticatorGetInfo?: AuthenticatorGetInfo;
+};
+/**
+ * Types declared in other specs
+ */
+/**
+ * USER_VERIFY
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#user-verification-methods
+ */
+export type UserVerify = 'presence_internal' | 'fingerprint_internal' | 'passcode_internal' | 'voiceprint_internal' | 'faceprint_internal' | 'location_internal' | 'eyeprint_internal' | 'pattern_internal' | 'handprint_internal' | 'passcode_external' | 'pattern_external' | 'none' | 'all';
+/**
+ * ALG_SIGN
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authentication-algorithms
+ *
+ * Using this helpful TS pattern here so that we can strongly enforce the existence of COSE info
+ * mappings in `algSignToCOSEInfoMap` in verifyAttestationWithMetadata.ts
+ */
+export type AlgSign = typeof AlgSign[number];
+declare const AlgSign: readonly ["secp256r1_ecdsa_sha256_raw", "secp256r1_ecdsa_sha256_der", "rsassa_pss_sha256_raw", "rsassa_pss_sha256_der", "secp256k1_ecdsa_sha256_raw", "secp256k1_ecdsa_sha256_der", "rsassa_pss_sha384_raw", "rsassa_pkcsv15_sha256_raw", "rsassa_pkcsv15_sha384_raw", "rsassa_pkcsv15_sha512_raw", "rsassa_pkcsv15_sha1_raw", "secp384r1_ecdsa_sha384_raw", "secp512r1_ecdsa_sha256_raw", "ed25519_eddsa_sha512_raw"];
+/**
+ * ALG_KEY
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#public-key-representation-formats
+ */
+export type AlgKey = 'ecc_x962_raw' | 'ecc_x962_der' | 'rsa_2048_raw' | 'rsa_2048_der' | 'cose';
+/**
+ * ATTESTATION
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authenticator-attestation-types
+ */
+export type Attestation = 'basic_full' | 'basic_surrogate' | 'ecdaa' | 'attca' | 'anonca' | 'none';
+/**
+ * KEY_PROTECTION
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#key-protection-types
+ */
+export type KeyProtection = 'software' | 'hardware' | 'tee' | 'secure_element' | 'remote_handle';
+/**
+ * MATCHER_PROTECTION
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#matcher-protection-types
+ */
+export type MatcherProtection = 'software' | 'tee' | 'on_chip';
+/**
+ * ATTACHMENT_HINT
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authenticator-attachment-hints
+ */
+export type AttachmentHint = 'internal' | 'external' | 'wired' | 'wireless' | 'nfc' | 'bluetooth' | 'network' | 'ready' | 'wifi_direct';
+/**
+ * TRANSACTION_CONFIRMATION_DISPLAY
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#transaction-confirmation-display-types
+ */
+export type TransactionConfirmationDisplay = 'any' | 'privileged_software' | 'tee' | 'hardware' | 'remote';
+/**
+ * https://fidoalliance.org/specs/fido-uaf-v1.2-ps-20201020/fido-uaf-protocol-v1.2-ps-20201020.html#version-interface
+ */
+export type Version = {
+ major: number;
+ minor: number;
+};
+/**
+ * https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorGetInfoz
+ */
+export type AuthenticatorGetInfo = {
+ versions: ('FIDO_2_0' | 'U2F_V2')[];
+ extensions?: string[];
+ aaguid: string;
+ options?: {
+ plat?: boolean;
+ rk?: boolean;
+ clientPin?: boolean;
+ up?: boolean;
+ uv?: boolean;
+ };
+ maxMsgSize?: number;
+ pinProtocols?: number[];
+ algorithms?: {
+ type: 'public-key';
+ alg: number;
+ }[];
+};
+export {};
+//# sourceMappingURL=mdsTypes.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/metadata/mdsTypes.d.ts.map b/node_modules/@simplewebauthn/server/script/metadata/mdsTypes.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..0266a6c871f93e078e3481eca1daf9f4b6ea464e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/mdsTypes.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mdsTypes.d.ts","sourceRoot":"","sources":["../../src/metadata/mdsTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;GAGG;AAEH,MAAM;AACN,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,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C;AAEpB;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,KAAK,GAAG,SAAS,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,UAAU,GACV,OAAO,GACP,UAAU,GACV,KAAK,GACL,WAAW,GACX,SAAS,GACT,OAAO,GACP,aAAa,CAAC;AAElB;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GACtC,KAAK,GACL,qBAAqB,GACrB,KAAK,GACL,UAAU,GACV,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/metadata/mdsTypes.js b/node_modules/@simplewebauthn/server/script/metadata/mdsTypes.js
new file mode 100644
index 0000000000000000000000000000000000000000..029942c0efc197bb3af888419b13ea55e4e6cf04
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/mdsTypes.js
@@ -0,0 +1,18 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const AlgSign = [
+ 'secp256r1_ecdsa_sha256_raw',
+ 'secp256r1_ecdsa_sha256_der',
+ 'rsassa_pss_sha256_raw',
+ 'rsassa_pss_sha256_der',
+ 'secp256k1_ecdsa_sha256_raw',
+ 'secp256k1_ecdsa_sha256_der',
+ 'rsassa_pss_sha384_raw',
+ 'rsassa_pkcsv15_sha256_raw',
+ 'rsassa_pkcsv15_sha384_raw',
+ 'rsassa_pkcsv15_sha512_raw',
+ 'rsassa_pkcsv15_sha1_raw',
+ 'secp384r1_ecdsa_sha384_raw',
+ 'secp512r1_ecdsa_sha256_raw',
+ 'ed25519_eddsa_sha512_raw',
+];
diff --git a/node_modules/@simplewebauthn/server/script/metadata/parseJWT.d.ts b/node_modules/@simplewebauthn/server/script/metadata/parseJWT.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3ac50e66ebde295218e166a364e1d97a8598c1b9
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/parseJWT.d.ts
@@ -0,0 +1,5 @@
+/**
+ * Process a JWT into Javascript-friendly data structures
+ */
+export declare function parseJWT(jwt: string): [T1, T2, string];
+//# sourceMappingURL=parseJWT.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/metadata/parseJWT.d.ts.map b/node_modules/@simplewebauthn/server/script/metadata/parseJWT.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..3b1dbe4fd009e39f2812227d2629b04d22776855
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/parseJWT.d.ts.map
@@ -0,0 +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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/metadata/parseJWT.js b/node_modules/@simplewebauthn/server/script/metadata/parseJWT.js
new file mode 100644
index 0000000000000000000000000000000000000000..cadf3e3c4bdba3050d5cba95a0b53ca982812c17
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/parseJWT.js
@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.parseJWT = parseJWT;
+const index_js_1 = require("../helpers/iso/index.js");
+/**
+ * Process a JWT into Javascript-friendly data structures
+ */
+function parseJWT(jwt) {
+ const parts = jwt.split('.');
+ return [
+ JSON.parse(index_js_1.isoBase64URL.toUTF8String(parts[0])),
+ JSON.parse(index_js_1.isoBase64URL.toUTF8String(parts[1])),
+ parts[2],
+ ];
+}
diff --git a/node_modules/@simplewebauthn/server/script/metadata/verifyAttestationWithMetadata.d.ts b/node_modules/@simplewebauthn/server/script/metadata/verifyAttestationWithMetadata.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c6589ef440f9231a13400535297a7305e5f9cedd
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/verifyAttestationWithMetadata.d.ts
@@ -0,0 +1,31 @@
+import type { Base64URLString } from '../types/index.js';
+import type { AlgSign, MetadataStatement } from './mdsTypes.js';
+import { type COSEALG, type COSECRV, COSEKTY } from '../helpers/cose.js';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Match properties of the authenticator's attestation statement against expected values as
+ * registered with the FIDO Alliance Metadata Service
+ */
+export declare function verifyAttestationWithMetadata({ statement, credentialPublicKey, x5c, attestationStatementAlg, }: {
+ statement: MetadataStatement;
+ credentialPublicKey: Uint8Array_;
+ x5c: Uint8Array_[] | Base64URLString[];
+ attestationStatementAlg?: number;
+}): Promise;
+type COSEInfo = {
+ kty: COSEKTY;
+ alg: COSEALG;
+ crv?: COSECRV;
+};
+/**
+ * Convert ALG_SIGN values to COSE info
+ *
+ * Values pulled from `ALG_KEY_COSE` definitions in the FIDO Registry of Predefined Values
+ *
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authentication-algorithms
+ */
+export declare const algSignToCOSEInfoMap: {
+ [key in AlgSign]: COSEInfo;
+};
+export {};
+//# sourceMappingURL=verifyAttestationWithMetadata.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/metadata/verifyAttestationWithMetadata.d.ts.map b/node_modules/@simplewebauthn/server/script/metadata/verifyAttestationWithMetadata.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..eab452ed068f6ee6f58ac9c9910109e3aa600a4b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/verifyAttestationWithMetadata.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationWithMetadata.d.ts","sourceRoot":"","sources":["../../src/metadata/verifyAttestationWithMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EAEZ,OAAO,EAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;GAGG;AACH,wBAAsB,6BAA6B,CAAC,EAClD,SAAS,EACT,mBAAmB,EACnB,GAAG,EACH,uBAAuB,GACxB,EAAE;IACD,SAAS,EAAE,iBAAiB,CAAC;IAC7B,mBAAmB,EAAE,WAAW,CAAC;IACjC,GAAG,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,CAAC;IACvC,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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/metadata/verifyAttestationWithMetadata.js b/node_modules/@simplewebauthn/server/script/metadata/verifyAttestationWithMetadata.js
new file mode 100644
index 0000000000000000000000000000000000000000..1306c286adf2dbfc82fb1a572ee5b632bc86ae3f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/verifyAttestationWithMetadata.js
@@ -0,0 +1,163 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.algSignToCOSEInfoMap = void 0;
+exports.verifyAttestationWithMetadata = verifyAttestationWithMetadata;
+const convertCertBufferToPEM_js_1 = require("../helpers/convertCertBufferToPEM.js");
+const validateCertificatePath_js_1 = require("../helpers/validateCertificatePath.js");
+const decodeCredentialPublicKey_js_1 = require("../helpers/decodeCredentialPublicKey.js");
+const cose_js_1 = require("../helpers/cose.js");
+/**
+ * Match properties of the authenticator's attestation statement against expected values as
+ * registered with the FIDO Alliance Metadata Service
+ */
+async function verifyAttestationWithMetadata({ statement, credentialPublicKey, x5c, attestationStatementAlg, }) {
+ const { authenticationAlgorithms, authenticatorGetInfo, attestationRootCertificates, } = statement;
+ // Make sure the alg in the attestation statement matches one of the ones specified in metadata
+ const keypairCOSEAlgs = new Set();
+ authenticationAlgorithms.forEach((algSign) => {
+ // Map algSign string to { kty, alg, crv }
+ const algSignCOSEINFO = exports.algSignToCOSEInfoMap[algSign];
+ // Keeping this statement here just in case MDS returns something unexpected
+ if (algSignCOSEINFO) {
+ keypairCOSEAlgs.add(algSignCOSEINFO);
+ }
+ });
+ // Extract the public key's COSE info for comparison
+ const decodedPublicKey = (0, decodeCredentialPublicKey_js_1.decodeCredentialPublicKey)(credentialPublicKey);
+ const kty = decodedPublicKey.get(cose_js_1.COSEKEYS.kty);
+ const alg = decodedPublicKey.get(cose_js_1.COSEKEYS.alg);
+ if (!kty) {
+ throw new Error('Credential public key was missing kty');
+ }
+ if (!alg) {
+ throw new Error('Credential public key was missing alg');
+ }
+ if (!kty) {
+ throw new Error('Credential public key was missing kty');
+ }
+ // Assume everything is a number because these values should be
+ const publicKeyCOSEInfo = { kty, alg };
+ if ((0, cose_js_1.isCOSEPublicKeyEC2)(decodedPublicKey)) {
+ const crv = decodedPublicKey.get(cose_js_1.COSEKEYS.crv);
+ publicKeyCOSEInfo.crv = crv;
+ }
+ /**
+ * Attempt to match the credential public key's algorithm to one specified in the device's
+ * metadata
+ */
+ let foundMatch = false;
+ for (const keypairAlg of keypairCOSEAlgs) {
+ // Make sure algorithm and key type match
+ if (keypairAlg.alg === publicKeyCOSEInfo.alg &&
+ keypairAlg.kty === publicKeyCOSEInfo.kty) {
+ // If not an RSA keypair then make sure curve numbers match too
+ if ((keypairAlg.kty === cose_js_1.COSEKTY.EC2 || keypairAlg.kty === cose_js_1.COSEKTY.OKP) &&
+ keypairAlg.crv === publicKeyCOSEInfo.crv) {
+ foundMatch = true;
+ }
+ else {
+ // We've matched an RSA public key's properties
+ foundMatch = true;
+ }
+ }
+ if (foundMatch) {
+ break;
+ }
+ }
+ // Make sure the public key is one of the allowed algorithms
+ if (!foundMatch) {
+ /**
+ * Craft some useful error output from the MDS algorithms
+ *
+ * Example:
+ *
+ * ```
+ * [
+ * 'rsassa_pss_sha256_raw' (COSE info: { kty: 3, alg: -37 }),
+ * 'secp256k1_ecdsa_sha256_raw' (COSE info: { kty: 2, alg: -47, crv: 8 })
+ * ]
+ * ```
+ */
+ const debugMDSAlgs = authenticationAlgorithms.map((algSign) => `'${algSign}' (COSE info: ${stringifyCOSEInfo(exports.algSignToCOSEInfoMap[algSign])})`);
+ const strMDSAlgs = JSON.stringify(debugMDSAlgs, null, 2).replace(/"/g, '');
+ /**
+ * Construct useful error output about the public key
+ */
+ const strPubKeyAlg = stringifyCOSEInfo(publicKeyCOSEInfo);
+ throw new Error(`Public key parameters ${strPubKeyAlg} did not match any of the following metadata algorithms:\n${strMDSAlgs}`);
+ }
+ /**
+ * Confirm the attestation statement's algorithm is one supported according to metadata
+ */
+ if (attestationStatementAlg !== undefined &&
+ authenticatorGetInfo?.algorithms !== undefined) {
+ const getInfoAlgs = authenticatorGetInfo.algorithms.map((_alg) => _alg.alg);
+ if (getInfoAlgs.indexOf(attestationStatementAlg) < 0) {
+ throw new Error(`Attestation statement alg ${attestationStatementAlg} did not match one of ${getInfoAlgs}`);
+ }
+ }
+ // Prepare to check the certificate chain
+ const authenticatorCerts = x5c.map(convertCertBufferToPEM_js_1.convertCertBufferToPEM);
+ const statementRootCerts = attestationRootCertificates.map(convertCertBufferToPEM_js_1.convertCertBufferToPEM);
+ /**
+ * If an authenticator returns exactly one certificate in its x5c, and that cert is found in the
+ * metadata statement then the authenticator is "self-referencing". In this case we forego
+ * certificate chain validation.
+ */
+ let authenticatorIsSelfReferencing = false;
+ if (authenticatorCerts.length === 1 &&
+ statementRootCerts.indexOf(authenticatorCerts[0]) >= 0) {
+ authenticatorIsSelfReferencing = true;
+ }
+ if (!authenticatorIsSelfReferencing) {
+ try {
+ await (0, validateCertificatePath_js_1.validateCertificatePath)(authenticatorCerts, statementRootCerts);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`Could not validate certificate path with any metadata root certificates: ${_err.message}`);
+ }
+ }
+ return true;
+}
+/**
+ * Convert ALG_SIGN values to COSE info
+ *
+ * Values pulled from `ALG_KEY_COSE` definitions in the FIDO Registry of Predefined Values
+ *
+ * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authentication-algorithms
+ */
+exports.algSignToCOSEInfoMap = {
+ secp256r1_ecdsa_sha256_raw: { kty: 2, alg: -7, crv: 1 },
+ secp256r1_ecdsa_sha256_der: { kty: 2, alg: -7, crv: 1 },
+ rsassa_pss_sha256_raw: { kty: 3, alg: -37 },
+ rsassa_pss_sha256_der: { kty: 3, alg: -37 },
+ secp256k1_ecdsa_sha256_raw: { kty: 2, alg: -47, crv: 8 },
+ secp256k1_ecdsa_sha256_der: { kty: 2, alg: -47, crv: 8 },
+ rsassa_pss_sha384_raw: { kty: 3, alg: -38 },
+ rsassa_pkcsv15_sha256_raw: { kty: 3, alg: -257 },
+ rsassa_pkcsv15_sha384_raw: { kty: 3, alg: -258 },
+ rsassa_pkcsv15_sha512_raw: { kty: 3, alg: -259 },
+ rsassa_pkcsv15_sha1_raw: { kty: 3, alg: -65535 },
+ secp384r1_ecdsa_sha384_raw: { kty: 2, alg: -35, crv: 2 },
+ secp512r1_ecdsa_sha256_raw: { kty: 2, alg: -36, crv: 3 },
+ ed25519_eddsa_sha512_raw: { kty: 1, alg: -8, crv: 6 },
+};
+/**
+ * A helper to format COSEInfo a little nicer than we can achieve with JSON.stringify()
+ *
+ * Input: `{ "kty": 3, "alg": -257 }`
+ *
+ * Output: `"{ kty: 3, alg: -257 }"`
+ */
+function stringifyCOSEInfo(info) {
+ const { kty, alg, crv } = info;
+ let toReturn = '';
+ if (kty !== cose_js_1.COSEKTY.RSA) {
+ toReturn = `{ kty: ${kty}, alg: ${alg}, crv: ${crv} }`;
+ }
+ else {
+ toReturn = `{ kty: ${kty}, alg: ${alg} }`;
+ }
+ return toReturn;
+}
diff --git a/node_modules/@simplewebauthn/server/script/metadata/verifyJWT.d.ts b/node_modules/@simplewebauthn/server/script/metadata/verifyJWT.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8f76dcba0448e85b7aadd02fe8cfd3285da2c281
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/verifyJWT.d.ts
@@ -0,0 +1,12 @@
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Lightweight verification for FIDO MDS JWTs. Supports use of EC2 and RSA.
+ *
+ * If this ever needs to support more JWS algorithms, here's the list of them:
+ *
+ * https://www.rfc-editor.org/rfc/rfc7518.html#section-3.1
+ *
+ * (Pulled from https://www.rfc-editor.org/rfc/rfc7515#section-4.1.1)
+ */
+export declare function verifyJWT(jwt: string, leafCert: Uint8Array_): Promise;
+//# sourceMappingURL=verifyJWT.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/metadata/verifyJWT.d.ts.map b/node_modules/@simplewebauthn/server/script/metadata/verifyJWT.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..b5e2644c2a37cb941d707d2e6271a09c0ace081f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/verifyJWT.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyJWT.d.ts","sourceRoot":"","sources":["../../src/metadata/verifyJWT.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CA0B9E"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/metadata/verifyJWT.js b/node_modules/@simplewebauthn/server/script/metadata/verifyJWT.js
new file mode 100644
index 0000000000000000000000000000000000000000..3625a9b72badf420ad3c87b5810f3334249c8a05
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/verifyJWT.js
@@ -0,0 +1,40 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyJWT = verifyJWT;
+const convertX509PublicKeyToCOSE_js_1 = require("../helpers/convertX509PublicKeyToCOSE.js");
+const index_js_1 = require("../helpers/iso/index.js");
+const cose_js_1 = require("../helpers/cose.js");
+const verifyEC2_js_1 = require("../helpers/iso/isoCrypto/verifyEC2.js");
+const verifyRSA_js_1 = require("../helpers/iso/isoCrypto/verifyRSA.js");
+/**
+ * Lightweight verification for FIDO MDS JWTs. Supports use of EC2 and RSA.
+ *
+ * If this ever needs to support more JWS algorithms, here's the list of them:
+ *
+ * https://www.rfc-editor.org/rfc/rfc7518.html#section-3.1
+ *
+ * (Pulled from https://www.rfc-editor.org/rfc/rfc7515#section-4.1.1)
+ */
+function verifyJWT(jwt, leafCert) {
+ const [header, payload, signature] = jwt.split('.');
+ const certCOSE = (0, convertX509PublicKeyToCOSE_js_1.convertX509PublicKeyToCOSE)(leafCert);
+ const data = index_js_1.isoUint8Array.fromUTF8String(`${header}.${payload}`);
+ const signatureBytes = index_js_1.isoBase64URL.toBuffer(signature);
+ if ((0, cose_js_1.isCOSEPublicKeyEC2)(certCOSE)) {
+ return (0, verifyEC2_js_1.verifyEC2)({
+ data,
+ signature: signatureBytes,
+ cosePublicKey: certCOSE,
+ shaHashOverride: cose_js_1.COSEALG.ES256,
+ });
+ }
+ else if ((0, cose_js_1.isCOSEPublicKeyRSA)(certCOSE)) {
+ return (0, verifyRSA_js_1.verifyRSA)({
+ data,
+ signature: signatureBytes,
+ cosePublicKey: certCOSE,
+ });
+ }
+ const kty = certCOSE.get(cose_js_1.COSEKEYS.kty);
+ throw new Error(`JWT verification with public key of kty ${kty} is not supported by this method`);
+}
diff --git a/node_modules/@simplewebauthn/server/script/metadata/verifyMDSBlob.d.ts b/node_modules/@simplewebauthn/server/script/metadata/verifyMDSBlob.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..11f42802ae7a15720ca0176f11fc5b5baa3536aa
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/verifyMDSBlob.d.ts
@@ -0,0 +1,18 @@
+import type { MDSJWTPayload, MetadataStatement } from './mdsTypes.js';
+/**
+ * Perform authenticity and integrity verification of a
+ * [FIDO Metadata Service (MDS)](https://fidoalliance.org/metadata/)-compatible blob, and then
+ * extract the FIDO2 metadata statements included within. This method will make network requests
+ * for things like CRL checks.
+ *
+ * @param blob - A JWT downloaded from an MDS server (e.g. https://mds3.fidoalliance.org)
+ */
+export declare function verifyMDSBlob(blob: string): Promise<{
+ /** MetadataStatement entries within the verified blob */
+ statements: MetadataStatement[];
+ /** A JS `Date` instance of the verified blob's `payload.nextUpdate` string */
+ parsedNextUpdate: Date;
+ /** The verified blob's `payload` value */
+ payload: MDSJWTPayload;
+}>;
+//# sourceMappingURL=verifyMDSBlob.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/metadata/verifyMDSBlob.d.ts.map b/node_modules/@simplewebauthn/server/script/metadata/verifyMDSBlob.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..a8a61cfa3b2f21883c1c1fbed23b6a41cd7f42fa
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/verifyMDSBlob.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyMDSBlob.d.ts","sourceRoot":"","sources":["../../src/metadata/verifyMDSBlob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAQpF;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACzD,yDAAyD;IACzD,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,8EAA8E;IAC9E,gBAAgB,EAAE,IAAI,CAAC;IACvB,0CAA0C;IAC1C,OAAO,EAAE,aAAa,CAAC;CACxB,CAAC,CAuDD"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/metadata/verifyMDSBlob.js b/node_modules/@simplewebauthn/server/script/metadata/verifyMDSBlob.js
new file mode 100644
index 0000000000000000000000000000000000000000..282e52d3a3eb29a68be421e516eb5e2bb2f4ad94
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/metadata/verifyMDSBlob.js
@@ -0,0 +1,62 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyMDSBlob = verifyMDSBlob;
+const parseJWT_js_1 = require("./parseJWT.js");
+const verifyJWT_js_1 = require("./verifyJWT.js");
+const validateCertificatePath_js_1 = require("../helpers/validateCertificatePath.js");
+const convertCertBufferToPEM_js_1 = require("../helpers/convertCertBufferToPEM.js");
+const convertPEMToBytes_js_1 = require("../helpers/convertPEMToBytes.js");
+const settingsService_js_1 = require("../services/settingsService.js");
+/**
+ * Perform authenticity and integrity verification of a
+ * [FIDO Metadata Service (MDS)](https://fidoalliance.org/metadata/)-compatible blob, and then
+ * extract the FIDO2 metadata statements included within. This method will make network requests
+ * for things like CRL checks.
+ *
+ * @param blob - A JWT downloaded from an MDS server (e.g. https://mds3.fidoalliance.org)
+ */
+async function verifyMDSBlob(blob) {
+ // Parse the JWT
+ const parsedJWT = (0, parseJWT_js_1.parseJWT)(blob);
+ const header = parsedJWT[0];
+ const payload = parsedJWT[1];
+ const headerCertsPEM = header.x5c.map(convertCertBufferToPEM_js_1.convertCertBufferToPEM);
+ try {
+ // Validate the certificate chain
+ const rootCerts = settingsService_js_1.SettingsService.getRootCertificates({
+ identifier: 'mds',
+ });
+ await (0, validateCertificatePath_js_1.validateCertificatePath)(headerCertsPEM, rootCerts);
+ }
+ catch (error) {
+ const _error = error;
+ // From FIDO MDS docs: "ignore the file if the chain cannot be verified or if one of the
+ // chain certificates is revoked"
+ throw new Error('BLOB certificate path could not be validated', { cause: _error });
+ }
+ // Verify the BLOB JWT signature
+ const leafCert = headerCertsPEM[0];
+ const verified = await (0, verifyJWT_js_1.verifyJWT)(blob, (0, convertPEMToBytes_js_1.convertPEMToBytes)(leafCert));
+ if (!verified) {
+ // From FIDO MDS docs: "The FIDO Server SHOULD ignore the file if the signature is invalid."
+ throw new Error('BLOB signature could not be verified');
+ }
+ // Cache statements for FIDO2 devices
+ const statements = [];
+ for (const entry of payload.entries) {
+ // Only cache entries with an `aaguid`
+ if (entry.aaguid && entry.metadataStatement) {
+ statements.push(entry.metadataStatement);
+ }
+ }
+ // Convert the nextUpdate property into a Date so we can determine when to re-download
+ const [year, month, day] = payload.nextUpdate.split('-');
+ const parsedNextUpdate = new Date(parseInt(year, 10),
+ // Months need to be zero-indexed
+ parseInt(month, 10) - 1, parseInt(day, 10));
+ return {
+ statements,
+ parsedNextUpdate,
+ payload,
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/script/package.json b/node_modules/@simplewebauthn/server/script/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "commonjs"
+}
diff --git a/node_modules/@simplewebauthn/server/script/registration/generateRegistrationOptions.d.ts b/node_modules/@simplewebauthn/server/script/registration/generateRegistrationOptions.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..93bd66d57d3e18ca4ef1a8043bd81c37ab9ced4a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/generateRegistrationOptions.d.ts
@@ -0,0 +1,46 @@
+import type { AuthenticationExtensionsClientInputs, AuthenticatorSelectionCriteria, AuthenticatorTransportFuture, Base64URLString, COSEAlgorithmIdentifier, PublicKeyCredentialCreationOptionsJSON, Uint8Array_ } from '../types/index.js';
+export type GenerateRegistrationOptionsOpts = Parameters[0];
+/**
+ * Supported crypto algo identifiers
+ * See https://w3c.github.io/webauthn/#sctn-alg-identifier
+ * and https://www.iana.org/assignments/cose/cose.xhtml#algorithms
+ */
+export declare const supportedCOSEAlgorithmIdentifiers: COSEAlgorithmIdentifier[];
+/**
+ * Prepare a value to pass into navigator.credentials.create(...) for authenticator registration
+ *
+ * **Options:**
+ *
+ * @param rpName - User-visible, "friendly" website/service name
+ * @param rpID - Valid domain name (after `https://`)
+ * @param userName - User's website-specific username (email, etc...)
+ * @param userID **(Optional)** - User's website-specific unique ID. Defaults to generating a random identifier
+ * @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back. Defaults to generating a random value
+ * @param userDisplayName **(Optional)** - User's actual name. Defaults to `""`
+ * @param timeout **(Optional)** - How long (in ms) the user can take to complete attestation. Defaults to `60000`
+ * @param attestationType **(Optional)** - Specific attestation statement. Defaults to `"none"`
+ * @param excludeCredentials **(Optional)** - Authenticators registered by the user so the user can't register the same credential multiple times. Defaults to `[]`
+ * @param authenticatorSelection **(Optional)** - Advanced criteria for restricting the types of authenticators that may be used. Defaults to `{ residentKey: 'preferred', userVerification: 'preferred' }`
+ * @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during attestation
+ * @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]`
+ * @param preferredAuthenticatorType **(Optional)** - Encourage the browser to prompt the user to register a specific type of authenticator
+ */
+export declare function generateRegistrationOptions(options: {
+ rpName: string;
+ rpID: string;
+ userName: string;
+ userID?: Uint8Array_;
+ challenge?: string | Uint8Array_;
+ userDisplayName?: string;
+ timeout?: number;
+ attestationType?: 'direct' | 'enterprise' | 'none';
+ excludeCredentials?: {
+ id: Base64URLString;
+ transports?: AuthenticatorTransportFuture[];
+ }[];
+ authenticatorSelection?: AuthenticatorSelectionCriteria;
+ extensions?: AuthenticationExtensionsClientInputs;
+ supportedAlgorithmIDs?: COSEAlgorithmIdentifier[];
+ preferredAuthenticatorType?: 'securityKey' | 'localDevice' | 'remoteDevice';
+}): Promise;
+//# sourceMappingURL=generateRegistrationOptions.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/generateRegistrationOptions.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/generateRegistrationOptions.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..7dc79d36ef561c85629019cf7b6c8c84d90c9414
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/generateRegistrationOptions.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"generateRegistrationOptions.d.ts","sourceRoot":"","sources":["../../src/registration/generateRegistrationOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oCAAoC,EACpC,8BAA8B,EAC9B,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,sCAAsC,EAGtC,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAK3B,MAAM,MAAM,+BAA+B,GAAG,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhG;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAE,uBAAuB,EAqBtE,CAAC;AAsBF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE;IACP,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;IACnD,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;IAClD,0BAA0B,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,cAAc,CAAC;CAC7E,GACA,OAAO,CAAC,sCAAsC,CAAC,CAqIjD"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/generateRegistrationOptions.js b/node_modules/@simplewebauthn/server/script/registration/generateRegistrationOptions.js
new file mode 100644
index 0000000000000000000000000000000000000000..53663df5bbcf7f477c0dcba1168c6f83ce931d3f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/generateRegistrationOptions.js
@@ -0,0 +1,185 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.supportedCOSEAlgorithmIdentifiers = void 0;
+exports.generateRegistrationOptions = generateRegistrationOptions;
+const generateChallenge_js_1 = require("../helpers/generateChallenge.js");
+const generateUserID_js_1 = require("../helpers/generateUserID.js");
+const index_js_1 = require("../helpers/iso/index.js");
+/**
+ * Supported crypto algo identifiers
+ * See https://w3c.github.io/webauthn/#sctn-alg-identifier
+ * and https://www.iana.org/assignments/cose/cose.xhtml#algorithms
+ */
+exports.supportedCOSEAlgorithmIdentifiers = [
+ // EdDSA (In first position to encourage authenticators to use this over ES256)
+ -8,
+ // ECDSA w/ SHA-256
+ -7,
+ // ECDSA w/ SHA-512
+ -36,
+ // RSASSA-PSS w/ SHA-256
+ -37,
+ // RSASSA-PSS w/ SHA-384
+ -38,
+ // RSASSA-PSS w/ SHA-512
+ -39,
+ // RSASSA-PKCS1-v1_5 w/ SHA-256
+ -257,
+ // RSASSA-PKCS1-v1_5 w/ SHA-384
+ -258,
+ // RSASSA-PKCS1-v1_5 w/ SHA-512
+ -259,
+ // RSASSA-PKCS1-v1_5 w/ SHA-1 (Deprecated; here for legacy support)
+ -65535,
+];
+/**
+ * Set up some default authenticator selection options as per the latest spec:
+ * https://www.w3.org/TR/webauthn-2/#dictdef-authenticatorselectioncriteria
+ *
+ * Helps with some older platforms (e.g. Android 7.0 Nougat) that may not be aware of these
+ * defaults.
+ */
+const defaultAuthenticatorSelection = {
+ residentKey: 'preferred',
+ userVerification: 'preferred',
+};
+/**
+ * Use the most commonly-supported algorithms
+ * See the following:
+ * - https://www.iana.org/assignments/cose/cose.xhtml#algorithms
+ * - https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-pubkeycredparams
+ */
+const defaultSupportedAlgorithmIDs = [-8, -7, -257];
+/**
+ * Prepare a value to pass into navigator.credentials.create(...) for authenticator registration
+ *
+ * **Options:**
+ *
+ * @param rpName - User-visible, "friendly" website/service name
+ * @param rpID - Valid domain name (after `https://`)
+ * @param userName - User's website-specific username (email, etc...)
+ * @param userID **(Optional)** - User's website-specific unique ID. Defaults to generating a random identifier
+ * @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back. Defaults to generating a random value
+ * @param userDisplayName **(Optional)** - User's actual name. Defaults to `""`
+ * @param timeout **(Optional)** - How long (in ms) the user can take to complete attestation. Defaults to `60000`
+ * @param attestationType **(Optional)** - Specific attestation statement. Defaults to `"none"`
+ * @param excludeCredentials **(Optional)** - Authenticators registered by the user so the user can't register the same credential multiple times. Defaults to `[]`
+ * @param authenticatorSelection **(Optional)** - Advanced criteria for restricting the types of authenticators that may be used. Defaults to `{ residentKey: 'preferred', userVerification: 'preferred' }`
+ * @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during attestation
+ * @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]`
+ * @param preferredAuthenticatorType **(Optional)** - Encourage the browser to prompt the user to register a specific type of authenticator
+ */
+async function generateRegistrationOptions(options) {
+ const { rpName, rpID, userName, userID, challenge = await (0, generateChallenge_js_1.generateChallenge)(), userDisplayName = '', timeout = 60000, attestationType = 'none', excludeCredentials = [], authenticatorSelection = defaultAuthenticatorSelection, extensions, supportedAlgorithmIDs = defaultSupportedAlgorithmIDs, preferredAuthenticatorType, } = options;
+ /**
+ * Prepare pubKeyCredParams from the array of algorithm ID's
+ */
+ const pubKeyCredParams = supportedAlgorithmIDs.map((id) => ({
+ alg: id,
+ type: 'public-key',
+ }));
+ /**
+ * Capture some of the nuances of how `residentKey` and `requireResidentKey` how either is set
+ * depending on when either is defined in the options
+ */
+ if (authenticatorSelection.residentKey === undefined) {
+ /**
+ * `residentKey`: "If no value is given then the effective value is `required` if
+ * requireResidentKey is true or `discouraged` if it is false or absent."
+ *
+ * See https://www.w3.org/TR/webauthn-2/#dom-authenticatorselectioncriteria-residentkey
+ */
+ if (authenticatorSelection.requireResidentKey) {
+ authenticatorSelection.residentKey = 'required';
+ }
+ else {
+ /**
+ * FIDO Conformance v1.7.2 fails the first test if we do this, even though this is
+ * technically compatible with the WebAuthn L2 spec...
+ */
+ // authenticatorSelection.residentKey = 'discouraged';
+ }
+ }
+ else {
+ /**
+ * `requireResidentKey`: "Relying Parties SHOULD set it to true if, and only if, residentKey is
+ * set to "required""
+ *
+ * Spec says this property defaults to `false` so we should still be okay to assign `false` too
+ *
+ * See https://www.w3.org/TR/webauthn-2/#dom-authenticatorselectioncriteria-requireresidentkey
+ */
+ authenticatorSelection.requireResidentKey = authenticatorSelection.residentKey === 'required';
+ }
+ /**
+ * Preserve ability to specify `string` values for challenges
+ */
+ let _challenge = challenge;
+ if (typeof _challenge === 'string') {
+ _challenge = index_js_1.isoUint8Array.fromUTF8String(_challenge);
+ }
+ /**
+ * Explicitly disallow use of strings for userID anymore because `isoBase64URL.fromBuffer()` below
+ * will return an empty string if one gets through!
+ */
+ if (typeof userID === 'string') {
+ throw new Error(`String values for \`userID\` are no longer supported. See https://simplewebauthn.dev/docs/advanced/server/custom-user-ids`);
+ }
+ /**
+ * Generate a user ID if one is not provided
+ */
+ let _userID = userID;
+ if (!_userID) {
+ _userID = await (0, generateUserID_js_1.generateUserID)();
+ }
+ /**
+ * Map authenticator preference to hints. Map to authenticatorAttachment as well for
+ * backwards-compatibility.
+ */
+ const hints = [];
+ if (preferredAuthenticatorType) {
+ if (preferredAuthenticatorType === 'securityKey') {
+ hints.push('security-key');
+ authenticatorSelection.authenticatorAttachment = 'cross-platform';
+ }
+ else if (preferredAuthenticatorType === 'localDevice') {
+ hints.push('client-device');
+ authenticatorSelection.authenticatorAttachment = 'platform';
+ }
+ else if (preferredAuthenticatorType === 'remoteDevice') {
+ hints.push('hybrid');
+ authenticatorSelection.authenticatorAttachment = 'cross-platform';
+ }
+ }
+ return {
+ challenge: index_js_1.isoBase64URL.fromBuffer(_challenge),
+ rp: {
+ name: rpName,
+ id: rpID,
+ },
+ user: {
+ id: index_js_1.isoBase64URL.fromBuffer(_userID),
+ name: userName,
+ displayName: userDisplayName,
+ },
+ pubKeyCredParams,
+ timeout,
+ attestation: attestationType,
+ excludeCredentials: excludeCredentials.map((cred) => {
+ if (!index_js_1.isoBase64URL.isBase64URL(cred.id)) {
+ throw new Error(`excludeCredential id "${cred.id}" is not a valid base64url string`);
+ }
+ return {
+ ...cred,
+ id: index_js_1.isoBase64URL.trimPadding(cred.id),
+ type: 'public-key',
+ };
+ }),
+ authenticatorSelection,
+ extensions: {
+ ...extensions,
+ credProps: true,
+ },
+ hints,
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/constants.d.ts b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/constants.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..64d31c7ca8adfe2e6e1754a8a213876a09cc10ce
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/constants.d.ts
@@ -0,0 +1,48 @@
+/**
+ * A whole lotta domain knowledge is captured here, with hazy connections to source
+ * documents. Good places to start searching for more info on these values are the
+ * following Trusted Computing Group TPM Library docs linked in the WebAuthn API:
+ *
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-Architecture-01.38.pdf
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-3-Commands-01.38.pdf
+ */
+/**
+ * 6.9 TPM_ST (Structure Tags)
+ */
+export declare const TPM_ST: {
+ [key: number]: string;
+};
+/**
+ * 6.3 TPM_ALG_ID
+ */
+export declare const TPM_ALG: {
+ [key: number]: string;
+};
+/**
+ * 6.4 TPM_ECC_CURVE
+ */
+export declare const TPM_ECC_CURVE: {
+ [key: number]: string;
+};
+type ManufacturerInfo = {
+ name: string;
+ id: string;
+};
+/**
+ * Sourced from https://trustedcomputinggroup.org/resource/vendor-id-registry/
+ *
+ * Latest version:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-Vendor-ID-Registry-Version-1.02-Revision-1.00.pdf
+ */
+export declare const TPM_MANUFACTURERS: {
+ [key: string]: ManufacturerInfo;
+};
+/**
+ * Match TPM public area curve ID's to `crv` numbers used in COSE public keys
+ */
+export declare const TPM_ECC_CURVE_COSE_CRV_MAP: {
+ [key: string]: number;
+};
+export {};
+//# sourceMappingURL=constants.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/constants.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/constants.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..4e0d35bb70f2499c83f7abd42a7f43d4e267dbb2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/constants.d.ts.map
@@ -0,0 +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;CAgChE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAM/D,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/constants.js b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/constants.js
new file mode 100644
index 0000000000000000000000000000000000000000..fde16c6fbd4f3a9cbf9ce0b4e71c7e07ef57b33f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/constants.js
@@ -0,0 +1,140 @@
+"use strict";
+// deno-lint-ignore-file no-dupe-keys
+/**
+ * A whole lotta domain knowledge is captured here, with hazy connections to source
+ * documents. Good places to start searching for more info on these values are the
+ * following Trusted Computing Group TPM Library docs linked in the WebAuthn API:
+ *
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-Architecture-01.38.pdf
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf
+ * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-3-Commands-01.38.pdf
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.TPM_ECC_CURVE_COSE_CRV_MAP = exports.TPM_MANUFACTURERS = exports.TPM_ECC_CURVE = exports.TPM_ALG = exports.TPM_ST = void 0;
+/**
+ * 6.9 TPM_ST (Structure Tags)
+ */
+exports.TPM_ST = {
+ 0x00c4: 'TPM_ST_RSP_COMMAND',
+ 0x8000: 'TPM_ST_NULL',
+ 0x8001: 'TPM_ST_NO_SESSIONS',
+ 0x8002: 'TPM_ST_SESSIONS',
+ 0x8014: 'TPM_ST_ATTEST_NV',
+ 0x8015: 'TPM_ST_ATTEST_COMMAND_AUDIT',
+ 0x8016: 'TPM_ST_ATTEST_SESSION_AUDIT',
+ 0x8017: 'TPM_ST_ATTEST_CERTIFY',
+ 0x8018: 'TPM_ST_ATTEST_QUOTE',
+ 0x8019: 'TPM_ST_ATTEST_TIME',
+ 0x801a: 'TPM_ST_ATTEST_CREATION',
+ 0x8021: 'TPM_ST_CREATION',
+ 0x8022: 'TPM_ST_VERIFIED',
+ 0x8023: 'TPM_ST_AUTH_SECRET',
+ 0x8024: 'TPM_ST_HASHCHECK',
+ 0x8025: 'TPM_ST_AUTH_SIGNED',
+ 0x8029: 'TPM_ST_FU_MANIFEST',
+};
+/**
+ * 6.3 TPM_ALG_ID
+ */
+exports.TPM_ALG = {
+ 0x0000: 'TPM_ALG_ERROR',
+ 0x0001: 'TPM_ALG_RSA',
+ 0x0004: 'TPM_ALG_SHA',
+ // @ts-ignore 2300
+ 0x0004: 'TPM_ALG_SHA1',
+ 0x0005: 'TPM_ALG_HMAC',
+ 0x0006: 'TPM_ALG_AES',
+ 0x0007: 'TPM_ALG_MGF1',
+ 0x0008: 'TPM_ALG_KEYEDHASH',
+ 0x000a: 'TPM_ALG_XOR',
+ 0x000b: 'TPM_ALG_SHA256',
+ 0x000c: 'TPM_ALG_SHA384',
+ 0x000d: 'TPM_ALG_SHA512',
+ 0x0010: 'TPM_ALG_NULL',
+ 0x0012: 'TPM_ALG_SM3_256',
+ 0x0013: 'TPM_ALG_SM4',
+ 0x0014: 'TPM_ALG_RSASSA',
+ 0x0015: 'TPM_ALG_RSAES',
+ 0x0016: 'TPM_ALG_RSAPSS',
+ 0x0017: 'TPM_ALG_OAEP',
+ 0x0018: 'TPM_ALG_ECDSA',
+ 0x0019: 'TPM_ALG_ECDH',
+ 0x001a: 'TPM_ALG_ECDAA',
+ 0x001b: 'TPM_ALG_SM2',
+ 0x001c: 'TPM_ALG_ECSCHNORR',
+ 0x001d: 'TPM_ALG_ECMQV',
+ 0x0020: 'TPM_ALG_KDF1_SP800_56A',
+ 0x0021: 'TPM_ALG_KDF2',
+ 0x0022: 'TPM_ALG_KDF1_SP800_108',
+ 0x0023: 'TPM_ALG_ECC',
+ 0x0025: 'TPM_ALG_SYMCIPHER',
+ 0x0026: 'TPM_ALG_CAMELLIA',
+ 0x0040: 'TPM_ALG_CTR',
+ 0x0041: 'TPM_ALG_OFB',
+ 0x0042: 'TPM_ALG_CBC',
+ 0x0043: 'TPM_ALG_CFB',
+ 0x0044: 'TPM_ALG_ECB',
+};
+/**
+ * 6.4 TPM_ECC_CURVE
+ */
+exports.TPM_ECC_CURVE = {
+ 0x0000: 'TPM_ECC_NONE',
+ 0x0001: 'TPM_ECC_NIST_P192',
+ 0x0002: 'TPM_ECC_NIST_P224',
+ 0x0003: 'TPM_ECC_NIST_P256',
+ 0x0004: 'TPM_ECC_NIST_P384',
+ 0x0005: 'TPM_ECC_NIST_P521',
+ 0x0010: 'TPM_ECC_BN_P256',
+ 0x0011: 'TPM_ECC_BN_P638',
+ 0x0020: 'TPM_ECC_SM2_P256',
+};
+/**
+ * Sourced from https://trustedcomputinggroup.org/resource/vendor-id-registry/
+ *
+ * Latest version:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-Vendor-ID-Registry-Version-1.02-Revision-1.00.pdf
+ */
+exports.TPM_MANUFACTURERS = {
+ 'id:414D4400': { name: 'AMD', id: 'AMD' },
+ 'id:414E5400': { name: 'Ant Group', id: 'ANT' },
+ 'id:41544D4C': { name: 'Atmel', id: 'ATML' },
+ 'id:4252434D': { name: 'Broadcom', id: 'BRCM' },
+ 'id:4353434F': { name: 'Cisco', id: 'CSCO' },
+ 'id:464C5953': { name: 'Flyslice Technologies', id: 'FLYS' },
+ 'id:524F4343': { name: 'Fuzhou Rockchip', id: 'ROCC' },
+ 'id:474F4F47': { name: 'Google', id: 'GOOG' },
+ 'id:48504900': { name: 'HPI', id: 'HPI' },
+ 'id:48504500': { name: 'HPE', id: 'HPE' },
+ 'id:48495349': { name: 'Huawei', id: 'HISI' },
+ 'id:49424d00': { name: 'IBM', id: 'IBM' },
+ 'id:49424D00': { name: 'IBM', id: 'IBM' }, // Same ID for IBM as above, except the "D" is capitalized as per TPM spec
+ 'id:49465800': { name: 'Infineon', id: 'IFX' },
+ 'id:494E5443': { name: 'Intel', id: 'INTC' },
+ 'id:4C454E00': { name: 'Lenovo', id: 'LEN' },
+ 'id:4D534654': { name: 'Microsoft', id: 'MSFT' },
+ 'id:4E534D20': { name: 'National Semiconductor', id: 'NSM' },
+ 'id:4E545A00': { name: 'Nationz', id: 'NTZ' },
+ 'id:4E534700': { name: 'NSING', id: 'NSG' },
+ 'id:4E544300': { name: 'Nuvoton Technology', id: 'NTC' },
+ 'id:51434F4D': { name: 'Qualcomm', id: 'QCOM' },
+ 'id:534D534E': { name: 'Samsung', id: 'SMSN' },
+ 'id:53454345': { name: 'SecEdge', id: 'SECE' },
+ 'id:534E5300': { name: 'Sinosun', id: 'SNS' },
+ 'id:534D5343': { name: 'SMSC', id: 'SMSC' },
+ 'id:53544D20': { name: 'STMicroelectronics', id: 'STM' },
+ 'id:54584E00': { name: 'Texas Instruments', id: 'TXN' },
+ 'id:57454300': { name: 'Winbond', id: 'WEC' },
+ 'id:5345414C': { name: 'Wisekey', id: 'SEAL' },
+ 'id:FFFFF1D0': { name: 'FIDO Alliance', id: 'FIDO' }, // FIDO Conformance
+};
+/**
+ * Match TPM public area curve ID's to `crv` numbers used in COSE public keys
+ */
+exports.TPM_ECC_CURVE_COSE_CRV_MAP = {
+ TPM_ECC_NIST_P256: 1, // p256
+ TPM_ECC_NIST_P384: 2, // p384
+ TPM_ECC_NIST_P521: 3, // p521
+ TPM_ECC_BN_P256: 1, // p256
+ TPM_ECC_SM2_P256: 1, // p256
+};
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parseCertInfo.d.ts b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parseCertInfo.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cf8588a4c4b4f9c9ef11320b0febb1f01d6450d1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parseCertInfo.d.ts
@@ -0,0 +1,26 @@
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Cut up a TPM attestation's certInfo into intelligible chunks
+ */
+export declare function parseCertInfo(certInfo: Uint8Array_): ParsedCertInfo;
+type ParsedCertInfo = {
+ magic: number;
+ type: string;
+ qualifiedSigner: Uint8Array_;
+ extraData: Uint8Array_;
+ clockInfo: {
+ clock: Uint8Array_;
+ resetCount: number;
+ restartCount: number;
+ safe: boolean;
+ };
+ firmwareVersion: Uint8Array_;
+ attested: {
+ nameAlg: string;
+ nameAlgBuffer: Uint8Array_;
+ name: Uint8Array_;
+ qualifiedName: Uint8Array_;
+ };
+};
+export {};
+//# sourceMappingURL=parseCertInfo.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parseCertInfo.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parseCertInfo.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..725ef5b78d933e156d59a38da50fec7095351428
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parseCertInfo.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"parseCertInfo.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/parseCertInfo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,WAAW,GAAG,cAAc,CAkEnE;AAED,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,WAAW,CAAC;IAC7B,SAAS,EAAE,WAAW,CAAC;IACvB,SAAS,EAAE;QACT,KAAK,EAAE,WAAW,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;IACF,eAAe,EAAE,WAAW,CAAC;IAC7B,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,WAAW,CAAC;QAC3B,IAAI,EAAE,WAAW,CAAC;QAClB,aAAa,EAAE,WAAW,CAAC;KAC5B,CAAC;CACH,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parseCertInfo.js b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parseCertInfo.js
new file mode 100644
index 0000000000000000000000000000000000000000..3289639bea26bf61af4d30392622a97441e5db37
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parseCertInfo.js
@@ -0,0 +1,61 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.parseCertInfo = parseCertInfo;
+const constants_js_1 = require("./constants.js");
+const index_js_1 = require("../../../helpers/iso/index.js");
+/**
+ * Cut up a TPM attestation's certInfo into intelligible chunks
+ */
+function parseCertInfo(certInfo) {
+ let pointer = 0;
+ const dataView = index_js_1.isoUint8Array.toDataView(certInfo);
+ // Get a magic constant
+ const magic = dataView.getUint32(pointer);
+ pointer += 4;
+ // Determine the algorithm used for attestation
+ const typeBuffer = dataView.getUint16(pointer);
+ pointer += 2;
+ const type = constants_js_1.TPM_ST[typeBuffer];
+ // The name of a parent entity, can be ignored
+ const qualifiedSignerLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const qualifiedSigner = certInfo.slice(pointer, pointer += qualifiedSignerLength);
+ // Get the expected hash of `attsToBeSigned`
+ const extraDataLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const extraData = certInfo.slice(pointer, pointer += extraDataLength);
+ // Information about the TPM device's internal clock, can be ignored
+ const clock = certInfo.slice(pointer, pointer += 8);
+ const resetCount = dataView.getUint32(pointer);
+ pointer += 4;
+ const restartCount = dataView.getUint32(pointer);
+ pointer += 4;
+ const safe = !!certInfo.slice(pointer, pointer += 1);
+ const clockInfo = { clock, resetCount, restartCount, safe };
+ // TPM device firmware version
+ const firmwareVersion = certInfo.slice(pointer, pointer += 8);
+ // Attested Name
+ const attestedNameLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const attestedName = certInfo.slice(pointer, pointer += attestedNameLength);
+ const attestedNameDataView = index_js_1.isoUint8Array.toDataView(attestedName);
+ // Attested qualified name, can be ignored
+ const qualifiedNameLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const qualifiedName = certInfo.slice(pointer, pointer += qualifiedNameLength);
+ const attested = {
+ nameAlg: constants_js_1.TPM_ALG[attestedNameDataView.getUint16(0)],
+ nameAlgBuffer: attestedName.slice(0, 2),
+ name: attestedName,
+ qualifiedName,
+ };
+ return {
+ magic,
+ type,
+ qualifiedSigner,
+ extraData,
+ clockInfo,
+ firmwareVersion,
+ attested,
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parsePubArea.d.ts b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parsePubArea.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b42264a8bb734d13e9248f70b3c427e614b829cf
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parsePubArea.d.ts
@@ -0,0 +1,45 @@
+import type { Uint8Array_ } from '../../../types/index.js';
+/**
+ * Break apart a TPM attestation's pubArea buffer
+ *
+ * See 12.2.4 TPMT_PUBLIC here:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf
+ */
+export declare function parsePubArea(pubArea: Uint8Array_): ParsedPubArea;
+type ParsedPubArea = {
+ type: 'TPM_ALG_RSA' | 'TPM_ALG_ECC';
+ nameAlg: string;
+ objectAttributes: {
+ fixedTPM: boolean;
+ stClear: boolean;
+ fixedParent: boolean;
+ sensitiveDataOrigin: boolean;
+ userWithAuth: boolean;
+ adminWithPolicy: boolean;
+ noDA: boolean;
+ encryptedDuplication: boolean;
+ restricted: boolean;
+ decrypt: boolean;
+ signOrEncrypt: boolean;
+ };
+ authPolicy: Uint8Array_;
+ parameters: {
+ rsa?: RSAParameters;
+ ecc?: ECCParameters;
+ };
+ unique: Uint8Array_;
+};
+type RSAParameters = {
+ symmetric: string;
+ scheme: string;
+ keyBits: number;
+ exponent: number;
+};
+type ECCParameters = {
+ symmetric: string;
+ scheme: string;
+ curveID: string;
+ kdf: string;
+};
+export {};
+//# sourceMappingURL=parsePubArea.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parsePubArea.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parsePubArea.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..7136c7106fce2398adce5eb6b4f3f2f60daa4f83
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parsePubArea.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"parsePubArea.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/parsePubArea.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,aAAa,CAyGhE;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,WAAW,CAAC;IACxB,UAAU,EAAE;QACV,GAAG,CAAC,EAAE,aAAa,CAAC;QACpB,GAAG,CAAC,EAAE,aAAa,CAAC;KACrB,CAAC;IACF,MAAM,EAAE,WAAW,CAAC;CACrB,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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parsePubArea.js b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parsePubArea.js
new file mode 100644
index 0000000000000000000000000000000000000000..6fc704aad1e78803290f177bff961f9c9e17127d
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parsePubArea.js
@@ -0,0 +1,97 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.parsePubArea = parsePubArea;
+const constants_js_1 = require("./constants.js");
+const index_js_1 = require("../../../helpers/iso/index.js");
+/**
+ * Break apart a TPM attestation's pubArea buffer
+ *
+ * See 12.2.4 TPMT_PUBLIC here:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf
+ */
+function parsePubArea(pubArea) {
+ let pointer = 0;
+ const dataView = index_js_1.isoUint8Array.toDataView(pubArea);
+ const type = constants_js_1.TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ const nameAlg = constants_js_1.TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ // Get some authenticator attributes(?)
+ // const objectAttributesInt = pubArea.slice(pointer, (pointer += 4)).readUInt32BE(0);
+ const objectAttributesInt = dataView.getUint32(pointer);
+ pointer += 4;
+ const objectAttributes = {
+ fixedTPM: !!(objectAttributesInt & 1),
+ stClear: !!(objectAttributesInt & 2),
+ fixedParent: !!(objectAttributesInt & 8),
+ sensitiveDataOrigin: !!(objectAttributesInt & 16),
+ userWithAuth: !!(objectAttributesInt & 32),
+ adminWithPolicy: !!(objectAttributesInt & 64),
+ noDA: !!(objectAttributesInt & 512),
+ encryptedDuplication: !!(objectAttributesInt & 1024),
+ restricted: !!(objectAttributesInt & 32768),
+ decrypt: !!(objectAttributesInt & 65536),
+ signOrEncrypt: !!(objectAttributesInt & 131072),
+ };
+ // Slice out the authPolicy of dynamic length
+ const authPolicyLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const authPolicy = pubArea.slice(pointer, pointer += authPolicyLength);
+ // Extract additional curve params according to type
+ const parameters = {};
+ let unique = Uint8Array.from([]);
+ if (type === 'TPM_ALG_RSA') {
+ const symmetric = constants_js_1.TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ const scheme = constants_js_1.TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ const keyBits = dataView.getUint16(pointer);
+ pointer += 2;
+ const exponent = dataView.getUint32(pointer);
+ pointer += 4;
+ parameters.rsa = { symmetric, scheme, keyBits, exponent };
+ /**
+ * See 11.2.4.5 TPM2B_PUBLIC_KEY_RSA here:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf
+ */
+ // const uniqueLength = pubArea.slice(pointer, (pointer += 2)).readUInt16BE(0);
+ const uniqueLength = dataView.getUint16(pointer);
+ pointer += 2;
+ unique = pubArea.slice(pointer, pointer += uniqueLength);
+ }
+ else if (type === 'TPM_ALG_ECC') {
+ const symmetric = constants_js_1.TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ const scheme = constants_js_1.TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ const curveID = constants_js_1.TPM_ECC_CURVE[dataView.getUint16(pointer)];
+ pointer += 2;
+ const kdf = constants_js_1.TPM_ALG[dataView.getUint16(pointer)];
+ pointer += 2;
+ parameters.ecc = { symmetric, scheme, curveID, kdf };
+ /**
+ * See 11.2.5.1 TPM2B_ECC_PARAMETER here:
+ * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf
+ */
+ // Retrieve X
+ const uniqueXLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const uniqueX = pubArea.slice(pointer, pointer += uniqueXLength);
+ // Retrieve Y
+ const uniqueYLength = dataView.getUint16(pointer);
+ pointer += 2;
+ const uniqueY = pubArea.slice(pointer, pointer += uniqueYLength);
+ unique = index_js_1.isoUint8Array.concat([uniqueX, uniqueY]);
+ }
+ else {
+ throw new Error(`Unexpected type "${type}" (TPM)`);
+ }
+ return {
+ type,
+ nameAlg,
+ objectAttributes,
+ authPolicy,
+ parameters,
+ unique,
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/verifyAttestationTPM.d.ts b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/verifyAttestationTPM.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..87ad07f4cefc1d3d2d7eec64993482a62dfea53e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/verifyAttestationTPM.d.ts
@@ -0,0 +1,3 @@
+import type { AttestationFormatVerifierOpts } from '../../verifyRegistrationResponse.js';
+export declare function verifyAttestationTPM(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationTPM.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/verifyAttestationTPM.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/verifyAttestationTPM.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..3859702eadda6049c6e6d3c6bccf47e45190e3e5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/verifyAttestationTPM.d.ts.map
@@ -0,0 +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;AAwBzF,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA+VlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/verifyAttestationTPM.js b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/verifyAttestationTPM.js
new file mode 100644
index 0000000000000000000000000000000000000000..8379a30e056dffb9e786d163cdf67502f76010ee
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/verifyAttestationTPM.js
@@ -0,0 +1,334 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyAttestationTPM = verifyAttestationTPM;
+const asn1_schema_1 = require("@peculiar/asn1-schema");
+const asn1_x509_1 = require("@peculiar/asn1-x509");
+const decodeCredentialPublicKey_js_1 = require("../../../helpers/decodeCredentialPublicKey.js");
+const cose_js_1 = require("../../../helpers/cose.js");
+const toHash_js_1 = require("../../../helpers/toHash.js");
+const convertCertBufferToPEM_js_1 = require("../../../helpers/convertCertBufferToPEM.js");
+const validateCertificatePath_js_1 = require("../../../helpers/validateCertificatePath.js");
+const getCertificateInfo_js_1 = require("../../../helpers/getCertificateInfo.js");
+const verifySignature_js_1 = require("../../../helpers/verifySignature.js");
+const index_js_1 = require("../../../helpers/iso/index.js");
+const validateExtFIDOGenCEAAGUID_js_1 = require("../../../helpers/validateExtFIDOGenCEAAGUID.js");
+const metadataService_js_1 = require("../../../services/metadataService.js");
+const verifyAttestationWithMetadata_js_1 = require("../../../metadata/verifyAttestationWithMetadata.js");
+const constants_js_1 = require("./constants.js");
+const parseCertInfo_js_1 = require("./parseCertInfo.js");
+const parsePubArea_js_1 = require("./parsePubArea.js");
+async function verifyAttestationTPM(options) {
+ const { aaguid, attStmt, authData, credentialPublicKey, clientDataHash, rootCertificates, } = options;
+ const ver = attStmt.get('ver');
+ const sig = attStmt.get('sig');
+ const alg = attStmt.get('alg');
+ const x5c = attStmt.get('x5c');
+ const pubArea = attStmt.get('pubArea');
+ const certInfo = attStmt.get('certInfo');
+ /**
+ * Verify structures
+ */
+ if (ver !== '2.0') {
+ throw new Error(`Unexpected ver "${ver}", expected "2.0" (TPM)`);
+ }
+ if (!sig) {
+ throw new Error('No attestation signature provided in attestation statement (TPM)');
+ }
+ if (!alg) {
+ throw new Error(`Attestation statement did not contain alg (TPM)`);
+ }
+ if (!(0, cose_js_1.isCOSEAlg)(alg)) {
+ throw new Error(`Attestation statement contained invalid alg ${alg} (TPM)`);
+ }
+ if (!x5c) {
+ throw new Error('No attestation certificate provided in attestation statement (TPM)');
+ }
+ if (!pubArea) {
+ throw new Error('Attestation statement did not contain pubArea (TPM)');
+ }
+ if (!certInfo) {
+ throw new Error('Attestation statement did not contain certInfo (TPM)');
+ }
+ const parsedPubArea = (0, parsePubArea_js_1.parsePubArea)(pubArea);
+ const { unique, type: pubType, parameters } = parsedPubArea;
+ // Verify that the public key specified by the parameters and unique fields of pubArea is
+ // identical to the credentialPublicKey in the attestedCredentialData in authenticatorData.
+ const cosePublicKey = (0, decodeCredentialPublicKey_js_1.decodeCredentialPublicKey)(credentialPublicKey);
+ if (pubType === 'TPM_ALG_RSA') {
+ if (!(0, cose_js_1.isCOSEPublicKeyRSA)(cosePublicKey)) {
+ throw new Error(`Credential public key with kty ${cosePublicKey.get(cose_js_1.COSEKEYS.kty)} did not match ${pubType}`);
+ }
+ const n = cosePublicKey.get(cose_js_1.COSEKEYS.n);
+ const e = cosePublicKey.get(cose_js_1.COSEKEYS.e);
+ if (!n) {
+ throw new Error('COSE public key missing n (TPM|RSA)');
+ }
+ if (!e) {
+ throw new Error('COSE public key missing e (TPM|RSA)');
+ }
+ if (!index_js_1.isoUint8Array.areEqual(unique, n)) {
+ throw new Error('PubArea unique is not same as credentialPublicKey (TPM|RSA)');
+ }
+ if (!parameters.rsa) {
+ throw new Error(`Parsed pubArea type is RSA, but missing parameters.rsa (TPM|RSA)`);
+ }
+ const eBuffer = e;
+ // If `exponent` is equal to 0x00, then exponent is the default RSA exponent of 2^16+1 (65537)
+ const pubAreaExponent = parameters.rsa.exponent || 65537;
+ // Do some bit shifting to get to an integer
+ const eSum = eBuffer[0] + (eBuffer[1] << 8) + (eBuffer[2] << 16);
+ if (pubAreaExponent !== eSum) {
+ throw new Error(`Unexpected public key exp ${eSum}, expected ${pubAreaExponent} (TPM|RSA)`);
+ }
+ }
+ else if (pubType === 'TPM_ALG_ECC') {
+ if (!(0, cose_js_1.isCOSEPublicKeyEC2)(cosePublicKey)) {
+ throw new Error(`Credential public key with kty ${cosePublicKey.get(cose_js_1.COSEKEYS.kty)} did not match ${pubType}`);
+ }
+ const crv = cosePublicKey.get(cose_js_1.COSEKEYS.crv);
+ const x = cosePublicKey.get(cose_js_1.COSEKEYS.x);
+ const y = cosePublicKey.get(cose_js_1.COSEKEYS.y);
+ if (!crv) {
+ throw new Error('COSE public key missing crv (TPM|ECC)');
+ }
+ if (!x) {
+ throw new Error('COSE public key missing x (TPM|ECC)');
+ }
+ if (!y) {
+ throw new Error('COSE public key missing y (TPM|ECC)');
+ }
+ if (!index_js_1.isoUint8Array.areEqual(unique, index_js_1.isoUint8Array.concat([x, y]))) {
+ throw new Error('PubArea unique is not same as public key x and y (TPM|ECC)');
+ }
+ if (!parameters.ecc) {
+ throw new Error(`Parsed pubArea type is ECC, but missing parameters.ecc (TPM|ECC)`);
+ }
+ const pubAreaCurveID = parameters.ecc.curveID;
+ const pubAreaCurveIDMapToCOSECRV = constants_js_1.TPM_ECC_CURVE_COSE_CRV_MAP[pubAreaCurveID];
+ if (pubAreaCurveIDMapToCOSECRV !== crv) {
+ throw new Error(`Public area key curve ID "${pubAreaCurveID}" mapped to "${pubAreaCurveIDMapToCOSECRV}" which did not match public key crv of "${crv}" (TPM|ECC)`);
+ }
+ }
+ else {
+ throw new Error(`Unsupported pubArea.type "${pubType}"`);
+ }
+ const parsedCertInfo = (0, parseCertInfo_js_1.parseCertInfo)(certInfo);
+ const { magic, type: certType, attested, extraData } = parsedCertInfo;
+ if (magic !== 0xff544347) {
+ throw new Error(`Unexpected magic value "${magic}", expected "0xff544347" (TPM)`);
+ }
+ if (certType !== 'TPM_ST_ATTEST_CERTIFY') {
+ throw new Error(`Unexpected type "${certType}", expected "TPM_ST_ATTEST_CERTIFY" (TPM)`);
+ }
+ // Hash pubArea to create pubAreaHash using the nameAlg in attested
+ const pubAreaHash = await (0, toHash_js_1.toHash)(pubArea, attestedNameAlgToCOSEAlg(attested.nameAlg));
+ // Concatenate attested.nameAlg and pubAreaHash to create attestedName.
+ const attestedName = index_js_1.isoUint8Array.concat([
+ attested.nameAlgBuffer,
+ pubAreaHash,
+ ]);
+ // Check that certInfo.attested.name is equals to attestedName.
+ if (!index_js_1.isoUint8Array.areEqual(attested.name, attestedName)) {
+ throw new Error(`Attested name comparison failed (TPM)`);
+ }
+ // Concatenate authData with clientDataHash to create attToBeSigned
+ const attToBeSigned = index_js_1.isoUint8Array.concat([authData, clientDataHash]);
+ // Hash attToBeSigned using the algorithm specified in attStmt.alg to create attToBeSignedHash
+ const attToBeSignedHash = await (0, toHash_js_1.toHash)(attToBeSigned, alg);
+ // Check that certInfo.extraData is equals to attToBeSignedHash.
+ if (!index_js_1.isoUint8Array.areEqual(extraData, attToBeSignedHash)) {
+ throw new Error('CertInfo extra data did not equal hashed attestation (TPM)');
+ }
+ /**
+ * Verify signature
+ */
+ if (x5c.length < 1) {
+ throw new Error('No certificates present in x5c array (TPM)');
+ }
+ // Pick a leaf AIK certificate of the x5c array and parse it.
+ const leafCertInfo = (0, getCertificateInfo_js_1.getCertificateInfo)(x5c[0]);
+ const { basicConstraintsCA, version, subject, notAfter, notBefore } = leafCertInfo;
+ if (basicConstraintsCA) {
+ throw new Error('Certificate basic constraints CA was not `false` (TPM)');
+ }
+ // Check that certificate is of version 3 (value must be set to 2).
+ if (version !== 2) {
+ throw new Error('Certificate version was not `3` (ASN.1 value of 2) (TPM)');
+ }
+ // Check that Subject sequence is empty.
+ if (subject.combined.length > 0) {
+ throw new Error('Certificate subject was not empty (TPM)');
+ }
+ // Check that certificate is currently valid
+ let now = new Date();
+ if (notBefore > now) {
+ throw new Error(`Certificate not good before "${notBefore.toString()}" (TPM)`);
+ }
+ // Check that certificate has not expired
+ now = new Date();
+ if (notAfter < now) {
+ throw new Error(`Certificate not good after "${notAfter.toString()}" (TPM)`);
+ }
+ /**
+ * Plumb the depths of the certificate's ASN.1-formatted data for some values we need to verify
+ */
+ const parsedCert = asn1_schema_1.AsnParser.parse(x5c[0], asn1_x509_1.Certificate);
+ if (!parsedCert.tbsCertificate.extensions) {
+ throw new Error('Certificate was missing extensions (TPM)');
+ }
+ let subjectAltNamePresent;
+ let extKeyUsage;
+ parsedCert.tbsCertificate.extensions.forEach((ext) => {
+ if (ext.extnID === asn1_x509_1.id_ce_subjectAltName) {
+ subjectAltNamePresent = asn1_schema_1.AsnParser.parse(ext.extnValue, asn1_x509_1.SubjectAlternativeName);
+ }
+ else if (ext.extnID === asn1_x509_1.id_ce_extKeyUsage) {
+ extKeyUsage = asn1_schema_1.AsnParser.parse(ext.extnValue, asn1_x509_1.ExtendedKeyUsage);
+ }
+ });
+ // Check that certificate contains subjectAltName (2.5.29.17) extension,
+ if (!subjectAltNamePresent) {
+ throw new Error('Certificate did not contain subjectAltName extension (TPM)');
+ }
+ // TPM-specific values are buried within `directoryName`, so first make sure there are values
+ // there.
+ if (!subjectAltNamePresent[0].directoryName?.[0].length) {
+ throw new Error('Certificate subjectAltName extension directoryName was empty (TPM)');
+ }
+ const { tcgAtTpmManufacturer, tcgAtTpmModel, tcgAtTpmVersion } = getTcgAtTpmValues(subjectAltNamePresent[0].directoryName);
+ if (!tcgAtTpmManufacturer || !tcgAtTpmModel || !tcgAtTpmVersion) {
+ throw new Error('Certificate contained incomplete subjectAltName data (TPM)');
+ }
+ if (!extKeyUsage) {
+ throw new Error('Certificate did not contain ExtendedKeyUsage extension (TPM)');
+ }
+ // Check that tcpaTpmManufacturer (2.23.133.2.1) field is set to a valid manufacturer ID.
+ if (!constants_js_1.TPM_MANUFACTURERS[tcgAtTpmManufacturer]) {
+ throw new Error(`Could not match TPM manufacturer "${tcgAtTpmManufacturer}" (TPM)`);
+ }
+ // Check that certificate contains extKeyUsage (2.5.29.37) extension and it must contain
+ // tcg-kp-AIKCertificate (2.23.133.8.3) OID.
+ if (extKeyUsage[0] !== '2.23.133.8.3') {
+ throw new Error(`Unexpected extKeyUsage "${extKeyUsage[0]}", expected "2.23.133.8.3" (TPM)`);
+ }
+ // Validate attestation statement AAGUID against leaf cert AAGUID
+ try {
+ await (0, validateExtFIDOGenCEAAGUID_js_1.validateExtFIDOGenCEAAGUID)(parsedCert.tbsCertificate.extensions, aaguid);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (TPM)`);
+ }
+ // Run some metadata checks if a statement exists for this authenticator
+ const statement = await metadataService_js_1.MetadataService.getStatement(aaguid);
+ if (statement) {
+ try {
+ await (0, verifyAttestationWithMetadata_js_1.verifyAttestationWithMetadata)({
+ statement,
+ credentialPublicKey,
+ x5c,
+ attestationStatementAlg: alg,
+ });
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (TPM)`);
+ }
+ }
+ else {
+ try {
+ // Try validating the certificate path using the root certificates set via SettingsService
+ await (0, validateCertificatePath_js_1.validateCertificatePath)(x5c.map(convertCertBufferToPEM_js_1.convertCertBufferToPEM), rootCertificates);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (TPM)`);
+ }
+ }
+ // Verify signature over certInfo with the public key extracted from AIK certificate.
+ // In the wise words of Yuriy Ackermann: "Get Martini friend, you are done!"
+ return (0, verifySignature_js_1.verifySignature)({
+ signature: sig,
+ data: certInfo,
+ x509Certificate: x5c[0],
+ hashAlgorithm: alg,
+ });
+}
+/**
+ * Contain logic for pulling TPM-specific values out of subjectAlternativeName extension
+ */
+function getTcgAtTpmValues(root) {
+ const oidManufacturer = '2.23.133.2.1';
+ const oidModel = '2.23.133.2.2';
+ const oidVersion = '2.23.133.2.3';
+ let tcgAtTpmManufacturer;
+ let tcgAtTpmModel;
+ let tcgAtTpmVersion;
+ /**
+ * Iterate through the following potential structures:
+ *
+ * (Good, follows the spec)
+ * https://trustedcomputinggroup.org/wp-content/uploads/TCG_IWG_EKCredentialProfile_v2p3_r2_pub.pdf (page 33)
+ * Name [
+ * RelativeDistinguishedName [
+ * AttributeTypeAndValue { type, value }
+ * ]
+ * RelativeDistinguishedName [
+ * AttributeTypeAndValue { type, value }
+ * ]
+ * RelativeDistinguishedName [
+ * AttributeTypeAndValue { type, value }
+ * ]
+ * ]
+ *
+ * (Bad, does not follow the spec)
+ * Name [
+ * RelativeDistinguishedName [
+ * AttributeTypeAndValue { type, value }
+ * AttributeTypeAndValue { type, value }
+ * AttributeTypeAndValue { type, value }
+ * ]
+ * ]
+ *
+ * Both structures have been seen in the wild and need to be supported
+ */
+ root.forEach((relName) => {
+ relName.forEach((attr) => {
+ if (attr.type === oidManufacturer) {
+ tcgAtTpmManufacturer = attr.value.toString();
+ }
+ else if (attr.type === oidModel) {
+ tcgAtTpmModel = attr.value.toString();
+ }
+ else if (attr.type === oidVersion) {
+ tcgAtTpmVersion = attr.value.toString();
+ }
+ });
+ });
+ return {
+ tcgAtTpmManufacturer,
+ tcgAtTpmModel,
+ tcgAtTpmVersion,
+ };
+}
+/**
+ * Convert TPM-specific SHA algorithm ID's with COSE-specific equivalents. Note that the choice to
+ * use ECDSA SHA IDs is arbitrary; any such COSEALG that would map to SHA-256 in
+ * `mapCoseAlgToWebCryptoAlg()`
+ *
+ * SHA IDs referenced from here:
+ *
+ * https://trustedcomputinggroup.org/wp-content/uploads/TCG_TPM2_r1p59_Part2_Structures_pub.pdf
+ */
+function attestedNameAlgToCOSEAlg(alg) {
+ if (alg === 'TPM_ALG_SHA256') {
+ return cose_js_1.COSEALG.ES256;
+ }
+ else if (alg === 'TPM_ALG_SHA384') {
+ return cose_js_1.COSEALG.ES384;
+ }
+ else if (alg === 'TPM_ALG_SHA512') {
+ return cose_js_1.COSEALG.ES512;
+ }
+ throw new Error(`Unexpected TPM attested name alg ${alg}`);
+}
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidKey.d.ts b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidKey.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3c3566a3f1b81c58e9422e4b14ce6946b9280cae
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidKey.d.ts
@@ -0,0 +1,6 @@
+import type { AttestationFormatVerifierOpts } from '../verifyRegistrationResponse.js';
+/**
+ * Verify an attestation response with fmt 'android-key'
+ */
+export declare function verifyAttestationAndroidKey(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationAndroidKey.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidKey.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidKey.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..4bd3129e9e10f9587ae93cb5cb0eb4ed339a1457
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidKey.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationAndroidKey.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationAndroidKey.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAUtF;;GAEG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA0JlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidKey.js b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidKey.js
new file mode 100644
index 0000000000000000000000000000000000000000..8d5447ccad87fcba6797b0252676041a860ba92f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidKey.js
@@ -0,0 +1,123 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyAttestationAndroidKey = verifyAttestationAndroidKey;
+const asn1_schema_1 = require("@peculiar/asn1-schema");
+const asn1_x509_1 = require("@peculiar/asn1-x509");
+const asn1_android_1 = require("@peculiar/asn1-android");
+const convertCertBufferToPEM_js_1 = require("../../helpers/convertCertBufferToPEM.js");
+const validateCertificatePath_js_1 = require("../../helpers/validateCertificatePath.js");
+const verifySignature_js_1 = require("../../helpers/verifySignature.js");
+const convertCOSEtoPKCS_js_1 = require("../../helpers/convertCOSEtoPKCS.js");
+const cose_js_1 = require("../../helpers/cose.js");
+const index_js_1 = require("../../helpers/iso/index.js");
+const metadataService_js_1 = require("../../services/metadataService.js");
+const verifyAttestationWithMetadata_js_1 = require("../../metadata/verifyAttestationWithMetadata.js");
+/**
+ * Verify an attestation response with fmt 'android-key'
+ */
+async function verifyAttestationAndroidKey(options) {
+ const { authData, clientDataHash, attStmt, credentialPublicKey, aaguid, rootCertificates, } = options;
+ const x5c = attStmt.get('x5c');
+ const sig = attStmt.get('sig');
+ const alg = attStmt.get('alg');
+ if (!x5c) {
+ throw new Error('No attestation certificate provided in attestation statement (Android Key)');
+ }
+ if (!sig) {
+ throw new Error('No attestation signature provided in attestation statement (Android Key)');
+ }
+ if (!alg) {
+ throw new Error(`Attestation statement did not contain alg (Android Key)`);
+ }
+ if (!(0, cose_js_1.isCOSEAlg)(alg)) {
+ throw new Error(`Attestation statement contained invalid alg ${alg} (Android Key)`);
+ }
+ /**
+ * Verify that the public key in the first certificate in x5c matches the credentialPublicKey in
+ * the attestedCredentialData in authenticatorData.
+ */
+ // Find the public cert in the certificate as PKCS
+ const parsedCert = asn1_schema_1.AsnParser.parse(x5c[0], asn1_x509_1.Certificate);
+ const parsedCertPubKey = new Uint8Array(parsedCert.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey);
+ // Convert the credentialPublicKey to PKCS
+ const credPubKeyPKCS = (0, convertCOSEtoPKCS_js_1.convertCOSEtoPKCS)(credentialPublicKey);
+ if (!index_js_1.isoUint8Array.areEqual(credPubKeyPKCS, parsedCertPubKey)) {
+ throw new Error('Credential public key does not equal leaf cert public key (Android Key)');
+ }
+ /**
+ * Verify that the attestationChallenge field in the attestation certificate extension data is
+ * identical to clientDataHash.
+ */
+ // Find Android KeyStore Extension in certificate extensions
+ const extKeyStore = parsedCert.tbsCertificate.extensions?.find((ext) => ext.extnID === asn1_android_1.id_ce_keyDescription);
+ if (!extKeyStore) {
+ throw new Error('Certificate did not contain extKeyStore (Android Key)');
+ }
+ const parsedExtKeyStore = asn1_schema_1.AsnParser.parse(extKeyStore.extnValue, asn1_android_1.KeyDescription);
+ // Verify extKeyStore values
+ const { attestationChallenge, teeEnforced, softwareEnforced } = parsedExtKeyStore;
+ if (!index_js_1.isoUint8Array.areEqual(new Uint8Array(attestationChallenge.buffer), clientDataHash)) {
+ throw new Error('Attestation challenge was not equal to client data hash (Android Key)');
+ }
+ /**
+ * The AuthorizationList.allApplications field is not present on either authorization list
+ * (softwareEnforced nor teeEnforced), since PublicKeyCredential MUST be scoped to the RP ID.
+ *
+ * (i.e. These shouldn't contain the [600] tag)
+ */
+ if (teeEnforced.allApplications !== undefined) {
+ throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)');
+ }
+ if (softwareEnforced.allApplications !== undefined) {
+ throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)');
+ }
+ const statement = await metadataService_js_1.MetadataService.getStatement(aaguid);
+ if (statement) {
+ try {
+ await (0, verifyAttestationWithMetadata_js_1.verifyAttestationWithMetadata)({
+ statement,
+ credentialPublicKey,
+ x5c,
+ attestationStatementAlg: alg,
+ });
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Android Key)`, { cause: _err });
+ }
+ }
+ else {
+ /**
+ * Verify that x5c contains a full certificate path.
+ */
+ const x5cNoRootPEM = x5c.slice(0, -1).map(convertCertBufferToPEM_js_1.convertCertBufferToPEM);
+ const x5cRootPEM = x5c.slice(-1).map(convertCertBufferToPEM_js_1.convertCertBufferToPEM);
+ try {
+ await (0, validateCertificatePath_js_1.validateCertificatePath)(x5cNoRootPEM, x5cRootPEM);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Android Key)`, { cause: _err });
+ }
+ /**
+ * Make sure the root certificate is one of the Google Hardware Attestation Root certificates
+ *
+ * https://developer.android.com/privacy-and-security/security-key-attestation#root_certificate
+ */
+ if (rootCertificates.length > 0 && rootCertificates.indexOf(x5cRootPEM[0]) < 0) {
+ throw new Error('x5c root certificate was not a known root certificate (Android Key)');
+ }
+ }
+ /**
+ * Verify that sig is a valid signature over the concatenation of authenticatorData and
+ * clientDataHash using the public key in the first certificate in x5c with the algorithm
+ * specified in alg.
+ */
+ const signatureBase = index_js_1.isoUint8Array.concat([authData, clientDataHash]);
+ return (0, verifySignature_js_1.verifySignature)({
+ signature: sig,
+ data: signatureBase,
+ x509Certificate: x5c[0],
+ hashAlgorithm: alg,
+ });
+}
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..411eda1f30e60817636d6421e535125cde5d1b47
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts
@@ -0,0 +1,6 @@
+import type { AttestationFormatVerifierOpts } from '../verifyRegistrationResponse.js';
+/**
+ * Verify an attestation response with fmt 'android-safetynet'
+ */
+export declare function verifyAttestationAndroidSafetyNet(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationAndroidSafetyNet.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..a22ee0a90b8ed88451aa6c5ec5b9d0f231f4d82a
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationAndroidSafetyNet.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationAndroidSafetyNet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAWtF;;GAEG;AACH,wBAAsB,iCAAiC,CACrD,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA6IlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidSafetyNet.js b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidSafetyNet.js
new file mode 100644
index 0000000000000000000000000000000000000000..efcab22dbddb4aedb482ad88e8f7ef04c3f79061
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidSafetyNet.js
@@ -0,0 +1,116 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyAttestationAndroidSafetyNet = verifyAttestationAndroidSafetyNet;
+const toHash_js_1 = require("../../helpers/toHash.js");
+const verifySignature_js_1 = require("../../helpers/verifySignature.js");
+const getCertificateInfo_js_1 = require("../../helpers/getCertificateInfo.js");
+const validateCertificatePath_js_1 = require("../../helpers/validateCertificatePath.js");
+const convertCertBufferToPEM_js_1 = require("../../helpers/convertCertBufferToPEM.js");
+const index_js_1 = require("../../helpers/iso/index.js");
+const metadataService_js_1 = require("../../services/metadataService.js");
+const verifyAttestationWithMetadata_js_1 = require("../../metadata/verifyAttestationWithMetadata.js");
+/**
+ * Verify an attestation response with fmt 'android-safetynet'
+ */
+async function verifyAttestationAndroidSafetyNet(options) {
+ const { attStmt, clientDataHash, authData, aaguid, rootCertificates, verifyTimestampMS = true, credentialPublicKey, attestationSafetyNetEnforceCTSCheck, } = options;
+ const alg = attStmt.get('alg');
+ const response = attStmt.get('response');
+ const ver = attStmt.get('ver');
+ if (!ver) {
+ throw new Error('No ver value in attestation (SafetyNet)');
+ }
+ if (!response) {
+ throw new Error('No response was included in attStmt by authenticator (SafetyNet)');
+ }
+ // Prepare to verify a JWT
+ const jwt = index_js_1.isoUint8Array.toUTF8String(response);
+ const jwtParts = jwt.split('.');
+ const HEADER = JSON.parse(index_js_1.isoBase64URL.toUTF8String(jwtParts[0]));
+ const PAYLOAD = JSON.parse(index_js_1.isoBase64URL.toUTF8String(jwtParts[1]));
+ const SIGNATURE = jwtParts[2];
+ /**
+ * START Verify PAYLOAD
+ */
+ const { nonce, ctsProfileMatch, timestampMs } = PAYLOAD;
+ if (verifyTimestampMS) {
+ // Make sure timestamp is in the past
+ let now = Date.now();
+ if (timestampMs > Date.now()) {
+ throw new Error(`Payload timestamp "${timestampMs}" was later than "${now}" (SafetyNet)`);
+ }
+ // Consider a SafetyNet attestation valid within a minute of it being performed
+ const timestampPlusDelay = timestampMs + 60 * 1000;
+ now = Date.now();
+ if (timestampPlusDelay < now) {
+ throw new Error(`Payload timestamp "${timestampPlusDelay}" has expired (SafetyNet)`);
+ }
+ }
+ const nonceBase = index_js_1.isoUint8Array.concat([authData, clientDataHash]);
+ const nonceBuffer = await (0, toHash_js_1.toHash)(nonceBase);
+ const expectedNonce = index_js_1.isoBase64URL.fromBuffer(nonceBuffer, 'base64');
+ if (nonce !== expectedNonce) {
+ throw new Error('Could not verify payload nonce (SafetyNet)');
+ }
+ if (attestationSafetyNetEnforceCTSCheck && !ctsProfileMatch) {
+ throw new Error('Could not verify device integrity (SafetyNet)');
+ }
+ /**
+ * END Verify PAYLOAD
+ */
+ /**
+ * START Verify Header
+ */
+ // `HEADER.x5c[0]` is definitely a base64 string
+ const leafCertBuffer = index_js_1.isoBase64URL.toBuffer(HEADER.x5c[0], 'base64');
+ const leafCertInfo = (0, getCertificateInfo_js_1.getCertificateInfo)(leafCertBuffer);
+ const { subject } = leafCertInfo;
+ // Ensure the certificate was issued to this hostname
+ // See https://developer.android.com/training/safetynet/attestation#verify-attestation-response
+ if (subject.CN !== 'attest.android.com') {
+ throw new Error('Certificate common name was not "attest.android.com" (SafetyNet)');
+ }
+ const statement = await metadataService_js_1.MetadataService.getStatement(aaguid);
+ if (statement) {
+ try {
+ await (0, verifyAttestationWithMetadata_js_1.verifyAttestationWithMetadata)({
+ statement,
+ credentialPublicKey,
+ x5c: HEADER.x5c,
+ attestationStatementAlg: alg,
+ });
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (SafetyNet)`);
+ }
+ }
+ else {
+ try {
+ // Try validating the certificate path using the root certificates set via SettingsService
+ await (0, validateCertificatePath_js_1.validateCertificatePath)(HEADER.x5c.map(convertCertBufferToPEM_js_1.convertCertBufferToPEM), rootCertificates);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (SafetyNet)`);
+ }
+ }
+ /**
+ * END Verify Header
+ */
+ /**
+ * START Verify Signature
+ */
+ const signatureBaseBuffer = index_js_1.isoUint8Array.fromUTF8String(`${jwtParts[0]}.${jwtParts[1]}`);
+ const signatureBuffer = index_js_1.isoBase64URL.toBuffer(SIGNATURE);
+ const verified = await (0, verifySignature_js_1.verifySignature)({
+ signature: signatureBuffer,
+ data: signatureBaseBuffer,
+ x509Certificate: leafCertBuffer,
+ hashAlgorithm: alg,
+ });
+ /**
+ * END Verify Signature
+ */
+ return verified;
+}
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationApple.d.ts b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationApple.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c998a454a2e6d012ac90f7627cdcd91f4f9b64df
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationApple.d.ts
@@ -0,0 +1,3 @@
+import type { AttestationFormatVerifierOpts } from '../verifyRegistrationResponse.js';
+export declare function verifyAttestationApple(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationApple.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationApple.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationApple.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..c88e16194919abae68de2c5fc8b62e3ccb27ffeb
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationApple.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationApple.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationApple.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAOtF,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA6ElB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationApple.js b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationApple.js
new file mode 100644
index 0000000000000000000000000000000000000000..4af578849934de5259776eb3cc231315358063cb
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationApple.js
@@ -0,0 +1,61 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyAttestationApple = verifyAttestationApple;
+const asn1_schema_1 = require("@peculiar/asn1-schema");
+const asn1_x509_1 = require("@peculiar/asn1-x509");
+const validateCertificatePath_js_1 = require("../../helpers/validateCertificatePath.js");
+const convertCertBufferToPEM_js_1 = require("../../helpers/convertCertBufferToPEM.js");
+const toHash_js_1 = require("../../helpers/toHash.js");
+const convertCOSEtoPKCS_js_1 = require("../../helpers/convertCOSEtoPKCS.js");
+const index_js_1 = require("../../helpers/iso/index.js");
+async function verifyAttestationApple(options) {
+ const { attStmt, authData, clientDataHash, credentialPublicKey, rootCertificates, } = options;
+ const x5c = attStmt.get('x5c');
+ if (!x5c) {
+ throw new Error('No attestation certificate provided in attestation statement (Apple)');
+ }
+ /**
+ * Verify certificate path
+ */
+ try {
+ await (0, validateCertificatePath_js_1.validateCertificatePath)(x5c.map(convertCertBufferToPEM_js_1.convertCertBufferToPEM), rootCertificates);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Apple)`);
+ }
+ /**
+ * Compare nonce in certificate extension to computed nonce
+ */
+ const parsedCredCert = asn1_schema_1.AsnParser.parse(x5c[0], asn1_x509_1.Certificate);
+ const { extensions, subjectPublicKeyInfo } = parsedCredCert.tbsCertificate;
+ if (!extensions) {
+ throw new Error('credCert missing extensions (Apple)');
+ }
+ const extCertNonce = extensions.find((ext) => ext.extnID === '1.2.840.113635.100.8.2');
+ if (!extCertNonce) {
+ throw new Error('credCert missing "1.2.840.113635.100.8.2" extension (Apple)');
+ }
+ const nonceToHash = index_js_1.isoUint8Array.concat([authData, clientDataHash]);
+ const nonce = await (0, toHash_js_1.toHash)(nonceToHash);
+ /**
+ * Ignore the first six ASN.1 structure bytes that define the nonce as an OCTET STRING. Should
+ * trim off
+ *
+ * TODO: Try and get @peculiar (GitHub) to add a schema for "1.2.840.113635.100.8.2" when we
+ * find out where it's defined (doesn't seem to be publicly documented at the moment...)
+ */
+ const extNonce = new Uint8Array(extCertNonce.extnValue.buffer).slice(6);
+ if (!index_js_1.isoUint8Array.areEqual(nonce, extNonce)) {
+ throw new Error(`credCert nonce was not expected value (Apple)`);
+ }
+ /**
+ * Verify credential public key matches the Subject Public Key of credCert
+ */
+ const credPubKeyPKCS = (0, convertCOSEtoPKCS_js_1.convertCOSEtoPKCS)(credentialPublicKey);
+ const credCertSubjectPublicKey = new Uint8Array(subjectPublicKeyInfo.subjectPublicKey);
+ if (!index_js_1.isoUint8Array.areEqual(credPubKeyPKCS, credCertSubjectPublicKey)) {
+ throw new Error('Credential public key does not equal credCert public key (Apple)');
+ }
+ return true;
+}
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationFIDOU2F.d.ts b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationFIDOU2F.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4c8818418974391300bdf7a08fe2a1204844f266
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationFIDOU2F.d.ts
@@ -0,0 +1,6 @@
+import type { AttestationFormatVerifierOpts } from '../verifyRegistrationResponse.js';
+/**
+ * Verify an attestation response with fmt 'fido-u2f'
+ */
+export declare function verifyAttestationFIDOU2F(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationFIDOU2F.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationFIDOU2F.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationFIDOU2F.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f665a87f0dfec6f31a6f19b521eae041ae420913
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationFIDOU2F.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationFIDOU2F.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationFIDOU2F.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAStF;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA4DlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationFIDOU2F.js b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationFIDOU2F.js
new file mode 100644
index 0000000000000000000000000000000000000000..77fd0c10c026bd45b7cde06fd40f5000605bb1a2
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationFIDOU2F.js
@@ -0,0 +1,51 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyAttestationFIDOU2F = verifyAttestationFIDOU2F;
+const convertCOSEtoPKCS_js_1 = require("../../helpers/convertCOSEtoPKCS.js");
+const convertCertBufferToPEM_js_1 = require("../../helpers/convertCertBufferToPEM.js");
+const validateCertificatePath_js_1 = require("../../helpers/validateCertificatePath.js");
+const verifySignature_js_1 = require("../../helpers/verifySignature.js");
+const index_js_1 = require("../../helpers/iso/index.js");
+const cose_js_1 = require("../../helpers/cose.js");
+/**
+ * Verify an attestation response with fmt 'fido-u2f'
+ */
+async function verifyAttestationFIDOU2F(options) {
+ const { attStmt, clientDataHash, rpIdHash, credentialID, credentialPublicKey, aaguid, rootCertificates, } = options;
+ const reservedByte = Uint8Array.from([0x00]);
+ const publicKey = (0, convertCOSEtoPKCS_js_1.convertCOSEtoPKCS)(credentialPublicKey);
+ const signatureBase = index_js_1.isoUint8Array.concat([
+ reservedByte,
+ rpIdHash,
+ clientDataHash,
+ credentialID,
+ publicKey,
+ ]);
+ const sig = attStmt.get('sig');
+ const x5c = attStmt.get('x5c');
+ if (!x5c) {
+ throw new Error('No attestation certificate provided in attestation statement (FIDOU2F)');
+ }
+ if (!sig) {
+ throw new Error('No attestation signature provided in attestation statement (FIDOU2F)');
+ }
+ // FIDO spec says that aaguid _must_ equal 0x00 here to be legit
+ const aaguidToHex = Number.parseInt(index_js_1.isoUint8Array.toHex(aaguid), 16);
+ if (aaguidToHex !== 0x00) {
+ throw new Error(`AAGUID "${aaguidToHex}" was not expected value`);
+ }
+ try {
+ // Try validating the certificate path using the root certificates set via SettingsService
+ await (0, validateCertificatePath_js_1.validateCertificatePath)(x5c.map(convertCertBufferToPEM_js_1.convertCertBufferToPEM), rootCertificates);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (FIDOU2F)`);
+ }
+ return (0, verifySignature_js_1.verifySignature)({
+ signature: sig,
+ data: signatureBase,
+ x509Certificate: x5c[0],
+ hashAlgorithm: cose_js_1.COSEALG.ES256,
+ });
+}
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationPacked.d.ts b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationPacked.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7b54a02d24c42731533d75b8612bb3e0368ad3d3
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationPacked.d.ts
@@ -0,0 +1,6 @@
+import type { AttestationFormatVerifierOpts } from '../verifyRegistrationResponse.js';
+/**
+ * Verify an attestation response with fmt 'packed'
+ */
+export declare function verifyAttestationPacked(options: AttestationFormatVerifierOpts): Promise;
+//# sourceMappingURL=verifyAttestationPacked.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationPacked.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationPacked.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..65e0747378cdb2b6d9c18e88f81d07d46ae7b32b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationPacked.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"verifyAttestationPacked.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationPacked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAYtF;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CA0JlB"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationPacked.js b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationPacked.js
new file mode 100644
index 0000000000000000000000000000000000000000..cb9ca872f8121382c34ec85f2270381a54ffe073
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationPacked.js
@@ -0,0 +1,116 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyAttestationPacked = verifyAttestationPacked;
+const cose_js_1 = require("../../helpers/cose.js");
+const convertCertBufferToPEM_js_1 = require("../../helpers/convertCertBufferToPEM.js");
+const validateCertificatePath_js_1 = require("../../helpers/validateCertificatePath.js");
+const getCertificateInfo_js_1 = require("../../helpers/getCertificateInfo.js");
+const verifySignature_js_1 = require("../../helpers/verifySignature.js");
+const index_js_1 = require("../../helpers/iso/index.js");
+const validateExtFIDOGenCEAAGUID_js_1 = require("../../helpers/validateExtFIDOGenCEAAGUID.js");
+const metadataService_js_1 = require("../../services/metadataService.js");
+const verifyAttestationWithMetadata_js_1 = require("../../metadata/verifyAttestationWithMetadata.js");
+/**
+ * Verify an attestation response with fmt 'packed'
+ */
+async function verifyAttestationPacked(options) {
+ const { attStmt, clientDataHash, authData, credentialPublicKey, aaguid, rootCertificates, } = options;
+ const sig = attStmt.get('sig');
+ const x5c = attStmt.get('x5c');
+ const alg = attStmt.get('alg');
+ if (!sig) {
+ throw new Error('No attestation signature provided in attestation statement (Packed)');
+ }
+ if (!alg) {
+ throw new Error('Attestation statement did not contain alg (Packed)');
+ }
+ if (!(0, cose_js_1.isCOSEAlg)(alg)) {
+ throw new Error(`Attestation statement contained invalid alg ${alg} (Packed)`);
+ }
+ const signatureBase = index_js_1.isoUint8Array.concat([authData, clientDataHash]);
+ let verified = false;
+ if (x5c) {
+ const { subject, basicConstraintsCA, version, notBefore, notAfter, parsedCertificate, } = (0, getCertificateInfo_js_1.getCertificateInfo)(x5c[0]);
+ const { OU, CN, O, C } = subject;
+ if (OU !== 'Authenticator Attestation') {
+ throw new Error('Certificate OU was not "Authenticator Attestation" (Packed|Full)');
+ }
+ if (!CN) {
+ throw new Error('Certificate CN was empty (Packed|Full)');
+ }
+ if (!O) {
+ throw new Error('Certificate O was empty (Packed|Full)');
+ }
+ if (!C || C.length !== 2) {
+ throw new Error('Certificate C was not two-character ISO 3166 code (Packed|Full)');
+ }
+ if (basicConstraintsCA) {
+ throw new Error('Certificate basic constraints CA was not `false` (Packed|Full)');
+ }
+ if (version !== 2) {
+ throw new Error('Certificate version was not `3` (ASN.1 value of 2) (Packed|Full)');
+ }
+ let now = new Date();
+ if (notBefore > now) {
+ throw new Error(`Certificate not good before "${notBefore.toString()}" (Packed|Full)`);
+ }
+ now = new Date();
+ if (notAfter < now) {
+ throw new Error(`Certificate not good after "${notAfter.toString()}" (Packed|Full)`);
+ }
+ // Validate attestation statement AAGUID against leaf cert AAGUID
+ try {
+ await (0, validateExtFIDOGenCEAAGUID_js_1.validateExtFIDOGenCEAAGUID)(parsedCertificate.tbsCertificate.extensions, aaguid);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Packed|Full)`);
+ }
+ // If available, validate attestation alg and x5c with info in the metadata statement
+ const statement = await metadataService_js_1.MetadataService.getStatement(aaguid);
+ if (statement) {
+ // The presence of x5c means this is a full attestation. Check to see if attestationTypes
+ // includes packed attestations.
+ if (statement.attestationTypes.indexOf('basic_full') < 0) {
+ throw new Error('Metadata does not indicate support for full attestations (Packed|Full)');
+ }
+ try {
+ await (0, verifyAttestationWithMetadata_js_1.verifyAttestationWithMetadata)({
+ statement,
+ credentialPublicKey,
+ x5c,
+ attestationStatementAlg: alg,
+ });
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Packed|Full)`);
+ }
+ }
+ else {
+ try {
+ // Try validating the certificate path using the root certificates set via SettingsService
+ await (0, validateCertificatePath_js_1.validateCertificatePath)(x5c.map(convertCertBufferToPEM_js_1.convertCertBufferToPEM), rootCertificates);
+ }
+ catch (err) {
+ const _err = err;
+ throw new Error(`${_err.message} (Packed|Full)`);
+ }
+ }
+ verified = await (0, verifySignature_js_1.verifySignature)({
+ signature: sig,
+ data: signatureBase,
+ x509Certificate: x5c[0],
+ hashAlgorithm: alg,
+ });
+ }
+ else {
+ verified = await (0, verifySignature_js_1.verifySignature)({
+ signature: sig,
+ data: signatureBase,
+ credentialPublicKey,
+ hashAlgorithm: alg,
+ });
+ }
+ return verified;
+}
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifyRegistrationResponse.d.ts b/node_modules/@simplewebauthn/server/script/registration/verifyRegistrationResponse.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3460d16c90dc23bee4fdef46ebb8bed6f3249094
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifyRegistrationResponse.d.ts
@@ -0,0 +1,94 @@
+import type { COSEAlgorithmIdentifier, CredentialDeviceType, RegistrationResponseJSON, Uint8Array_, WebAuthnCredential } from '../types/index.js';
+import { type AttestationFormat, type AttestationStatement } from '../helpers/decodeAttestationObject.js';
+import type { AuthenticationExtensionsAuthenticatorOutputs } from '../helpers/decodeAuthenticatorExtensions.js';
+/**
+ * Configurable options when calling `verifyRegistrationResponse()`
+ */
+export type VerifyRegistrationResponseOpts = Parameters[0];
+/**
+ * Verify that the user has legitimately completed the registration process
+ *
+ * **Options:**
+ *
+ * @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`
+ * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateRegistrationOptions()`
+ * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
+ * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
+ * @param expectedType **(Optional)** - The response type expected ('webauthn.create')
+ * @param requireUserPresence **(Optional)** - Enforce user presence by the authenticator (or skip it during auto registration) Defaults to `true`
+ * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
+ * @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
+ * @param attestationSafetyNetEnforceCTSCheck **(Optional)** - Require that an Android device's system integrity has not been tampered with if it uses SafetyNet attestation. Defaults to `true`
+ */
+export declare function verifyRegistrationResponse(options: {
+ response: RegistrationResponseJSON;
+ expectedChallenge: string | ((challenge: string) => boolean | Promise);
+ expectedOrigin: string | string[];
+ expectedRPID?: string | string[];
+ expectedType?: string | string[];
+ requireUserPresence?: boolean;
+ requireUserVerification?: boolean;
+ supportedAlgorithmIDs?: COSEAlgorithmIdentifier[];
+ attestationSafetyNetEnforceCTSCheck?: boolean;
+}): Promise;
+/**
+ * Result of registration verification
+ *
+ * @param verified If the assertion response could be verified
+ * @param registrationInfo.fmt Type of attestation
+ * @param registrationInfo.counter The number of times the authenticator reported it has been used.
+ * **Should be kept in a DB for later reference to help prevent replay attacks!**
+ * @param registrationInfo.aaguid Authenticator's Attestation GUID indicating the type of the
+ * authenticator
+ * @param registrationInfo.credentialPublicKey The credential's public key
+ * @param registrationInfo.credentialID The credential's credential ID for the public key above
+ * @param registrationInfo.credentialType The type of the credential returned by the browser
+ * @param registrationInfo.userVerified Whether the user was uniquely identified during attestation
+ * @param registrationInfo.attestationObject The raw `response.attestationObject` Buffer returned by
+ * the authenticator
+ * @param registrationInfo.credentialDeviceType Whether this is a single-device or multi-device
+ * credential. **Should be kept in a DB for later reference!**
+ * @param registrationInfo.credentialBackedUp Whether or not the multi-device credential has been
+ * backed up. Always `false` for single-device credentials. **Should be kept in a DB for later
+ * reference!**
+ * @param registrationInfo.origin The origin of the website that the registration occurred on
+ * @param registrationInfo?.rpID The RP ID that the registration occurred on, if one or more were
+ * specified in the registration options
+ * @param registrationInfo?.authenticatorExtensionResults The authenticator extensions returned
+ * by the browser
+ */
+export type VerifiedRegistrationResponse = {
+ verified: false;
+ registrationInfo?: never;
+} | {
+ verified: true;
+ registrationInfo: {
+ fmt: AttestationFormat;
+ aaguid: string;
+ credential: WebAuthnCredential;
+ credentialType: 'public-key';
+ attestationObject: Uint8Array_;
+ userVerified: boolean;
+ credentialDeviceType: CredentialDeviceType;
+ credentialBackedUp: boolean;
+ origin: string;
+ rpID?: string;
+ authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs;
+ };
+};
+/**
+ * Values passed to all attestation format verifiers, from which they are free to use as they please
+ */
+export type AttestationFormatVerifierOpts = {
+ aaguid: Uint8Array_;
+ attStmt: AttestationStatement;
+ authData: Uint8Array_;
+ clientDataHash: Uint8Array_;
+ credentialID: Uint8Array_;
+ credentialPublicKey: Uint8Array_;
+ rootCertificates: string[];
+ rpIdHash: Uint8Array_;
+ verifyTimestampMS?: boolean;
+ attestationSafetyNetEnforceCTSCheck?: boolean;
+};
+//# sourceMappingURL=verifyRegistrationResponse.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifyRegistrationResponse.d.ts.map b/node_modules/@simplewebauthn/server/script/registration/verifyRegistrationResponse.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f5230294f78f8d46ca07113c389fff4da2ddcdd8
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifyRegistrationResponse.d.ts.map
@@ -0,0 +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,WAAW,EACX,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAE1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,4CAA4C,EAAE,MAAM,6CAA6C,CAAC;AAoBhH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,UAAU,CA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;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,EAAE,WAAW,CAAC;IACtB,cAAc,EAAE,WAAW,CAAC;IAC5B,YAAY,EAAE,WAAW,CAAC;IAC1B,mBAAmB,EAAE,WAAW,CAAC;IACjC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,EAAE,WAAW,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mCAAmC,CAAC,EAAE,OAAO,CAAC;CAC/C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/registration/verifyRegistrationResponse.js b/node_modules/@simplewebauthn/server/script/registration/verifyRegistrationResponse.js
new file mode 100644
index 0000000000000000000000000000000000000000..a275bdb6d58676f23ed019754ccddfc93537b05e
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/registration/verifyRegistrationResponse.js
@@ -0,0 +1,216 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyRegistrationResponse = verifyRegistrationResponse;
+const decodeAttestationObject_js_1 = require("../helpers/decodeAttestationObject.js");
+const decodeClientDataJSON_js_1 = require("../helpers/decodeClientDataJSON.js");
+const parseAuthenticatorData_js_1 = require("../helpers/parseAuthenticatorData.js");
+const toHash_js_1 = require("../helpers/toHash.js");
+const decodeCredentialPublicKey_js_1 = require("../helpers/decodeCredentialPublicKey.js");
+const cose_js_1 = require("../helpers/cose.js");
+const convertAAGUIDToString_js_1 = require("../helpers/convertAAGUIDToString.js");
+const parseBackupFlags_js_1 = require("../helpers/parseBackupFlags.js");
+const matchExpectedRPID_js_1 = require("../helpers/matchExpectedRPID.js");
+const index_js_1 = require("../helpers/iso/index.js");
+const settingsService_js_1 = require("../services/settingsService.js");
+const generateRegistrationOptions_js_1 = require("./generateRegistrationOptions.js");
+const verifyAttestationFIDOU2F_js_1 = require("./verifications/verifyAttestationFIDOU2F.js");
+const verifyAttestationPacked_js_1 = require("./verifications/verifyAttestationPacked.js");
+const verifyAttestationAndroidSafetyNet_js_1 = require("./verifications/verifyAttestationAndroidSafetyNet.js");
+const verifyAttestationTPM_js_1 = require("./verifications/tpm/verifyAttestationTPM.js");
+const verifyAttestationAndroidKey_js_1 = require("./verifications/verifyAttestationAndroidKey.js");
+const verifyAttestationApple_js_1 = require("./verifications/verifyAttestationApple.js");
+/**
+ * Verify that the user has legitimately completed the registration process
+ *
+ * **Options:**
+ *
+ * @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`
+ * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateRegistrationOptions()`
+ * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
+ * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
+ * @param expectedType **(Optional)** - The response type expected ('webauthn.create')
+ * @param requireUserPresence **(Optional)** - Enforce user presence by the authenticator (or skip it during auto registration) Defaults to `true`
+ * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
+ * @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
+ * @param attestationSafetyNetEnforceCTSCheck **(Optional)** - Require that an Android device's system integrity has not been tampered with if it uses SafetyNet attestation. Defaults to `true`
+ */
+async function verifyRegistrationResponse(options) {
+ const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, requireUserPresence = true, requireUserVerification = true, supportedAlgorithmIDs = generateRegistrationOptions_js_1.supportedCOSEAlgorithmIdentifiers, attestationSafetyNetEnforceCTSCheck = true, } = options;
+ const { id, rawId, type: credentialType, response: attestationResponse } = response;
+ // Ensure credential specified an ID
+ if (!id) {
+ throw new Error('Missing credential ID');
+ }
+ // Ensure ID is base64url-encoded
+ if (id !== rawId) {
+ throw new Error('Credential ID was not base64url-encoded');
+ }
+ // Make sure credential type is public-key
+ if (credentialType !== 'public-key') {
+ throw new Error(`Unexpected credential type ${credentialType}, expected "public-key"`);
+ }
+ const clientDataJSON = (0, decodeClientDataJSON_js_1.decodeClientDataJSON)(attestationResponse.clientDataJSON);
+ const { type, origin, challenge, tokenBinding } = clientDataJSON;
+ // Make sure we're handling an registration
+ if (Array.isArray(expectedType)) {
+ if (!expectedType.includes(type)) {
+ const joinedExpectedType = expectedType.join(', ');
+ throw new Error(`Unexpected registration response type "${type}", expected one of: ${joinedExpectedType}`);
+ }
+ }
+ else if (expectedType) {
+ if (type !== expectedType) {
+ throw new Error(`Unexpected registration response type "${type}", expected "${expectedType}"`);
+ }
+ }
+ else if (type !== 'webauthn.create') {
+ throw new Error(`Unexpected registration response type: ${type}`);
+ }
+ // Ensure the device provided the challenge we gave it
+ if (typeof expectedChallenge === 'function') {
+ if (!(await expectedChallenge(challenge))) {
+ throw new Error(`Custom challenge verifier returned false for registration response challenge "${challenge}"`);
+ }
+ }
+ else if (challenge !== expectedChallenge) {
+ throw new Error(`Unexpected registration response challenge "${challenge}", expected "${expectedChallenge}"`);
+ }
+ // Check that the origin is our site
+ if (Array.isArray(expectedOrigin)) {
+ if (!expectedOrigin.includes(origin)) {
+ throw new Error(`Unexpected registration response origin "${origin}", expected one of: ${expectedOrigin.join(', ')}`);
+ }
+ }
+ else {
+ if (origin !== expectedOrigin) {
+ throw new Error(`Unexpected registration response origin "${origin}", expected "${expectedOrigin}"`);
+ }
+ }
+ if (tokenBinding) {
+ if (typeof tokenBinding !== 'object') {
+ throw new Error(`Unexpected value for TokenBinding "${tokenBinding}"`);
+ }
+ if (['present', 'supported', 'not-supported'].indexOf(tokenBinding.status) < 0) {
+ throw new Error(`Unexpected tokenBinding.status value of "${tokenBinding.status}"`);
+ }
+ }
+ const attestationObject = index_js_1.isoBase64URL.toBuffer(attestationResponse.attestationObject);
+ const decodedAttestationObject = (0, decodeAttestationObject_js_1.decodeAttestationObject)(attestationObject);
+ const fmt = decodedAttestationObject.get('fmt');
+ const authData = decodedAttestationObject.get('authData');
+ const attStmt = decodedAttestationObject.get('attStmt');
+ const parsedAuthData = (0, parseAuthenticatorData_js_1.parseAuthenticatorData)(authData);
+ const { aaguid, rpIdHash, flags, credentialID, counter, credentialPublicKey, extensionsData, } = parsedAuthData;
+ // Make sure the response's RP ID is ours
+ let matchedRPID;
+ if (expectedRPID) {
+ let expectedRPIDs = [];
+ if (typeof expectedRPID === 'string') {
+ expectedRPIDs = [expectedRPID];
+ }
+ else {
+ expectedRPIDs = expectedRPID;
+ }
+ matchedRPID = await (0, matchExpectedRPID_js_1.matchExpectedRPID)(rpIdHash, expectedRPIDs);
+ }
+ // Make sure someone was physically present
+ if (requireUserPresence && !flags.up) {
+ throw new Error('User presence was required, but user was not present');
+ }
+ // Enforce user verification if specified
+ if (requireUserVerification && !flags.uv) {
+ throw new Error('User verification was required, but user could not be verified');
+ }
+ if (!credentialID) {
+ throw new Error('No credential ID was provided by authenticator');
+ }
+ if (!credentialPublicKey) {
+ throw new Error('No public key was provided by authenticator');
+ }
+ if (!aaguid) {
+ throw new Error('No AAGUID was present during registration');
+ }
+ const decodedPublicKey = (0, decodeCredentialPublicKey_js_1.decodeCredentialPublicKey)(credentialPublicKey);
+ const alg = decodedPublicKey.get(cose_js_1.COSEKEYS.alg);
+ if (typeof alg !== 'number') {
+ throw new Error('Credential public key was missing numeric alg');
+ }
+ // Make sure the key algorithm is one we specified within the registration options
+ if (!supportedAlgorithmIDs.includes(alg)) {
+ const supported = supportedAlgorithmIDs.join(', ');
+ throw new Error(`Unexpected public key alg "${alg}", expected one of "${supported}"`);
+ }
+ const clientDataHash = await (0, toHash_js_1.toHash)(index_js_1.isoBase64URL.toBuffer(attestationResponse.clientDataJSON));
+ const rootCertificates = settingsService_js_1.SettingsService.getRootCertificates({
+ identifier: fmt,
+ });
+ // Prepare arguments to pass to the relevant verification method
+ const verifierOpts = {
+ aaguid,
+ attStmt,
+ authData,
+ clientDataHash,
+ credentialID,
+ credentialPublicKey,
+ rootCertificates,
+ rpIdHash,
+ attestationSafetyNetEnforceCTSCheck,
+ };
+ /**
+ * Verification can only be performed when attestation = 'direct'
+ */
+ let verified = false;
+ if (fmt === 'fido-u2f') {
+ verified = await (0, verifyAttestationFIDOU2F_js_1.verifyAttestationFIDOU2F)(verifierOpts);
+ }
+ else if (fmt === 'packed') {
+ verified = await (0, verifyAttestationPacked_js_1.verifyAttestationPacked)(verifierOpts);
+ }
+ else if (fmt === 'android-safetynet') {
+ verified = await (0, verifyAttestationAndroidSafetyNet_js_1.verifyAttestationAndroidSafetyNet)(verifierOpts);
+ }
+ else if (fmt === 'android-key') {
+ verified = await (0, verifyAttestationAndroidKey_js_1.verifyAttestationAndroidKey)(verifierOpts);
+ }
+ else if (fmt === 'tpm') {
+ verified = await (0, verifyAttestationTPM_js_1.verifyAttestationTPM)(verifierOpts);
+ }
+ else if (fmt === 'apple') {
+ verified = await (0, verifyAttestationApple_js_1.verifyAttestationApple)(verifierOpts);
+ }
+ else if (fmt === 'none') {
+ if (attStmt.size > 0) {
+ throw new Error('None attestation had unexpected attestation statement');
+ }
+ // This is the weaker of the attestations, so there's nothing else to really check
+ verified = true;
+ }
+ else {
+ throw new Error(`Unsupported Attestation Format: ${fmt}`);
+ }
+ if (!verified) {
+ return { verified: false };
+ }
+ const { credentialDeviceType, credentialBackedUp } = (0, parseBackupFlags_js_1.parseBackupFlags)(flags);
+ return {
+ verified: true,
+ registrationInfo: {
+ fmt,
+ aaguid: (0, convertAAGUIDToString_js_1.convertAAGUIDToString)(aaguid),
+ credentialType,
+ credential: {
+ id: index_js_1.isoBase64URL.fromBuffer(credentialID),
+ publicKey: credentialPublicKey,
+ counter,
+ transports: response.response.transports,
+ },
+ attestationObject,
+ userVerified: flags.uv,
+ credentialDeviceType,
+ credentialBackedUp,
+ origin: clientDataJSON.origin,
+ rpID: matchedRPID,
+ authenticatorExtensionResults: extensionsData,
+ },
+ };
+}
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-key.d.ts b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-key.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d9db114c26e8f86db66c7daf0fc86ba37cfe43fc
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-key.d.ts
@@ -0,0 +1,49 @@
+/**
+ * Google Hardware Attestation Root 1
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (first entry)
+ *
+ * Valid until 2026-05-24 @ 09:28 PST
+ *
+ * SHA256 Fingerprint
+ * C1:98:4A:3E:F4:5C:1E:2A:91:85:51:DE:10:60:3C:86:F7:05:1B:22:49:C4:89:1C:AE:32:30:EA:BD:0C:97:D5
+ */
+export declare const Google_Hardware_Attestation_Root_1 = "-----BEGIN CERTIFICATE-----\nMIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyWhcNMjYwNTI0MTYy\nODUyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7\ntv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj\nnar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq\nC4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ\noVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O\nJtvsBslHZvPB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2Uws6DF+60PV7/WIPjNvXySdqspImSN78mflxD\nqwLqRBYkA3I75qppLGG9rp7UCdRjxMl8ZDBld+7yvHVgt1cVzJx9xnyGCC23Uaic\nMDSXYrB4I4WHXPGjxhZuCuPBLTdOLU8YRvMYdEvYebWHMpvwGCF6bAx3JBpIeOQ1\nwDB5y0USicV3YgYGmi+NZfhA4URSh77Yd6uuJOJENRaNVTzk\n-----END CERTIFICATE-----\n";
+/**
+ * Google Hardware Attestation Root 2
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (second entry)
+ *
+ * Valid until 2034-11-18 @ 12:37 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+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+RhhsbDmxMgJJ0m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qcABPdgL+H7qJguBw09o\njm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB\nZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH\nex0SdDrx+tWUDqG8At2JHA==\n-----END CERTIFICATE-----\n";
+/**
+ * Google Hardware Attestation Root 3
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (third entry)
+ *
+ * Valid until 2036-11-13 @ 15:10 PST
+ *
+ * SHA256 Fingerprint
+ * AB:66:41:17:8A:36:E1:79:AA:0C:1C:DD:DF:9A:16:EB:45:FA:20:94:3E:2B:8C:D7:C7:C0:5C:26:CF:8B:48:7A
+ */
+export declare const Google_Hardware_Attestation_Root_3 = "\n-----BEGIN CERTIFICATE-----\nMIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx\nMDQyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7\ntv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj\nnar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq\nC4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ\noVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O\nJtvsBslHZvPBK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9xsnODJ+g8eF452zvbiKKngEKirK5LGieoXBX7tZ9D1GNBH2\nOb3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7\nmD/vFDkzF+wm7cyWpQpCVQ==\n-----END CERTIFICATE-----\n";
+/**
+ * Google Hardware Attestation Root 4
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (fourth entry)
+ *
+ * Valid until 2042-03-15 @ 11:07 PDT
+ *
+ * SHA256 Fingerprint
+ * CE:DB:1C:B6:DC:89:6A:E5:EC:79:73:48:BC:E9:28:67:53:C2:B3:8E:E7:1C:E0:FB:E3:4A:9A:12:48:80:0D:FC
+ */
+export declare const Google_Hardware_Attestation_Root_4 = "\n-----BEGIN CERTIFICATE-----\nMIIFHDCCAwSgAwIBAgIJAPHBcqaZ6vUdMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjIwMzIwMTgwNzQ4WhcNNDIwMzE1MTgw\nNzQ4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7\ntv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj\nnar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq\nC4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ\noVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O\nJtvsBslHZvPBKCOdT0MS+tgSOIfga+z1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pqnnHo\nvaI47gC+TNpkgYGkkBT6B/m/U01BuOBBTzhIlMEZq9qkDWuM2cA5kW5V3FJUcfHn\nw1IdYIg2Wxg7yHcQZemFQg==\n-----END CERTIFICATE-----\n";
+//# sourceMappingURL=android-key.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-key.d.ts.map b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-key.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..a4a69d156c77c3bff2387aa39e9b4b7151991f84
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-key.d.ts.map
@@ -0,0 +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;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,+0DA+B9C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,+0DA+B9C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-key.js b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-key.js
new file mode 100644
index 0000000000000000000000000000000000000000..42f63ff3db7a55590c43fcdceee9771683e82403
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-key.js
@@ -0,0 +1,174 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Google_Hardware_Attestation_Root_4 = exports.Google_Hardware_Attestation_Root_3 = exports.Google_Hardware_Attestation_Root_2 = exports.Google_Hardware_Attestation_Root_1 = void 0;
+/**
+ * Google Hardware Attestation Root 1
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (first entry)
+ *
+ * Valid until 2026-05-24 @ 09:28 PST
+ *
+ * SHA256 Fingerprint
+ * C1:98:4A:3E:F4:5C:1E:2A:91:85:51:DE:10:60:3C:86:F7:05:1B:22:49:C4:89:1C:AE:32:30:EA:BD:0C:97:D5
+ */
+exports.Google_Hardware_Attestation_Root_1 = `-----BEGIN CERTIFICATE-----
+MIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
+BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyWhcNMjYwNTI0MTYy
+ODUyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
+AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
+Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
+tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
+nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
+C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
+oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
+JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
+sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
+igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
+RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
+aDK8Z4RHJ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attestation Root 2
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (second entry)
+ *
+ * Valid until 2034-11-18 @ 12:37 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+exports.Google_Hardware_Attestation_Root_2 = `-----BEGIN CERTIFICATE-----
+MIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
+BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz
+NzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
+AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
+Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
+tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
+nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
+C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
+oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
+JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
+sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
+igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
+RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
+aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
+AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud
+IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD
+VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBOMaBc8oumXb2voc7XCWnu
+XKhBBK3e2KMGz39t7lA3XXRe2ZLLAkLM5y3J7tURkf5a1SutfdOyXAmeE6SRo83U
+h6WszodmMkxK5GM4JGrnt4pBisu5igXEydaW7qq2CdC6DOGjG+mEkN8/TA6p3cno
+L/sPyz6evdjLlSeJ8rFBH6xWyIZCbrcpYEJzXaUOEaxxXxgYz5/cTiVKN2M1G2ok
+QBUIYSY6bjEL4aUN5cfo7ogP3UvliEo3Eo0YgwuzR2v0KR6C1cZqZJSTnghIC/vA
+D32KdNQ+c3N+vl2OTsUVMC1GiWkngNx1OO1+kXW+YTnnTUOtOIswUP/Vqd5SYgAI
+mMAfY8U9/iIgkQj6T2W6FsScy94IN9fFhE1UtzmLoBIuUFsVXJMTz+Jucth+IqoW
+Fua9v1R93/k98p41pjtFX+H8DslVgfP097vju4KDlqN64xV1grw3ZLl4CiOe/A91
+oeLm2UHOq6wn3esB4r2EIQKb6jTVGu5sYCcdWpXr0AUVqcABPdgL+H7qJguBw09o
+jm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB
+ZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH
+ex0SdDrx+tWUDqG8At2JHA==
+-----END CERTIFICATE-----
+`;
+/**
+ * Google Hardware Attestation Root 3
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (third entry)
+ *
+ * Valid until 2036-11-13 @ 15:10 PST
+ *
+ * SHA256 Fingerprint
+ * AB:66:41:17:8A:36:E1:79:AA:0C:1C:DD:DF:9A:16:EB:45:FA:20:94:3E:2B:8C:D7:C7:C0:5C:26:CF:8B:48:7A
+ */
+exports.Google_Hardware_Attestation_Root_3 = `
+-----BEGIN CERTIFICATE-----
+MIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
+BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx
+MDQyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
+AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
+Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
+tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
+nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
+C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
+oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
+JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
+sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
+igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
+RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
+aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
+AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud
+IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD
+VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBTNNZe5cuf8oiq+jV0itTG
+zWVhSTjOBEk2FQvh11J3o3lna0o7rd8RFHnN00q4hi6TapFhh4qaw/iG6Xg+xOan
+63niLWIC5GOPFgPeYXM9+nBb3zZzC8ABypYuCusWCmt6Tn3+Pjbz3MTVhRGXuT/T
+QH4KGFY4PhvzAyXwdjTOCXID+aHud4RLcSySr0Fq/L+R8TWalvM1wJJPhyRjqRCJ
+erGtfBagiALzvhnmY7U1qFcS0NCnKjoO7oFedKdWlZz0YAfu3aGCJd4KHT0MsGiL
+Zez9WP81xYSrKMNEsDK+zK5fVzw6jA7cxmpXcARTnmAuGUeI7VVDhDzKeVOctf3a
+0qQLwC+d0+xrETZ4r2fRGNw2YEs2W8Qj6oDcfPvq9JySe7pJ6wcHnl5EZ0lwc4xH
+7Y4Dx9RA1JlfooLMw3tOdJZH0enxPXaydfAD3YifeZpFaUzicHeLzVJLt9dvGB0b
+HQLE4+EqKFgOZv2EoP686DQqbVS1u+9k0p2xbMA105TBIk7npraa8VM0fnrRKi7w
+lZKwdH+aNAyhbXRW9xsnODJ+g8eF452zvbiKKngEKirK5LGieoXBX7tZ9D1GNBH2
+Ob3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7
+mD/vFDkzF+wm7cyWpQpCVQ==
+-----END CERTIFICATE-----
+`;
+/**
+ * Google Hardware Attestation Root 4
+ *
+ * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
+ * (fourth entry)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YYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
+AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud
+IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD
+VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQB8cMqTllHc8U+qCrOlg3H7
+174lmaCsbo/bJ0C17JEgMLb4kvrqsXZs01U3mB/qABg/1t5Pd5AORHARs1hhqGIC
+W/nKMav574f9rZN4PC2ZlufGXb7sIdJpGiO9ctRhiLuYuly10JccUZGEHpHSYM2G
+tkgYbZba6lsCPYAAP83cyDV+1aOkTf1RCp/lM0PKvmxYN10RYsK631jrleGdcdkx
+oSK//mSQbgcWnmAEZrzHoF1/0gso1HZgIn0YLzVhLSA/iXCX4QT2h3J5z3znluKG
+1nv8NQdxei2DIIhASWfu804CA96cQKTTlaae2fweqXjdN1/v2nqOhngNyz1361mF
+mr4XmaKH/ItTwOe72NI9ZcwS1lVaCvsIkTDCEXdm9rCNPAY10iTunIHFXRh+7KPz
+lHGewCq/8TOohBRn0/NNfh7uRslOSZ/xKbN9tMBtw37Z8d2vvnXq/YWdsm1+JLVw
+n6yYD/yacNJBlwpddla8eaVMjsF6nBnIgQOf9zKSe06nSTqvgwUHosgOECZJZ1Eu
+zbH4yswbt02tKtKEFhx+v+OTge/06V+jGsqTWLsfrOCNLuA8H++z+pUENmpqnnHo
+vaI47gC+TNpkgYGkkBT6B/m/U01BuOBBTzhIlMEZq9qkDWuM2cA5kW5V3FJUcfHn
+w1IdYIg2Wxg7yHcQZemFQg==
+-----END CERTIFICATE-----
+`;
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-safetynet.d.ts b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-safetynet.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..31d655d6569f9ecebda6ddf832249403d202c29b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-safetynet.d.ts
@@ -0,0 +1,12 @@
+/**
+ * GlobalSign Root CA
+ *
+ * Downloaded from https://pki.goog/roots.pem
+ *
+ * Valid until 2028-01-28 @ 04:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+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";
+//# sourceMappingURL=android-safetynet.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-safetynet.d.ts.map b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-safetynet.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..ec9a1f1ad823af2b53d6443e4a9358e4d3067b74
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-safetynet.d.ts.map
@@ -0,0 +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"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-safetynet.js b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-safetynet.js
new file mode 100644
index 0000000000000000000000000000000000000000..70136d86340f5902af8526e8111ca486c39ff865
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-safetynet.js
@@ -0,0 +1,35 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.GlobalSign_Root_CA = void 0;
+/**
+ * GlobalSign Root CA
+ *
+ * Downloaded from https://pki.goog/roots.pem
+ *
+ * Valid until 2028-01-28 @ 04:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+exports.GlobalSign_Root_CA = `-----BEGIN CERTIFICATE-----
+MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
+A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
+b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
+MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
+YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
+aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
+jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
+xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
+1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
+snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
+U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
+9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
+BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
+AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
+yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
+38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
+AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
+DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
+HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
+-----END CERTIFICATE-----
+`;
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/apple.d.ts b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/apple.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2af589db3ea3ca8ffafb71453be41b733ab41a71
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/apple.d.ts
@@ -0,0 +1,12 @@
+/**
+ * Apple WebAuthn Root CA
+ *
+ * Downloaded from https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem
+ *
+ * Valid until 2045-03-14 @ 17:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+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";
+//# sourceMappingURL=apple.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/apple.d.ts.map b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/apple.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..70a1279a4a3d465115f5349db833a4fa798fe687
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/apple.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"apple.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/apple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,6xBAclC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/apple.js b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/apple.js
new file mode 100644
index 0000000000000000000000000000000000000000..c01b5644dc1bd3c48c2ea40fc4f4d1f68f208d96
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/apple.js
@@ -0,0 +1,28 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Apple_WebAuthn_Root_CA = void 0;
+/**
+ * Apple WebAuthn Root CA
+ *
+ * Downloaded from https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem
+ *
+ * Valid until 2045-03-14 @ 17:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+exports.Apple_WebAuthn_Root_CA = `-----BEGIN CERTIFICATE-----
+MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w
+HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ
+bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx
+NTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG
+A1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49
+AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k
+xu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/
+pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk
+2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA
+MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3
+jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B
+1bWeT0vT
+-----END CERTIFICATE-----
+`;
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/mds.d.ts b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/mds.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0eee0cb36941174faf8161e12e8bf94fe5c0016b
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/mds.d.ts
@@ -0,0 +1,12 @@
+/**
+ * GlobalSign Root CA - R3
+ *
+ * Downloaded from https://valid.r3.roots.globalsign.com/
+ *
+ * Valid until 2029-03-18 @ 00:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+export declare const GlobalSign_Root_CA_R3 = "-----BEGIN CERTIFICATE-----\nMIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G\nA1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp\nZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4\nMTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG\nA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8\nRgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT\ngHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm\nKPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd\nQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ\nXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw\nDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o\nLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU\nRUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp\njjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK\n6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX\nmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs\nMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH\nWD9f\n-----END CERTIFICATE-----\n ";
+//# sourceMappingURL=mds.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/mds.d.ts.map b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/mds.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..51da1f440eca87d070b7a089883fa3de36c1a96f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/mds.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mds.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/mds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,wuCAqBhC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/mds.js b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/mds.js
new file mode 100644
index 0000000000000000000000000000000000000000..753a11e9106da37518b4d868ed0ceee3fa847521
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/mds.js
@@ -0,0 +1,35 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.GlobalSign_Root_CA_R3 = void 0;
+/**
+ * GlobalSign Root CA - R3
+ *
+ * Downloaded from https://valid.r3.roots.globalsign.com/
+ *
+ * Valid until 2029-03-18 @ 00:00 PST
+ *
+ * SHA256 Fingerprint
+ * 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
+ */
+exports.GlobalSign_Root_CA_R3 = `-----BEGIN CERTIFICATE-----
+MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
+A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
+Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
+MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
+A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
+RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
+gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
+KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
+QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
+XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
+DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
+LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
+RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
+jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
+6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
+mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
+Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
+WD9f
+-----END CERTIFICATE-----
+ `;
diff --git a/node_modules/@simplewebauthn/server/script/services/metadataService.d.ts b/node_modules/@simplewebauthn/server/script/services/metadataService.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8a330689fd65ca2dbe759d50a8cb69baac8e5fd5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/metadataService.d.ts
@@ -0,0 +1,78 @@
+import type { MetadataStatement } from '../metadata/mdsTypes.js';
+import type { Uint8Array_ } from '../types/index.js';
+/**
+ * Allow MetadataService to accommodate unregistered AAGUIDs (`"permissive"`), or only allow
+ * registered AAGUIDs (`"strict"`). Currently primarily impacts how `getStatement()` operates
+ */
+export type VerificationMode = 'permissive' | 'strict';
+interface MetadataService {
+ /**
+ * Prepare the service to handle remote MDS servers and/or cache local metadata statements.
+ *
+ * **Options:**
+ *
+ * @param opts.mdsServers An array of URLs to FIDO Alliance Metadata Service
+ * (version 3.0)-compatible servers. Defaults to the official FIDO MDS server
+ * @param opts.statements An array of local metadata statements. Statements will be loaded but
+ * not refreshed
+ * @param opts.verificationMode How MetadataService will handle unregistered AAGUIDs. Defaults to
+ * `"strict"` which throws errors during registration response verification when an
+ * unregistered AAGUID is encountered. Set to `"permissive"` to allow registration by
+ * authenticators with unregistered AAGUIDs
+ */
+ initialize(opts?: {
+ mdsServers?: string[];
+ statements?: MetadataStatement[];
+ verificationMode?: VerificationMode;
+ }): Promise;
+ /**
+ * Get a metadata statement for a given AAGUID.
+ *
+ * This method will coordinate updating the cache as per the `nextUpdate` property in the initial
+ * BLOB download.
+ */
+ getStatement(aaguid: string | Uint8Array): Promise;
+}
+/**
+ * An implementation of `MetadataService` that can download and parse BLOBs, and support on-demand
+ * requesting and caching of individual metadata statements.
+ *
+ * https://fidoalliance.org/metadata/
+ */
+export declare class BaseMetadataService implements MetadataService {
+ private mdsCache;
+ private statementCache;
+ private state;
+ private verificationMode;
+ initialize(opts?: {
+ mdsServers?: string[];
+ statements?: MetadataStatement[];
+ verificationMode?: VerificationMode;
+ }): Promise;
+ getStatement(aaguid: string | Uint8Array_): Promise;
+ /**
+ * Download and process the latest BLOB from MDS
+ */
+ private downloadBlob;
+ /**
+ * Verify and process the MDS metadata blob
+ */
+ private verifyBlob;
+ /**
+ * A helper method to pause execution until the service is ready
+ */
+ private pauseUntilReady;
+ /**
+ * Report service status on change
+ */
+ private setState;
+}
+/**
+ * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
+ * download and parsing, and on-demand requesting and caching of individual metadata statements.
+ *
+ * https://fidoalliance.org/metadata/
+ */
+export declare const MetadataService: MetadataService;
+export {};
+//# sourceMappingURL=metadataService.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/metadataService.d.ts.map b/node_modules/@simplewebauthn/server/script/services/metadataService.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..d2b8add1386e7edf59d6adf51172311486784798
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/metadataService.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"metadataService.d.ts","sourceRoot":"","sources":["../../src/services/metadataService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA4B,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAI3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAmCrD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAIvD,UAAU,eAAe;IACvB;;;;;;;;;;;;;OAaG;IACH,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;;;;;OAKG;IACH,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;IAEhD,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;IA4EV,YAAY,CAChB,MAAM,EAAE,MAAM,GAAG,WAAW,GAC3B,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IA8DzC;;OAEG;YACW,YAAY;IAU1B;;OAEG;YACW,UAAU;IA8CxB;;OAEG;IACH,OAAO,CAAC,eAAe;IAgCvB;;OAEG;IACH,OAAO,CAAC,QAAQ;CAWjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,eAA2C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/metadataService.js b/node_modules/@simplewebauthn/server/script/services/metadataService.js
new file mode 100644
index 0000000000000000000000000000000000000000..26d3e4bdf175be9374a7b4b91af1a36a48188545
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/metadataService.js
@@ -0,0 +1,272 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.MetadataService = exports.BaseMetadataService = void 0;
+const convertAAGUIDToString_js_1 = require("../helpers/convertAAGUIDToString.js");
+const verifyMDSBlob_js_1 = require("../metadata/verifyMDSBlob.js");
+const logging_js_1 = require("../helpers/logging.js");
+const fetch_js_1 = require("../helpers/fetch.js");
+/**
+ * An instance of `CachedMDS` that will not trigger attempts to refresh the associated entry's blob
+ */
+const NonRefreshingMDS = {
+ url: '',
+ no: 0,
+ nextUpdate: new Date(0),
+};
+const defaultURLMDS = 'https://mds.fidoalliance.org/'; // v3
+var SERVICE_STATE;
+(function (SERVICE_STATE) {
+ SERVICE_STATE[SERVICE_STATE["DISABLED"] = 0] = "DISABLED";
+ SERVICE_STATE[SERVICE_STATE["REFRESHING"] = 1] = "REFRESHING";
+ SERVICE_STATE[SERVICE_STATE["READY"] = 2] = "READY";
+})(SERVICE_STATE || (SERVICE_STATE = {}));
+const log = (0, logging_js_1.getLogger)('MetadataService');
+/**
+ * An implementation of `MetadataService` that can download and parse BLOBs, and support on-demand
+ * requesting and caching of individual metadata statements.
+ *
+ * https://fidoalliance.org/metadata/
+ */
+class BaseMetadataService {
+ constructor() {
+ Object.defineProperty(this, "mdsCache", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: {}
+ });
+ Object.defineProperty(this, "statementCache", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: {}
+ });
+ Object.defineProperty(this, "state", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: SERVICE_STATE.DISABLED
+ });
+ Object.defineProperty(this, "verificationMode", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: 'strict'
+ });
+ }
+ async initialize(opts = {}) {
+ // Reset statement cache
+ this.statementCache = {};
+ const { mdsServers = [defaultURLMDS], statements, verificationMode } = opts;
+ this.setState(SERVICE_STATE.REFRESHING);
+ /**
+ * If metadata statements are provided, load them into the cache first. These statements will
+ * not be refreshed when a stale one is detected.
+ */
+ if (statements?.length) {
+ let statementsAdded = 0;
+ statements.forEach((statement) => {
+ // Only cache statements that are for FIDO2-compatible authenticators
+ if (statement.aaguid) {
+ this.statementCache[statement.aaguid] = {
+ entry: {
+ metadataStatement: statement,
+ statusReports: [],
+ timeOfLastStatusChange: '1970-01-01',
+ },
+ url: NonRefreshingMDS.url,
+ };
+ statementsAdded += 1;
+ }
+ });
+ log(`Cached ${statementsAdded} local statements`);
+ }
+ /**
+ * If MDS servers are provided, then download blobs from them, verify them, and then add their
+ * entries to the cache. Blobs loaded in this way will be refreshed when a stale entry within is
+ * detected.
+ */
+ if (mdsServers?.length) {
+ // Get a current count so we know how many new statements we've added from MDS servers
+ const currentCacheCount = Object.keys(this.statementCache).length;
+ let numServers = mdsServers.length;
+ for (const url of mdsServers) {
+ try {
+ const cachedMDS = {
+ url,
+ no: 0,
+ nextUpdate: new Date(0),
+ };
+ const blob = await this.downloadBlob(cachedMDS);
+ await this.verifyBlob(blob, cachedMDS);
+ }
+ catch (err) {
+ // Notify of the error and move on
+ log(`Could not download BLOB from ${url}:`, err);
+ numServers -= 1;
+ }
+ }
+ // Calculate the difference to get the total number of new statements we successfully added
+ const newCacheCount = Object.keys(this.statementCache).length;
+ const cacheDiff = newCacheCount - currentCacheCount;
+ log(`Cached ${cacheDiff} statements from ${numServers} metadata server(s)`);
+ }
+ if (verificationMode) {
+ this.verificationMode = verificationMode;
+ }
+ this.setState(SERVICE_STATE.READY);
+ }
+ async getStatement(aaguid) {
+ if (this.state === SERVICE_STATE.DISABLED) {
+ return;
+ }
+ if (!aaguid) {
+ return;
+ }
+ if (aaguid instanceof Uint8Array) {
+ aaguid = (0, convertAAGUIDToString_js_1.convertAAGUIDToString)(aaguid);
+ }
+ // If a cache refresh is in progress then pause this until the service is ready
+ await this.pauseUntilReady();
+ // Try to grab a cached statement
+ const cachedStatement = this.statementCache[aaguid];
+ if (!cachedStatement) {
+ if (this.verificationMode === 'strict') {
+ // FIDO conformance requires RP's to only support registered AAGUID's
+ throw new Error(`No metadata statement found for aaguid "${aaguid}"`);
+ }
+ // Allow registration verification to continue without using metadata
+ return;
+ }
+ // If the statement points to an MDS API, check the MDS' nextUpdate to see if we need to refresh
+ if (cachedStatement.url) {
+ const mds = this.mdsCache[cachedStatement.url];
+ const now = new Date();
+ if (now > mds.nextUpdate) {
+ try {
+ this.setState(SERVICE_STATE.REFRESHING);
+ const blob = await this.downloadBlob(mds);
+ await this.verifyBlob(blob, mds);
+ }
+ finally {
+ this.setState(SERVICE_STATE.READY);
+ }
+ }
+ }
+ const { entry } = cachedStatement;
+ // Check to see if the this aaguid has a status report with a "compromised" status
+ for (const report of entry.statusReports) {
+ const { status } = report;
+ if (status === 'USER_VERIFICATION_BYPASS' ||
+ status === 'ATTESTATION_KEY_COMPROMISE' ||
+ status === 'USER_KEY_REMOTE_COMPROMISE' ||
+ status === 'USER_KEY_PHYSICAL_COMPROMISE') {
+ throw new Error(`Detected compromised aaguid "${aaguid}"`);
+ }
+ }
+ return entry.metadataStatement;
+ }
+ /**
+ * Download and process the latest BLOB from MDS
+ */
+ async downloadBlob(cachedMDS) {
+ const { url } = cachedMDS;
+ // Get latest "BLOB" (FIDO's terminology, not mine)
+ const resp = await (0, fetch_js_1.fetch)(url);
+ const data = await resp.text();
+ return data;
+ }
+ /**
+ * Verify and process the MDS metadata blob
+ */
+ async verifyBlob(blob, cachedMDS) {
+ const { url, no } = cachedMDS;
+ const { payload, parsedNextUpdate } = await (0, verifyMDSBlob_js_1.verifyMDSBlob)(blob);
+ if (payload.no <= no) {
+ // From FIDO MDS docs: "also ignore the file if its number (no) is less or equal to the
+ // number of the last BLOB cached locally."
+ throw new Error(`Latest BLOB no. ${payload.no} is not greater than previous no. ${no}`);
+ }
+ // Cache statements for FIDO2 devices
+ for (const entry of payload.entries) {
+ // Only cache entries with an `aaguid`
+ if (entry.aaguid) {
+ this.statementCache[entry.aaguid] = { entry, url };
+ }
+ }
+ if (url) {
+ // Remember info about the server so we can refresh later
+ this.mdsCache[url] = {
+ ...cachedMDS,
+ // Store the payload `no` to make sure we're getting the next BLOB in the sequence
+ no: payload.no,
+ // Remember when we need to refresh this blob
+ nextUpdate: parsedNextUpdate,
+ };
+ }
+ else {
+ /**
+ * This blob will not be refreshed, but we should still alert if the blob's `nextUpdate` is
+ * in the past
+ */
+ if (parsedNextUpdate < new Date()) {
+ // TODO (Feb 2026): It'd be more actionable for devs if a specific error was raised here,
+ // then this message was logged higher up when it can include the array index of the stale
+ // blob.
+ log(`⚠️ This MDS blob (serial: ${payload.no}) contains stale data as of ${parsedNextUpdate.toISOString()}. Please consider re-initializing MetadataService with a newer MDS blob.`);
+ }
+ }
+ }
+ /**
+ * A helper method to pause execution until the service is ready
+ */
+ pauseUntilReady() {
+ if (this.state === SERVICE_STATE.READY) {
+ return new Promise((resolve) => {
+ resolve();
+ });
+ }
+ // State isn't ready, so set up polling
+ const readyPromise = new Promise((resolve, reject) => {
+ const totalTimeoutMS = 70000;
+ const intervalMS = 100;
+ let iterations = totalTimeoutMS / intervalMS;
+ // Check service state every `intervalMS` milliseconds
+ const intervalID = globalThis.setInterval(() => {
+ if (iterations < 1) {
+ clearInterval(intervalID);
+ reject(`State did not become ready in ${totalTimeoutMS / 1000} seconds`);
+ }
+ else if (this.state === SERVICE_STATE.READY) {
+ clearInterval(intervalID);
+ resolve();
+ }
+ iterations -= 1;
+ }, intervalMS);
+ });
+ return readyPromise;
+ }
+ /**
+ * Report service status on change
+ */
+ setState(newState) {
+ this.state = newState;
+ if (newState === SERVICE_STATE.DISABLED) {
+ log('MetadataService is DISABLED');
+ }
+ else if (newState === SERVICE_STATE.REFRESHING) {
+ log('MetadataService is REFRESHING');
+ }
+ else if (newState === SERVICE_STATE.READY) {
+ log('MetadataService is READY');
+ }
+ }
+}
+exports.BaseMetadataService = BaseMetadataService;
+/**
+ * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
+ * download and parsing, and on-demand requesting and caching of individual metadata statements.
+ *
+ * https://fidoalliance.org/metadata/
+ */
+exports.MetadataService = new BaseMetadataService();
diff --git a/node_modules/@simplewebauthn/server/script/services/settingsService.d.ts b/node_modules/@simplewebauthn/server/script/services/settingsService.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..611592b042efff086d80bc565097253fb91b37c6
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/settingsService.d.ts
@@ -0,0 +1,39 @@
+import type { AttestationFormat } from '../helpers/decodeAttestationObject.js';
+import type { Uint8Array_ } from '../types/index.js';
+export type RootCertIdentifier = AttestationFormat | 'mds';
+interface SettingsService {
+ /**
+ * Set potential root certificates for attestation formats that use them. Root certs will be tried
+ * one-by-one when validating a certificate path.
+ *
+ * Certificates can be specified as a raw `Buffer`, or as a PEM-formatted string. If a
+ * `Buffer` is passed in it will be converted to PEM format.
+ */
+ setRootCertificates(opts: {
+ identifier: RootCertIdentifier;
+ certificates: (Uint8Array_ | string)[];
+ }): void;
+ /**
+ * Get any registered root certificates for the specified attestation format
+ */
+ getRootCertificates(opts: {
+ identifier: RootCertIdentifier;
+ }): string[];
+}
+/**
+ * A basic service for specifying acceptable root certificates for all supported attestation
+ * statement formats.
+ *
+ * In addition, default root certificates are included for the following statement formats:
+ *
+ * - `'android-key'`
+ * - `'android-safetynet'`
+ * - `'apple'`
+ * - `'android-mds'`
+ *
+ * These can be overwritten as needed by setting alternative root certificates for their format
+ * identifier using `setRootCertificates()`.
+ */
+export declare const SettingsService: SettingsService;
+export {};
+//# sourceMappingURL=settingsService.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/settingsService.d.ts.map b/node_modules/@simplewebauthn/server/script/services/settingsService.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..432da95f601084ced18fba89858d21382fbe3ace
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/settingsService.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"settingsService.d.ts","sourceRoot":"","sources":["../../src/services/settingsService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYrD,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG,KAAK,CAAC;AAE3D,UAAU,eAAe;IACvB;;;;;;OAMG;IACH,mBAAmB,CAAC,IAAI,EAAE;QACxB,UAAU,EAAE,kBAAkB,CAAC;QAC/B,YAAY,EAAE,CAAC,WAAW,GAAG,MAAM,CAAC,EAAE,CAAC;KACxC,GAAG,IAAI,CAAC;IAET;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,kBAAkB,CAAA;KAAE,GAAG,MAAM,EAAE,CAAC;CACzE;AAkCD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,eAA2C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/services/settingsService.js b/node_modules/@simplewebauthn/server/script/services/settingsService.js
new file mode 100644
index 0000000000000000000000000000000000000000..b64fc2b7e70cf5799544d2d7da4806ac438858e5
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/services/settingsService.js
@@ -0,0 +1,74 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SettingsService = void 0;
+const convertCertBufferToPEM_js_1 = require("../helpers/convertCertBufferToPEM.js");
+const android_safetynet_js_1 = require("./defaultRootCerts/android-safetynet.js");
+const android_key_js_1 = require("./defaultRootCerts/android-key.js");
+const apple_js_1 = require("./defaultRootCerts/apple.js");
+const mds_js_1 = require("./defaultRootCerts/mds.js");
+class BaseSettingsService {
+ constructor() {
+ // Certificates are stored as PEM-formatted strings
+ Object.defineProperty(this, "pemCertificates", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ this.pemCertificates = new Map();
+ }
+ setRootCertificates(opts) {
+ const { identifier, certificates } = opts;
+ const newCertificates = [];
+ for (const cert of certificates) {
+ if (cert instanceof Uint8Array) {
+ newCertificates.push((0, convertCertBufferToPEM_js_1.convertCertBufferToPEM)(cert));
+ }
+ else {
+ newCertificates.push(cert);
+ }
+ }
+ this.pemCertificates.set(identifier, newCertificates);
+ }
+ getRootCertificates(opts) {
+ const { identifier } = opts;
+ return this.pemCertificates.get(identifier) ?? [];
+ }
+}
+/**
+ * A basic service for specifying acceptable root certificates for all supported attestation
+ * statement formats.
+ *
+ * In addition, default root certificates are included for the following statement formats:
+ *
+ * - `'android-key'`
+ * - `'android-safetynet'`
+ * - `'apple'`
+ * - `'android-mds'`
+ *
+ * These can be overwritten as needed by setting alternative root certificates for their format
+ * identifier using `setRootCertificates()`.
+ */
+exports.SettingsService = new BaseSettingsService();
+// Initialize default certificates
+exports.SettingsService.setRootCertificates({
+ identifier: 'android-key',
+ certificates: [
+ android_key_js_1.Google_Hardware_Attestation_Root_1,
+ android_key_js_1.Google_Hardware_Attestation_Root_2,
+ android_key_js_1.Google_Hardware_Attestation_Root_3,
+ android_key_js_1.Google_Hardware_Attestation_Root_4,
+ ],
+});
+exports.SettingsService.setRootCertificates({
+ identifier: 'android-safetynet',
+ certificates: [android_safetynet_js_1.GlobalSign_Root_CA],
+});
+exports.SettingsService.setRootCertificates({
+ identifier: 'apple',
+ certificates: [apple_js_1.Apple_WebAuthn_Root_CA],
+});
+exports.SettingsService.setRootCertificates({
+ identifier: 'mds',
+ certificates: [mds_js_1.GlobalSign_Root_CA_R3],
+});
diff --git a/node_modules/@simplewebauthn/server/script/types/dom.d.ts b/node_modules/@simplewebauthn/server/script/types/dom.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..29caf7fd9cb3e6a49f63845cb76c7a963244ecf7
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/types/dom.d.ts
@@ -0,0 +1,329 @@
+/**
+ * DO NOT MODIFY THESE FILES!
+ *
+ * These files were copied from the **types** package. To update this file, make changes to those
+ * files instead and then run the following command from the monorepo root folder:
+ *
+ * deno task codegen:types
+ */
+/**
+ * Generated from typescript@5.6.3
+ * To regenerate, run the following command from the package root:
+ * deno task extract-dom-types
+ */
+/**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse)
+ */
+export interface AuthenticatorAssertionResponse extends AuthenticatorResponse {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData) */
+ readonly authenticatorData: ArrayBuffer;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/signature) */
+ readonly signature: ArrayBuffer;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/userHandle) */
+ readonly userHandle: ArrayBuffer | null;
+}
+/**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse)
+ */
+export interface AuthenticatorAttestationResponse extends AuthenticatorResponse {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/attestationObject) */
+ readonly attestationObject: ArrayBuffer;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getAuthenticatorData) */
+ getAuthenticatorData(): ArrayBuffer;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey) */
+ getPublicKey(): ArrayBuffer | null;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKeyAlgorithm) */
+ getPublicKeyAlgorithm(): COSEAlgorithmIdentifier;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getTransports) */
+ getTransports(): string[];
+}
+export interface AuthenticationExtensionsClientInputs {
+ appid?: string;
+ credProps?: boolean;
+ hmacCreateSecret?: boolean;
+ minPinLength?: boolean;
+}
+export interface AuthenticationExtensionsClientOutputs {
+ appid?: boolean;
+ credProps?: CredentialPropertiesOutput;
+ hmacCreateSecret?: boolean;
+}
+export interface AuthenticatorSelectionCriteria {
+ authenticatorAttachment?: AuthenticatorAttachment;
+ requireResidentKey?: boolean;
+ residentKey?: ResidentKeyRequirement;
+ userVerification?: UserVerificationRequirement;
+}
+/**
+ * Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto)
+ */
+export interface Crypto {
+ /**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
+ */
+ readonly subtle: SubtleCrypto;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
+ getRandomValues(array: T): T;
+ /**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
+ */
+ randomUUID(): `${string}-${string}-${string}-${string}-${string}`;
+}
+/**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential)
+ */
+export interface PublicKeyCredential extends Credential {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/authenticatorAttachment) */
+ readonly authenticatorAttachment: string | null;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/rawId) */
+ readonly rawId: ArrayBuffer;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/response) */
+ readonly response: AuthenticatorResponse;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/getClientExtensionResults) */
+ getClientExtensionResults(): AuthenticationExtensionsClientOutputs;
+}
+export interface PublicKeyCredentialCreationOptions {
+ attestation?: AttestationConveyancePreference;
+ authenticatorSelection?: AuthenticatorSelectionCriteria;
+ challenge: BufferSource;
+ excludeCredentials?: PublicKeyCredentialDescriptor[];
+ extensions?: AuthenticationExtensionsClientInputs;
+ pubKeyCredParams: PublicKeyCredentialParameters[];
+ rp: PublicKeyCredentialRpEntity;
+ timeout?: number;
+ user: PublicKeyCredentialUserEntity;
+}
+export interface PublicKeyCredentialDescriptor {
+ id: BufferSource;
+ transports?: AuthenticatorTransport[];
+ type: PublicKeyCredentialType;
+}
+export interface PublicKeyCredentialParameters {
+ alg: COSEAlgorithmIdentifier;
+ type: PublicKeyCredentialType;
+}
+export interface PublicKeyCredentialRequestOptions {
+ allowCredentials?: PublicKeyCredentialDescriptor[];
+ challenge: BufferSource;
+ extensions?: AuthenticationExtensionsClientInputs;
+ rpId?: string;
+ timeout?: number;
+ userVerification?: UserVerificationRequirement;
+}
+export interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity {
+ displayName: string;
+ id: BufferSource;
+}
+/**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse)
+ */
+export interface AuthenticatorResponse {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse/clientDataJSON) */
+ readonly clientDataJSON: ArrayBuffer;
+}
+export interface CredentialPropertiesOutput {
+ rk?: boolean;
+}
+/**
+ * This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
+ */
+export interface SubtleCrypto {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
+ decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
+ deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
+ deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
+ digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
+ encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
+ exportKey(format: "jwk", key: CryptoKey): Promise;
+ exportKey(format: Exclude, key: CryptoKey): Promise;
+ exportKey(format: KeyFormat, key: CryptoKey): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
+ generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise;
+ generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray): Promise;
+ generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray): Promise;
+ generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
+ importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray): Promise;
+ importKey(format: Exclude, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
+ sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, data: BufferSource): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
+ unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
+ verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
+ wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise;
+}
+/**
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential)
+ */
+export interface Credential {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/id) */
+ readonly id: string;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/type) */
+ readonly type: string;
+}
+export interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity {
+ id?: string;
+}
+export interface PublicKeyCredentialEntity {
+ name: string;
+}
+export interface RsaOaepParams extends Algorithm {
+ label?: BufferSource;
+}
+export interface AesCtrParams extends Algorithm {
+ counter: BufferSource;
+ length: number;
+}
+export interface AesCbcParams extends Algorithm {
+ iv: BufferSource;
+}
+export interface AesGcmParams extends Algorithm {
+ additionalData?: BufferSource;
+ iv: BufferSource;
+ tagLength?: number;
+}
+/**
+ * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
+ */
+export interface CryptoKey {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
+ readonly algorithm: KeyAlgorithm;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
+ readonly extractable: boolean;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
+ readonly type: KeyType;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
+ readonly usages: KeyUsage[];
+}
+export interface EcdhKeyDeriveParams extends Algorithm {
+ public: CryptoKey;
+}
+export interface HkdfParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ info: BufferSource;
+ salt: BufferSource;
+}
+export interface Pbkdf2Params extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ iterations: number;
+ salt: BufferSource;
+}
+export interface AesDerivedKeyParams extends Algorithm {
+ length: number;
+}
+export interface HmacImportParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ length?: number;
+}
+export interface JsonWebKey {
+ alg?: string;
+ crv?: string;
+ d?: string;
+ dp?: string;
+ dq?: string;
+ e?: string;
+ ext?: boolean;
+ k?: string;
+ key_ops?: string[];
+ kty?: string;
+ n?: string;
+ oth?: RsaOtherPrimesInfo[];
+ p?: string;
+ q?: string;
+ qi?: string;
+ use?: string;
+ x?: string;
+ y?: string;
+}
+export interface CryptoKeyPair {
+ privateKey: CryptoKey;
+ publicKey: CryptoKey;
+}
+export interface RsaHashedKeyGenParams extends RsaKeyGenParams {
+ hash: HashAlgorithmIdentifier;
+}
+export interface EcKeyGenParams extends Algorithm {
+ namedCurve: NamedCurve;
+}
+export interface AesKeyGenParams extends Algorithm {
+ length: number;
+}
+export interface HmacKeyGenParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ length?: number;
+}
+export interface RsaHashedImportParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+}
+export interface EcKeyImportParams extends Algorithm {
+ namedCurve: NamedCurve;
+}
+export interface AesKeyAlgorithm extends KeyAlgorithm {
+ length: number;
+}
+export interface RsaPssParams extends Algorithm {
+ saltLength: number;
+}
+export interface EcdsaParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+}
+export interface Algorithm {
+ name: string;
+}
+export interface KeyAlgorithm {
+ name: string;
+}
+export interface RsaOtherPrimesInfo {
+ d?: string;
+ r?: string;
+ t?: string;
+}
+export interface RsaKeyGenParams extends Algorithm {
+ modulusLength: number;
+ publicExponent: BigInteger;
+}
+export type AttestationConveyancePreference = "direct" | "enterprise" | "indirect" | "none";
+export type AuthenticatorTransport = "ble" | "hybrid" | "internal" | "nfc" | "usb";
+export type COSEAlgorithmIdentifier = number;
+export type ResidentKeyRequirement = "discouraged" | "preferred" | "required";
+export type UserVerificationRequirement = "discouraged" | "preferred" | "required";
+export type AuthenticatorAttachment = "cross-platform" | "platform";
+export type BufferSource = ArrayBufferView | ArrayBuffer;
+export type PublicKeyCredentialType = "public-key";
+export type AlgorithmIdentifier = Algorithm | string;
+export type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
+export type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
+export type KeyType = "private" | "public" | "secret";
+export type HashAlgorithmIdentifier = AlgorithmIdentifier;
+export type NamedCurve = string;
+export type BigInteger = Uint8Array;
+//# sourceMappingURL=dom.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/types/dom.d.ts.map b/node_modules/@simplewebauthn/server/script/types/dom.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f0be52b43bd410ad33b66057befb1636266c582f
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/types/dom.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/types/dom.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH;;;;GAIG;AACH;;;;GAIG;AACH,MAAM,WAAW,8BAA+B,SAAQ,qBAAqB;IACzE,mHAAmH;IACnH,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC;IACxC,2GAA2G;IAC3G,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,4GAA4G;IAC5G,QAAQ,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;CAC3C;AAED;;;;GAIG;AACH,MAAM,WAAW,gCAAiC,SAAQ,qBAAqB;IAC3E,qHAAqH;IACrH,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC;IACxC,wHAAwH;IACxH,oBAAoB,IAAI,WAAW,CAAC;IACpC,gHAAgH;IAChH,YAAY,IAAI,WAAW,GAAG,IAAI,CAAC;IACnC,yHAAyH;IACzH,qBAAqB,IAAI,uBAAuB,CAAC;IACjD,iHAAiH;IACjH,aAAa,IAAI,MAAM,EAAE,CAAC;CAC7B;AAED,MAA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AM,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACtD,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/types/dom.js b/node_modules/@simplewebauthn/server/script/types/dom.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/types/dom.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@simplewebauthn/server/script/types/index.d.ts b/node_modules/@simplewebauthn/server/script/types/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..45e05d53c956f06c4fbf2a8f639d2f2c7de52a52
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/types/index.d.ts
@@ -0,0 +1,220 @@
+/**
+ * DO NOT MODIFY THESE FILES!
+ *
+ * These files were copied from the **types** package. To update this file, make changes to those
+ * files instead and then run the following command from the monorepo root folder:
+ *
+ * deno task codegen:types
+ */
+import type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticationExtensionsClientOutputs, AuthenticatorAssertionResponse, AuthenticatorAttachment, AuthenticatorAttestationResponse, AuthenticatorSelectionCriteria, COSEAlgorithmIdentifier, PublicKeyCredential, PublicKeyCredentialCreationOptions, PublicKeyCredentialDescriptor, PublicKeyCredentialParameters, PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, UserVerificationRequirement } from './dom.js';
+export type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticationExtensionsClientOutputs, AuthenticatorAssertionResponse, AuthenticatorAttachment, AuthenticatorAttestationResponse, AuthenticatorSelectionCriteria, AuthenticatorTransport, COSEAlgorithmIdentifier, Crypto, PublicKeyCredential, PublicKeyCredentialCreationOptions, PublicKeyCredentialDescriptor, PublicKeyCredentialParameters, PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, PublicKeyCredentialUserEntity, ResidentKeyRequirement, UserVerificationRequirement, } from './dom.js';
+/**
+ * A variant of PublicKeyCredentialCreationOptions suitable for JSON transmission to the browser to
+ * (eventually) get passed into navigator.credentials.create(...) in the browser.
+ *
+ * This should eventually get replaced with official TypeScript DOM types when WebAuthn L3 types
+ * eventually make it into the language:
+ *
+ * https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptionsjson
+ */
+export interface PublicKeyCredentialCreationOptionsJSON {
+ rp: PublicKeyCredentialRpEntity;
+ user: PublicKeyCredentialUserEntityJSON;
+ challenge: Base64URLString;
+ pubKeyCredParams: PublicKeyCredentialParameters[];
+ timeout?: number;
+ excludeCredentials?: PublicKeyCredentialDescriptorJSON[];
+ authenticatorSelection?: AuthenticatorSelectionCriteria;
+ hints?: PublicKeyCredentialHint[];
+ attestation?: AttestationConveyancePreference;
+ attestationFormats?: AttestationFormat[];
+ extensions?: AuthenticationExtensionsClientInputs;
+}
+/**
+ * A variant of PublicKeyCredentialRequestOptions suitable for JSON transmission to the browser to
+ * (eventually) get passed into navigator.credentials.get(...) in the browser.
+ */
+export interface PublicKeyCredentialRequestOptionsJSON {
+ challenge: Base64URLString;
+ timeout?: number;
+ rpId?: string;
+ allowCredentials?: PublicKeyCredentialDescriptorJSON[];
+ userVerification?: UserVerificationRequirement;
+ hints?: PublicKeyCredentialHint[];
+ extensions?: AuthenticationExtensionsClientInputs;
+}
+/**
+ * https://w3c.github.io/webauthn/#dictdef-publickeycredentialdescriptorjson
+ */
+export interface PublicKeyCredentialDescriptorJSON {
+ id: Base64URLString;
+ type: PublicKeyCredentialType;
+ transports?: AuthenticatorTransportFuture[];
+}
+/**
+ * https://w3c.github.io/webauthn/#dictdef-publickeycredentialuserentityjson
+ */
+export interface PublicKeyCredentialUserEntityJSON {
+ id: string;
+ name: string;
+ displayName: string;
+}
+/**
+ * The value returned from navigator.credentials.create()
+ */
+export interface RegistrationCredential extends PublicKeyCredentialFuture {
+ response: AuthenticatorAttestationResponseFuture;
+}
+/**
+ * A slightly-modified RegistrationCredential to simplify working with ArrayBuffers that
+ * are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
+ *
+ * https://w3c.github.io/webauthn/#dictdef-registrationresponsejson
+ */
+export interface RegistrationResponseJSON {
+ id: Base64URLString;
+ rawId: Base64URLString;
+ response: AuthenticatorAttestationResponseJSON;
+ authenticatorAttachment?: AuthenticatorAttachment;
+ clientExtensionResults: AuthenticationExtensionsClientOutputs;
+ type: PublicKeyCredentialType;
+}
+/**
+ * The value returned from navigator.credentials.get()
+ */
+export interface AuthenticationCredential extends PublicKeyCredentialFuture {
+ response: AuthenticatorAssertionResponse;
+}
+/**
+ * A slightly-modified AuthenticationCredential to simplify working with ArrayBuffers that
+ * are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
+ *
+ * https://w3c.github.io/webauthn/#dictdef-authenticationresponsejson
+ */
+export interface AuthenticationResponseJSON {
+ id: Base64URLString;
+ rawId: Base64URLString;
+ response: AuthenticatorAssertionResponseJSON;
+ authenticatorAttachment?: AuthenticatorAttachment;
+ clientExtensionResults: AuthenticationExtensionsClientOutputs;
+ type: PublicKeyCredentialType;
+}
+/**
+ * A slightly-modified AuthenticatorAttestationResponse to simplify working with ArrayBuffers that
+ * are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
+ *
+ * https://w3c.github.io/webauthn/#dictdef-authenticatorattestationresponsejson
+ */
+export interface AuthenticatorAttestationResponseJSON {
+ clientDataJSON: Base64URLString;
+ attestationObject: Base64URLString;
+ authenticatorData?: Base64URLString;
+ transports?: AuthenticatorTransportFuture[];
+ publicKeyAlgorithm?: COSEAlgorithmIdentifier;
+ publicKey?: Base64URLString;
+}
+/**
+ * A slightly-modified AuthenticatorAssertionResponse to simplify working with ArrayBuffers that
+ * are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
+ *
+ * https://w3c.github.io/webauthn/#dictdef-authenticatorassertionresponsejson
+ */
+export interface AuthenticatorAssertionResponseJSON {
+ clientDataJSON: Base64URLString;
+ authenticatorData: Base64URLString;
+ signature: Base64URLString;
+ userHandle?: Base64URLString;
+}
+/**
+ * Public key credential information needed to verify authentication responses
+ */
+export type WebAuthnCredential = {
+ id: Base64URLString;
+ publicKey: Uint8Array_;
+ counter: number;
+ transports?: AuthenticatorTransportFuture[];
+};
+/**
+ * An attempt to communicate that this isn't just any string, but a Base64URL-encoded string
+ */
+export type Base64URLString = string;
+/**
+ * AuthenticatorAttestationResponse in TypeScript's DOM lib is outdated (up through v3.9.7).
+ * Maintain an augmented version here so we can implement additional properties as the WebAuthn
+ * spec evolves.
+ *
+ * See https://www.w3.org/TR/webauthn-2/#iface-authenticatorattestationresponse
+ *
+ * Properties marked optional are not supported in all browsers.
+ */
+export interface AuthenticatorAttestationResponseFuture extends AuthenticatorAttestationResponse {
+ getTransports(): AuthenticatorTransportFuture[];
+}
+/**
+ * A super class of TypeScript's `AuthenticatorTransport` that includes support for the latest
+ * transports. Should eventually be replaced by TypeScript's when TypeScript gets updated to
+ * know about it (sometime after 4.6.3)
+ */
+export type AuthenticatorTransportFuture = 'ble' | 'cable' | 'hybrid' | 'internal' | 'nfc' | 'smart-card' | 'usb';
+/**
+ * A super class of TypeScript's `PublicKeyCredentialDescriptor` that knows about the latest
+ * transports. Should eventually be replaced by TypeScript's when TypeScript gets updated to
+ * know about it (sometime after 4.6.3)
+ */
+export interface PublicKeyCredentialDescriptorFuture extends Omit {
+ transports?: AuthenticatorTransportFuture[];
+}
+/** */
+export type PublicKeyCredentialJSON = RegistrationResponseJSON | AuthenticationResponseJSON;
+/**
+ * A super class of TypeScript's `PublicKeyCredential` that knows about upcoming WebAuthn features
+ */
+export interface PublicKeyCredentialFuture extends PublicKeyCredential {
+ type: PublicKeyCredentialType;
+ isConditionalMediationAvailable?(): Promise;
+ parseCreationOptionsFromJSON?(options: PublicKeyCredentialCreationOptionsJSON): PublicKeyCredentialCreationOptions;
+ parseRequestOptionsFromJSON?(options: PublicKeyCredentialRequestOptionsJSON): PublicKeyCredentialRequestOptions;
+ toJSON?(): PublicKeyCredentialJSON;
+}
+/**
+ * The two types of credentials as defined by bit 3 ("Backup Eligibility") in authenticator data:
+ * - `"singleDevice"` credentials will never be backed up
+ * - `"multiDevice"` credentials can be backed up
+ */
+export type CredentialDeviceType = 'singleDevice' | 'multiDevice';
+/**
+ * Categories of authenticators that Relying Parties can pass along to browsers during
+ * registration. Browsers that understand these values can optimize their modal experience to
+ * start the user off in a particular registration flow:
+ *
+ * - `hybrid`: A platform authenticator on a mobile device
+ * - `security-key`: A portable FIDO2 authenticator capable of being used on multiple devices via a USB or NFC connection
+ * - `client-device`: The device that WebAuthn is being called on. Typically synonymous with platform authenticators
+ *
+ * See https://w3c.github.io/webauthn/#enumdef-publickeycredentialhint
+ *
+ * These values are less strict than `authenticatorAttachment`
+ */
+export type PublicKeyCredentialHint = 'hybrid' | 'security-key' | 'client-device';
+/**
+ * Values for an attestation object's `fmt`
+ *
+ * See https://www.iana.org/assignments/webauthn/webauthn.xhtml#webauthn-attestation-statement-format-ids
+ */
+export type AttestationFormat = 'fido-u2f' | 'packed' | 'android-safetynet' | 'android-key' | 'tpm' | 'apple' | 'none';
+/**
+ * Equivalent to `Uint8Array` before TypeScript 5.7, and `Uint8Array` in TypeScript 5.7
+ * and beyond.
+ *
+ * **Context**
+ *
+ * `Uint8Array` became a generic type in TypeScript 5.7, requiring types defined simply as
+ * `Uint8Array` to be refactored to `Uint8Array` starting in Deno 2.2. `Uint8Array` is
+ * _not_ generic in Deno 2.1.x and earlier, though, so this type helps bridge this gap.
+ *
+ * Inspired by Deno's std library:
+ *
+ * https://github.com/denoland/std/blob/b5a5fe4f96b91c1fe8dba5cc0270092dd11d3287/bytes/_types.ts#L11
+ */
+export type Uint8Array_ = ReturnType;
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/types/index.d.ts.map b/node_modules/@simplewebauthn/server/script/types/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..bbe447a9050b6fc3438f5af9c2b6d1ffa63689a1
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/types/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,+BAA+B,EAC/B,oCAAoC,EACpC,qCAAqC,EACrC,8BAA8B,EAC9B,uBAAuB,EACvB,gCAAgC,EAChC,8BAA8B,EAC9B,uBAAuB,EACvB,mBAAmB,EACnB,kCAAkC,EAClC,6BAA6B,EAC7B,6BAA6B,EAC7B,iCAAiC,EACjC,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAElB,YAAY,EACV,+BAA+B,EAC/B,oCAAoC,EACpC,qCAAqC,EACrC,8BAA8B,EAC9B,uBAAuB,EACvB,gCAAgC,EAChC,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,MAAM,EACN,mBAAmB,EACnB,kCAAkC,EAClC,6BAA6B,EAC7B,6BAA6B,EAC7B,iCAAiC,EACjC,2BAA2B,EAC3B,uBAAuB,EACvB,6BAA6B,EAC7B,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,UAAU,CAAC;AAElB;;;;;;;;GAQG;AACH,MAAM,WAAW,sCAAsC;IACrD,EAAE,EAAE,2BAA2B,CAAC;IAChC,IAAI,EAAE,iCAAiC,CAAC;IACxC,SAAS,EAAE,eAAe,CAAC;IAC3B,gBAAgB,EAAE,6BAA6B,EAAE,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,iCAAiC,EAAE,CAAC;IACzD,sBAAsB,CAAC,EAAE,8BAA8B,CAA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,6BAA6B,EAAE,YAAY,CAAC;IACzD,UAAU,CAAC,EAAE,4BAA4B,EAAE,CAAC;CAC7C;AAED,MAAM;AACN,MAAM,MAAM,uBAAuB,GAC/B,wBAAwB,GACxB,0BAA0B,CAAC;AAE/B;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,IAAI,EAAE,uBAAuB,CAAC;IAE9B,+BAA+B,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAErD,4BAA4B,CAAC,CAC3B,OAAO,EAAE,sCAAsC,GAC9C,kCAAkC,CAAC;IAEtC,2BAA2B,CAAC,CAC1B,OAAO,EAAE,qCAAqC,GAC7C,iCAAiC,CAAC;IAErC,MAAM,CAAC,IAAI,uBAAuB,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,aAAa,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,cAAc,GAAG,eAAe,CAAC;AAElF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,QAAQ,GACR,mBAAmB,GACnB,aAAa,GACb,KAAK,GACL,OAAO,GACP,MAAM,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@simplewebauthn/server/script/types/index.js b/node_modules/@simplewebauthn/server/script/types/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce
--- /dev/null
+++ b/node_modules/@simplewebauthn/server/script/types/index.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@standard-schema/spec/LICENSE b/node_modules/@standard-schema/spec/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..ea54e0ddad405b2ee635d687a876613214160ba2
--- /dev/null
+++ b/node_modules/@standard-schema/spec/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 Colin McDonnell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/@standard-schema/spec/README.md b/node_modules/@standard-schema/spec/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..f9813ffa878e7914dc2928ab13db856850e8d83e
--- /dev/null
+++ b/node_modules/@standard-schema/spec/README.md
@@ -0,0 +1,198 @@
+
+
+
+ Standard Schema
+
+ A family of specs for interoperable TypeScript
+
+ standardschema.dev
+
+
+
+
+
+The Standard Schema project is a set of interfaces that standardize the provision and consumption of shared functionality in the TypeScript ecosystem.
+
+Its goal is to allow tools to accept a single input that includes all the types and capabilities they need— no library-specific adapters, no extra dependencies. The result is an ecosystem that's fair for implementers, friendly for consumers, and open for end users.
+
+## The specifications
+
+The specifications can be found below in their entirety. Libraries wishing to implement a spec can copy/paste the code block below into their codebase. They're also available at `@standard-schema/spec` on [npm](https://www.npmjs.com/package/@standard-schema/spec) and [JSR](https://jsr.io/@standard-schema/spec).
+
+```ts
+// #########################
+// ### Standard Typed ###
+// #########################
+
+/** The Standard Typed interface. This is a base type extended by other specs. */
+export interface StandardTypedV1 {
+ /** The Standard properties. */
+ readonly "~standard": StandardTypedV1.Props;
+}
+
+export declare namespace StandardTypedV1 {
+ /** The Standard Typed properties interface. */
+ export interface Props {
+ /** The version number of the standard. */
+ readonly version: 1;
+ /** The vendor name of the schema library. */
+ readonly vendor: string;
+ /** Inferred types associated with the schema. */
+ readonly types?: Types | undefined;
+ }
+
+ /** The Standard Typed types interface. */
+ export interface Types {
+ /** The input type of the schema. */
+ readonly input: Input;
+ /** The output type of the schema. */
+ readonly output: Output;
+ }
+
+ /** Infers the input type of a Standard Typed. */
+ export type InferInput = NonNullable<
+ Schema["~standard"]["types"]
+ >["input"];
+
+ /** Infers the output type of a Standard Typed. */
+ export type InferOutput = NonNullable<
+ Schema["~standard"]["types"]
+ >["output"];
+}
+
+// ##########################
+// ### Standard Schema ###
+// ##########################
+
+/** The Standard Schema interface. */
+export interface StandardSchemaV1 {
+ /** The Standard Schema properties. */
+ readonly "~standard": StandardSchemaV1.Props;
+}
+
+export declare namespace StandardSchemaV1 {
+ /** The Standard Schema properties interface. */
+ export interface Props
+ extends StandardTypedV1.Props {
+ /** Validates unknown input values. */
+ readonly validate: (
+ value: unknown,
+ options?: StandardSchemaV1.Options | undefined
+ ) => Result