Skip to content

Commit

Permalink
[skip_ci] v3.3.3: Build artifacts for Deno
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesCullum authored and github-actions[bot] committed Sep 25, 2022
1 parent 4ab5b91 commit 7f18d22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions dist/main.cjs
Expand Up @@ -1277,13 +1277,11 @@ function coseAlgToHashStr(alg) {
let webcrypto;
if ((typeof self !== "undefined") && "crypto" in self) {
// Always use crypto if available natively (browser / Deno)
console.warn("[FIDO2-LIB] Native crypto is enabled");
webcrypto = self.crypto;

} else {
// Always use node webcrypto if available ( >= 16.0 )
if(platformCrypto__namespace && platformCrypto__namespace.webcrypto) {
console.warn("[FIDO2-LIB] Native crypto is enabled");
webcrypto = platformCrypto__namespace.webcrypto;

} else {
Expand Down Expand Up @@ -2064,7 +2062,7 @@ function validateAssertionResponse() {

if (typeof req.response.userHandle !== "string" &&
!(req.response.userHandle instanceof ArrayBuffer) &&
req.response.userHandle !== undefined) {
req.response.userHandle !== undefined && req.response.userHandle !== null) {
throw new TypeError("expected 'response.userHandle' to be base64 String, ArrayBuffer, or undefined");
}

Expand Down Expand Up @@ -2961,7 +2959,7 @@ async function parseAuthnrAssertionResponse(msg) {
}

let userHandle;
if (msg.response.userHandle !== undefined) {
if (msg.response.userHandle !== undefined && msg.response.userHandle !== null) {
userHandle = coerceToArrayBuffer$1(msg.response.userHandle, "response.userHandle");
if (userHandle.byteLength === 0) {
userHandle = undefined;
Expand Down
6 changes: 2 additions & 4 deletions dist/main.js
Expand Up @@ -40519,11 +40519,9 @@ function b64ToJsObject(b64, desc) {
return JSON.parse(ab2str(coerceToArrayBuffer(b64, desc)));
}
if (typeof self !== "undefined" && "crypto" in self) {
console.warn("[FIDO2-LIB] Native crypto is enabled");
webcrypto = self.crypto;
} else {
if (mod1 && mod1.webcrypto) {
console.warn("[FIDO2-LIB] Native crypto is enabled");
webcrypto = mod1.webcrypto;
} else {
webcrypto = new Crypto();
Expand Down Expand Up @@ -43504,7 +43502,7 @@ async function parseAuthnrAssertionResponse(msg) {
throw new TypeError("expected response to be Object");
}
let userHandle;
if (msg.response.userHandle !== undefined) {
if (msg.response.userHandle !== undefined && msg.response.userHandle !== null) {
userHandle = coerceToArrayBuffer(msg.response.userHandle, "response.userHandle");
if (userHandle.byteLength === 0) {
userHandle = undefined;
Expand Down Expand Up @@ -43672,7 +43670,7 @@ function validateAssertionResponse() {
if (typeof req.response.signature !== "string" && !(req.response.signature instanceof ArrayBuffer)) {
throw new TypeError("expected 'response.signature' to be base64 String or ArrayBuffer");
}
if (typeof req.response.userHandle !== "string" && !(req.response.userHandle instanceof ArrayBuffer) && req.response.userHandle !== undefined) {
if (typeof req.response.userHandle !== "string" && !(req.response.userHandle instanceof ArrayBuffer) && req.response.userHandle !== undefined && req.response.userHandle !== null) {
throw new TypeError("expected 'response.userHandle' to be base64 String, ArrayBuffer, or undefined");
}
this.audit.validRequest = true;
Expand Down

0 comments on commit 7f18d22

Please sign in to comment.