diff --git a/packages/server/src/authenticatorKey/parseFidoPackedKey.js b/packages/server/src/authenticatorKey/parseFidoPackedKey.js index 8dfa526..dd2bba8 100644 --- a/packages/server/src/authenticatorKey/parseFidoPackedKey.js +++ b/packages/server/src/authenticatorKey/parseFidoPackedKey.js @@ -129,7 +129,7 @@ exports.validateFidoPackedKey = ( } const clientDataHash = hash( - 'SHA256', + 'sha256', Buffer.from(clientDataJSON, 'base64') ); const signatureBaseBuffer = Buffer.concat([ diff --git a/packages/server/src/authenticatorKey/parseFidoU2FKey.js b/packages/server/src/authenticatorKey/parseFidoU2FKey.js index 876b038..bebbe08 100644 --- a/packages/server/src/authenticatorKey/parseFidoU2FKey.js +++ b/packages/server/src/authenticatorKey/parseFidoU2FKey.js @@ -14,7 +14,7 @@ exports.parseFidoU2FKey = (authenticatorKey, clientDataJSON) => { } const clientDataHash = hash( - 'SHA256', + 'sha256', Buffer.from(clientDataJSON, 'base64') ); const reservedByte = Buffer.from([0x00]); @@ -59,7 +59,7 @@ exports.validateFidoU2FKey = ( } const clientDataHash = hash( - 'SHA256', + 'sha256', Buffer.from(clientDataJSON, 'base64') ); const signatureBase = Buffer.concat([ diff --git a/packages/server/src/utils.js b/packages/server/src/utils.js index 5cd831d..af6f7ea 100644 --- a/packages/server/src/utils.js +++ b/packages/server/src/utils.js @@ -101,7 +101,7 @@ exports.verifySignature = ( data, publicKey ) => { - return createVerify('SHA256') + return createVerify('sha256') .update(data) .verify(publicKey, signature); };