summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--packages/server/src/helpers/decodeAttestationObject.test.ts4
-rw-r--r--packages/server/src/helpers/decodeClientDataJSON.test.ts2
-rw-r--r--packages/server/src/helpers/decodeClientDataJSON.ts4
3 files changed, 5 insertions, 5 deletions
diff --git a/packages/server/src/helpers/decodeAttestationObject.test.ts b/packages/server/src/helpers/decodeAttestationObject.test.ts
index e8eb364..2f88f2a 100644
--- a/packages/server/src/helpers/decodeAttestationObject.test.ts
+++ b/packages/server/src/helpers/decodeAttestationObject.test.ts
@@ -1,6 +1,6 @@
import decodeAttestationObject from './decodeAttestationObject';
-test('should decode base64-encoded indirect attestationObject', () => {
+test('should decode base64url-encoded indirect attestationObject', () => {
const decoded = decodeAttestationObject(
'o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YVjEAbElFazplpnc037DORGDZNjDq86cN9vm6' +
'+APoAM20wtBAAAAAAAAAAAAAAAAAAAAAAAAAAAAQKmPuEwByQJ3e89TccUSrCGDkNWquhevjLLn/' +
@@ -13,7 +13,7 @@ test('should decode base64-encoded indirect attestationObject', () => {
expect(decoded.authData).toBeDefined();
});
-test('should decode base64-encoded direct attestationObject', () => {
+test('should decode base64url-encoded direct attestationObject', () => {
const decoded = decodeAttestationObject(
'o2NmbXRoZmlkby11MmZnYXR0U3RtdKJjc2lnWEgwRgIhAK40WxA0t7py7AjEXvwGwTlmqlvrOk' +
's5g9lf+9zXzRiVAiEA3bv60xyXveKDOusYzniD7CDSostCet9PYK7FLdnTdZNjeDVjgVkCwTCCAr0wggGloAMCAQICBCrn' +
diff --git a/packages/server/src/helpers/decodeClientDataJSON.test.ts b/packages/server/src/helpers/decodeClientDataJSON.test.ts
index 7674ec5..b1a7940 100644
--- a/packages/server/src/helpers/decodeClientDataJSON.test.ts
+++ b/packages/server/src/helpers/decodeClientDataJSON.test.ts
@@ -1,6 +1,6 @@
import decodeClientDataJSON from './decodeClientDataJSON';
-test('should convert base64-encoded attestation clientDataJSON to JSON', () => {
+test('should convert base64url-encoded attestation clientDataJSON to JSON', () => {
expect(
decodeClientDataJSON(
'eyJjaGFsbGVuZ2UiOiJVMmQ0TjNZME0wOU1jbGRQYjFSNVpFeG5UbG95IiwiY2xpZW50RXh0ZW5zaW9ucyI6e30' +
diff --git a/packages/server/src/helpers/decodeClientDataJSON.ts b/packages/server/src/helpers/decodeClientDataJSON.ts
index 93c6b10..7c09b0d 100644
--- a/packages/server/src/helpers/decodeClientDataJSON.ts
+++ b/packages/server/src/helpers/decodeClientDataJSON.ts
@@ -1,13 +1,13 @@
import base64url from 'base64url';
/**
- * Decode an authenticator's base64-encoded clientDataJSON to JSON
+ * Decode an authenticator's base64url-encoded clientDataJSON to JSON
*/
export default function decodeClientDataJSON(data: string): ClientDataJSON {
const toString = base64url.decode(data);
const clientData: ClientDataJSON = JSON.parse(toString);
- // `challenge` will be Base64-encoded here. Decode it for easier comparisons with what is provided
+ // `challenge` will be Base64URL-encoded here. Decode it for easier comparisons with what is provided
// as the expected value
clientData.challenge = Buffer.from(clientData.challenge, 'base64').toString('ascii');