Comparing version 3.4.3 to 3.4.4
@@ -5,6 +5,8 @@ import { ab2str, coerceToArrayBuffer, isPem, pemToBase64, tools } from "./utils.js"; | ||
constructor(cert) { | ||
let decoded; | ||
// Clean up base64 string | ||
if (typeof cert === "string" || cert instanceof String) { | ||
cert = cert.replace(/\r/g, ""); | ||
cert = cert.replace(/\r/g, "").trim(); | ||
decoded = ab2str(coerceToArrayBuffer(cert, "certificate")); | ||
} | ||
@@ -14,4 +16,6 @@ | ||
cert = pemToBase64(cert); | ||
} else if (decoded && isPem(decoded)) { | ||
cert = pemToBase64(decoded); | ||
} | ||
// Clean up certificate | ||
@@ -18,0 +22,0 @@ if (typeof cert === "string" || cert instanceof String) { |
{ | ||
"name": "fido2-lib", | ||
"version": "3.4.3", | ||
"version": "3.4.4", | ||
"description": "A library for performing FIDO 2.0 / WebAuthn functionality", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -32,2 +32,8 @@ // Testing lib | ||
it("can decode base64 encoded cert", function() { | ||
const cert = new Certificate(h.certs.truUCert); | ||
assert.instanceOf(cert, Certificate); | ||
assert.isObject(cert._cert); | ||
}); | ||
it("throws if no arg to constructor", function() { | ||
@@ -34,0 +40,0 @@ assert.throws(() => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
3616399
71432
15