Skip to content

Commit

Permalink
Merge pull request #27 from auth0-lab/fix_issuing_jurisdiction
Browse files Browse the repository at this point in the history
fix: issuing_jurisdiction enforcement
  • Loading branch information
jfromaniello authored Oct 29, 2024
2 parents 8c700e2 + 822672a commit 334bb57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mdoc/IssuerSignedItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class IssuerSignedItem {
if (this.elementIdentifier === 'issuing_country') {
return countryName === this.elementValue;
}
if (this.elementIdentifier === 'issuing_jurisdiction') {
if (this.elementIdentifier === 'issuing_jurisdiction' && stateOrProvince) {
return stateOrProvince === this.elementValue;
}
return undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/mdoc/Verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export class Verifier {
});

const invalidJurisdiction = verifications.filter((v) => v.ns === ns && v.ev.elementIdentifier === 'issuing_jurisdiction')
.find((v) => !v.isValid || !v.ev.matchCertificate(ns, issuerAuth));
.find((v) => !v.isValid || (issuerAuth.stateOrProvince && !v.ev.matchCertificate(ns, issuerAuth)));

onCheck({
status: invalidJurisdiction ? 'FAILED' : 'PASSED',
Expand Down

0 comments on commit 334bb57

Please sign in to comment.