summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/helpers/parseAuthenticatorData.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/server/src/helpers/parseAuthenticatorData.ts')
-rw-r--r--packages/server/src/helpers/parseAuthenticatorData.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/server/src/helpers/parseAuthenticatorData.ts b/packages/server/src/helpers/parseAuthenticatorData.ts
index 964d274..6fea0bd 100644
--- a/packages/server/src/helpers/parseAuthenticatorData.ts
+++ b/packages/server/src/helpers/parseAuthenticatorData.ts
@@ -51,7 +51,7 @@ export default function parseAuthenticatorData(authData: Buffer): ParsedAuthenti
// Decode the next CBOR item in the buffer, then re-encode it back to a Buffer
const firstDecoded = cbor.decodeFirstSync(intBuffer);
- const firstEncoded = cbor.encode(firstDecoded);
+ const firstEncoded = Buffer.from(cbor.encode(firstDecoded));
credentialPublicKey = firstEncoded;
intBuffer = intBuffer.slice(firstEncoded.byteLength);
}
@@ -59,7 +59,7 @@ export default function parseAuthenticatorData(authData: Buffer): ParsedAuthenti
let extensionsDataBuffer: Buffer | undefined = undefined;
if (flags.ed) {
const firstDecoded = cbor.decodeFirstSync(intBuffer);
- const firstEncoded = cbor.encode(firstDecoded);
+ const firstEncoded = Buffer.from(cbor.encode(firstDecoded));
extensionsDataBuffer = firstEncoded;
intBuffer = intBuffer.slice(firstEncoded.byteLength);
}