Skip to content

Commit 25e1928

Browse files
JamesCullumgithub-actions[bot]
authored andcommitted
[skip_ci] v3.2.2: Build artifacts for Deno
1 parent 0895a3b commit 25e1928

File tree

2 files changed

+50
-24
lines changed

2 files changed

+50
-24
lines changed

dist/main.cjs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,9 @@ function pemToBase64(pem) {
18161816
throw new Error("expected PEM string as input");
18171817
}
18181818

1819+
// Remove trailing \n
1820+
pem = pem.replace(/^\n/, "");
1821+
18191822
// Split on \n
18201823
let pemArr = pem.split("\n");
18211824

@@ -3787,17 +3790,17 @@ function packedParseFn(attStmt) {
37873790
return ret;
37883791
}
37893792

3790-
function packedValidateFn() {
3793+
async function packedValidateFn() {
37913794
const x5c = this.authnrData.get("x5c");
37923795
const ecdaaKeyId = this.authnrData.get("ecdaaKeyId");
37933796

37943797
if (x5c !== undefined && ecdaaKeyId !== undefined) {
37953798
throw new Error("packed attestation: should be 'basic' or 'ecdaa', got both");
37963799
}
37973800

3798-
if (x5c) return packedValidateBasic.call(this);
3799-
if (ecdaaKeyId) return packedValidateEcdaa.call(this);
3800-
return packedValidateSurrogate.call(this);
3801+
if (x5c) return await packedValidateBasic.call(this);
3802+
if (ecdaaKeyId) return await packedValidateEcdaa.call(this);
3803+
return await packedValidateSurrogate.call(this);
38013804
}
38023805

38033806
async function packedValidateBasic() {
@@ -3969,7 +3972,7 @@ async function validateSelfSignature(rawClientData, authenticatorData, sig, hash
39693972
return verify;
39703973
}
39713974

3972-
function packedValidateSurrogate() {
3975+
async function packedValidateSurrogate() {
39733976
// see what algorithm we're working with
39743977
const {
39753978
algName,
@@ -3983,14 +3986,14 @@ function packedValidateSurrogate() {
39833986
// from: https://w3c.github.io/webauthn/#packed-attestation
39843987
// Verify that sig is a valid signature over the concatenation of authenticatorData and clientDataHash using the credential public key with alg.
39853988

3986-
const res = validateSelfSignature(
3989+
const res = await validateSelfSignature(
39873990
this.clientData.get("rawClientDataJson"),
39883991
this.authnrData.get("rawAuthnrData"),
39893992
this.authnrData.get("sig"),
39903993
hashAlg,
39913994
this.authnrData.get("credentialPublicKeyPem"),
39923995
);
3993-
if (!res) {
3996+
if (!res || typeof res !== "boolean") {
39943997
throw new Error("packed attestation signature verification failed");
39953998
}
39963999
this.audit.journal.add("sig");

dist/main.js

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,6 +1937,14 @@ const s = function() {
19371937
rhcloud: o16,
19381938
render: b,
19391939
onrender: o16,
1940+
code: {
1941+
$: 0,
1942+
succ: {
1943+
builder: o16,
1944+
"dev-builder": o16,
1945+
"stg-builder": o16
1946+
}
1947+
},
19401948
logoip: o16,
19411949
scrysec: o16,
19421950
"firewall-gateway": o16,
@@ -8605,7 +8613,8 @@ const s = function() {
86058613
pm: {
86068614
$: 1,
86078615
succ: {
8608-
own: o16
8616+
own: o16,
8617+
name: o16
86098618
}
86108619
},
86118620
pn: {
@@ -9125,7 +9134,12 @@ const s = function() {
91259134
},
91269135
td: s8,
91279136
tel: a15,
9128-
tf: a15,
9137+
tf: {
9138+
$: 1,
9139+
succ: {
9140+
sch: o16
9141+
}
9142+
},
91299143
tg: a15,
91309144
th: {
91319145
$: 1,
@@ -9720,7 +9734,13 @@ const s = function() {
97209734
me: o16
97219735
}
97229736
},
9723-
wf: a15,
9737+
wf: {
9738+
$: 1,
9739+
succ: {
9740+
biz: o16,
9741+
sch: o16
9742+
}
9743+
},
97249744
ws: {
97259745
$: 1,
97269746
succ: {
@@ -18745,7 +18765,7 @@ class RelativeDistinguishedNames extends PkiObject {
1874518765
RelativeDistinguishedNames.CLASS_NAME = "RelativeDistinguishedNames";
1874618766
const TYPE$4 = "type";
1874718767
const VALUE$5 = "value";
18748-
function builtInStandardAttributes(parameters = {}, optional = false) {
18768+
function builtInStandardAttributes(parameters = {}, optional) {
1874918769
const names = getParametersValue(parameters, "names", {});
1875018770
return new Sequence({
1875118771
optional,
@@ -18891,7 +18911,7 @@ function builtInStandardAttributes(parameters = {}, optional = false) {
1889118911
]
1889218912
});
1889318913
}
18894-
function builtInDomainDefinedAttributes(optional = false) {
18914+
function builtInDomainDefinedAttributes(optional) {
1889518915
return new Sequence({
1889618916
optional,
1889718917
value: [
@@ -18900,7 +18920,7 @@ function builtInDomainDefinedAttributes(optional = false) {
1890018920
]
1890118921
});
1890218922
}
18903-
function extensionAttributes(optional = false) {
18923+
function extensionAttributes(optional) {
1890418924
return new Set1({
1890518925
optional,
1890618926
value: [
@@ -32483,24 +32503,26 @@ class EnvelopedData extends PkiObject {
3248332503
valueHex: wrappedKey
3248432504
});
3248532505
};
32506+
const res = [];
3248632507
for(let i100 = 0; i100 < this.recipientInfos.length; i100++){
3248732508
switch(this.recipientInfos[i100].variant){
3248832509
case 1:
32489-
await SubKeyTransRecipientInfo(i100);
32510+
res.push(await SubKeyTransRecipientInfo(i100));
3249032511
break;
3249132512
case 2:
32492-
await SubKeyAgreeRecipientInfo(i100);
32513+
res.push(await SubKeyAgreeRecipientInfo(i100));
3249332514
break;
3249432515
case 3:
32495-
await SubKEKRecipientInfo(i100);
32516+
res.push(await SubKEKRecipientInfo(i100));
3249632517
break;
3249732518
case 4:
32498-
await SubPasswordRecipientinfo(i100);
32519+
res.push(await SubPasswordRecipientinfo(i100));
3249932520
break;
3250032521
default:
3250132522
throw new Error(`Unknown recipient type in array with index ${i100}`);
3250232523
}
3250332524
}
32525+
return res;
3250432526
}
3250532527
async decrypt(recipientIndex, parameters, crypto = getCrypto(true)) {
3250632528
const decryptionParameters = parameters || {};
@@ -40680,6 +40702,7 @@ function pemToBase64(pem) {
4068040702
if (!isPem(pem)) {
4068140703
throw new Error("expected PEM string as input");
4068240704
}
40705+
pem = pem.replace(/^\n/, "");
4068340706
let pemArr = pem.split("\n");
4068440707
pemArr = pemArr.slice(1, pemArr.length - 2);
4068540708
return pemArr.join("");
@@ -41949,15 +41972,15 @@ function packedParseFn(attStmt) {
4194941972
ret.set("sig", sig);
4195041973
return ret;
4195141974
}
41952-
function packedValidateFn() {
41975+
async function packedValidateFn() {
4195341976
const x5c = this.authnrData.get("x5c");
4195441977
const ecdaaKeyId = this.authnrData.get("ecdaaKeyId");
4195541978
if (x5c !== undefined && ecdaaKeyId !== undefined) {
4195641979
throw new Error("packed attestation: should be 'basic' or 'ecdaa', got both");
4195741980
}
41958-
if (x5c) return packedValidateBasic.call(this);
41959-
if (ecdaaKeyId) return packedValidateEcdaa.call(this);
41960-
return packedValidateSurrogate.call(this);
41981+
if (x5c) return await packedValidateBasic.call(this);
41982+
if (ecdaaKeyId) return await packedValidateEcdaa.call(this);
41983+
return await packedValidateSurrogate.call(this);
4196141984
}
4196241985
async function packedValidateBasic() {
4196341986
const { algName , hashAlg , } = this.authnrData.get("alg");
@@ -42042,13 +42065,13 @@ async function validateSelfSignature(rawClientData, authenticatorData, sig, hash
4204242065
const verify2 = await mod2.verifySignature(publicKeyPem, sig, appendBuffer(authenticatorData, clientDataHash), hashAlg);
4204342066
return verify2;
4204442067
}
42045-
function packedValidateSurrogate() {
42068+
async function packedValidateSurrogate() {
4204642069
const { algName , hashAlg , } = this.authnrData.get("alg");
4204742070
if (algName === undefined) {
4204842071
throw new Error("packed attestation: unknown algorithm " + algName);
4204942072
}
42050-
const res = validateSelfSignature(this.clientData.get("rawClientDataJson"), this.authnrData.get("rawAuthnrData"), this.authnrData.get("sig"), hashAlg, this.authnrData.get("credentialPublicKeyPem"));
42051-
if (!res) {
42073+
const res = await validateSelfSignature(this.clientData.get("rawClientDataJson"), this.authnrData.get("rawAuthnrData"), this.authnrData.get("sig"), hashAlg, this.authnrData.get("credentialPublicKeyPem"));
42074+
if (!res || typeof res !== "boolean") {
4205242075
throw new Error("packed attestation signature verification failed");
4205342076
}
4205442077
this.audit.journal.add("sig");

0 commit comments

Comments
 (0)