From 3c03d55c8cca33cf0e5fc3d3e32be5ef97b139ea Mon Sep 17 00:00:00 2001 From: javisantos Date: Wed, 19 Feb 2020 01:45:12 +0100 Subject: [PATCH 1/3] Fix sha256 capitalization --- packages/server/src/authenticatorKey/parseFidoU2FKey.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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([ From 6f4b1c260588ce6d78ccc6dc553d0a515c88d714 Mon Sep 17 00:00:00 2001 From: javisantos Date: Wed, 19 Feb 2020 01:52:22 +0100 Subject: [PATCH 2/3] Fix sha256 capitalization --- packages/server/src/authenticatorKey/parseFidoPackedKey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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([ From 954c2cdad6e3631ff37cc0aaa5e4787c28251ab3 Mon Sep 17 00:00:00 2001 From: Javi Santos Date: Mon, 24 Feb 2020 22:53:07 +0100 Subject: [PATCH 3/3] fix sha256 --- packages/server/src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); };