diff options
author | Matthew Miller <matthew@millerti.me> | 2020-09-08 00:16:31 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-09-08 00:16:31 -0700 |
commit | d85f2b0386991ae2a144550a4dd55aec2b0094b8 (patch) | |
tree | 36c5eceb69e3f5a703e829002e34780355269143 /packages/server/src | |
parent | 35162c41ddfe4d35f5fe1ecce9cec98dd1a4a60f (diff) |
Convert public key to PEM during assertion
Diffstat (limited to 'packages/server/src')
-rw-r--r-- | packages/server/src/assertion/verifyAssertionResponse.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/server/src/assertion/verifyAssertionResponse.ts b/packages/server/src/assertion/verifyAssertionResponse.ts index c954af7..b2923ee 100644 --- a/packages/server/src/assertion/verifyAssertionResponse.ts +++ b/packages/server/src/assertion/verifyAssertionResponse.ts @@ -3,7 +3,7 @@ import { AssertionCredentialJSON, AuthenticatorDevice } from '@simplewebauthn/ty import decodeClientDataJSON from '../helpers/decodeClientDataJSON'; import toHash from '../helpers/toHash'; -import convertX509CertToPEM from '../helpers/convertX509CertToPEM'; +import convertPublicKeyToPEM from '../helpers/convertPublicKeyToPEM'; import verifySignature from '../helpers/verifySignature'; import parseAuthenticatorData from '../helpers/parseAuthenticatorData'; import isBase64URLString from '../helpers/isBase64URLString'; @@ -139,7 +139,7 @@ export default function verifyAssertionResponse(options: Options): VerifiedAsser const clientDataHash = toHash(base64url.toBuffer(response.clientDataJSON)); const signatureBase = Buffer.concat([authDataBuffer, clientDataHash]); - const publicKey = convertX509CertToPEM(base64url.toBuffer(authenticator.publicKey)); + const publicKey = convertPublicKeyToPEM(authenticator.publicKey); const signature = base64url.toBuffer(response.signature); if ((counter > 0 || authenticator.counter > 0) && counter <= authenticator.counter) { |