@zkpassport/sdk 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +6 -3
- package/dist/esm/index.js +6 -3
- package/package.json +1 -1
- package/src/index.ts +6 -5
package/dist/cjs/index.js
CHANGED
|
@@ -411,7 +411,10 @@ class ZKPassport {
|
|
|
411
411
|
let commitmentOut;
|
|
412
412
|
let isCorrect = true;
|
|
413
413
|
let uniqueIdentifier;
|
|
414
|
-
const
|
|
414
|
+
const VALID_CERTIFICATE_REGISTRY_ROOT = [
|
|
415
|
+
BigInt("20192042006788880778219739574377003123593792072535937278552252195461520776494"),
|
|
416
|
+
BigInt("21301853597069384763054217328384418971999152625381818922211526730996340553696"),
|
|
417
|
+
];
|
|
415
418
|
const defaultDateValue = new Date(1111, 10, 11);
|
|
416
419
|
const currentTime = new Date();
|
|
417
420
|
const today = new Date(currentTime.getFullYear(), currentTime.getMonth(), currentTime.getDate(), 0, 0, 0, 0);
|
|
@@ -459,11 +462,11 @@ class ZKPassport {
|
|
|
459
462
|
if (proof.name?.startsWith("sig_check_dsc")) {
|
|
460
463
|
commitmentOut = (0, utils_1.getCommitmentFromDSCProof)(proofData);
|
|
461
464
|
const merkleRoot = (0, utils_1.getMerkleRootFromDSCProof)(proofData);
|
|
462
|
-
if (merkleRoot
|
|
465
|
+
if (!VALID_CERTIFICATE_REGISTRY_ROOT.includes(merkleRoot)) {
|
|
463
466
|
console.warn("The ID was signed by an unrecognized root certificate");
|
|
464
467
|
isCorrect = false;
|
|
465
468
|
queryResultErrors.sig_check_dsc.certificate = {
|
|
466
|
-
expected: `Certificate registry root: ${
|
|
469
|
+
expected: `Certificate registry root: ${VALID_CERTIFICATE_REGISTRY_ROOT.join(", ")}`,
|
|
467
470
|
received: `Certificate registry root: ${merkleRoot.toString()}`,
|
|
468
471
|
message: "The ID was signed by an unrecognized root certificate",
|
|
469
472
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -401,7 +401,10 @@ export class ZKPassport {
|
|
|
401
401
|
let commitmentOut;
|
|
402
402
|
let isCorrect = true;
|
|
403
403
|
let uniqueIdentifier;
|
|
404
|
-
const
|
|
404
|
+
const VALID_CERTIFICATE_REGISTRY_ROOT = [
|
|
405
|
+
BigInt("20192042006788880778219739574377003123593792072535937278552252195461520776494"),
|
|
406
|
+
BigInt("21301853597069384763054217328384418971999152625381818922211526730996340553696"),
|
|
407
|
+
];
|
|
405
408
|
const defaultDateValue = new Date(1111, 10, 11);
|
|
406
409
|
const currentTime = new Date();
|
|
407
410
|
const today = new Date(currentTime.getFullYear(), currentTime.getMonth(), currentTime.getDate(), 0, 0, 0, 0);
|
|
@@ -449,11 +452,11 @@ export class ZKPassport {
|
|
|
449
452
|
if (proof.name?.startsWith("sig_check_dsc")) {
|
|
450
453
|
commitmentOut = getCommitmentFromDSCProof(proofData);
|
|
451
454
|
const merkleRoot = getMerkleRootFromDSCProof(proofData);
|
|
452
|
-
if (merkleRoot
|
|
455
|
+
if (!VALID_CERTIFICATE_REGISTRY_ROOT.includes(merkleRoot)) {
|
|
453
456
|
console.warn("The ID was signed by an unrecognized root certificate");
|
|
454
457
|
isCorrect = false;
|
|
455
458
|
queryResultErrors.sig_check_dsc.certificate = {
|
|
456
|
-
expected: `Certificate registry root: ${
|
|
459
|
+
expected: `Certificate registry root: ${VALID_CERTIFICATE_REGISTRY_ROOT.join(", ")}`,
|
|
457
460
|
received: `Certificate registry root: ${merkleRoot.toString()}`,
|
|
458
461
|
message: "The ID was signed by an unrecognized root certificate",
|
|
459
462
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -738,9 +738,10 @@ export class ZKPassport {
|
|
|
738
738
|
let commitmentOut: bigint | undefined
|
|
739
739
|
let isCorrect = true
|
|
740
740
|
let uniqueIdentifier: string | undefined
|
|
741
|
-
const
|
|
742
|
-
"
|
|
743
|
-
|
|
741
|
+
const VALID_CERTIFICATE_REGISTRY_ROOT = [
|
|
742
|
+
BigInt("20192042006788880778219739574377003123593792072535937278552252195461520776494"),
|
|
743
|
+
BigInt("21301853597069384763054217328384418971999152625381818922211526730996340553696"),
|
|
744
|
+
]
|
|
744
745
|
const defaultDateValue = new Date(1111, 10, 11)
|
|
745
746
|
const currentTime = new Date()
|
|
746
747
|
const today = new Date(
|
|
@@ -798,11 +799,11 @@ export class ZKPassport {
|
|
|
798
799
|
if (proof.name?.startsWith("sig_check_dsc")) {
|
|
799
800
|
commitmentOut = getCommitmentFromDSCProof(proofData)
|
|
800
801
|
const merkleRoot = getMerkleRootFromDSCProof(proofData)
|
|
801
|
-
if (merkleRoot
|
|
802
|
+
if (!VALID_CERTIFICATE_REGISTRY_ROOT.includes(merkleRoot)) {
|
|
802
803
|
console.warn("The ID was signed by an unrecognized root certificate")
|
|
803
804
|
isCorrect = false
|
|
804
805
|
queryResultErrors.sig_check_dsc.certificate = {
|
|
805
|
-
expected: `Certificate registry root: ${
|
|
806
|
+
expected: `Certificate registry root: ${VALID_CERTIFICATE_REGISTRY_ROOT.join(", ")}`,
|
|
806
807
|
received: `Certificate registry root: ${merkleRoot.toString()}`,
|
|
807
808
|
message: "The ID was signed by an unrecognized root certificate",
|
|
808
809
|
}
|