Skip to content

Commit

Permalink
Merge pull request #369 from Concordium/verify-id-statements
Browse files Browse the repository at this point in the history
Verify id statements when checking for valid proofs
  • Loading branch information
orhoj authored Aug 31, 2023
2 parents fc34721 + 359c20c commit 9bc7afb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/browser-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Fixed

- An issue where changing the credential metadata URL to an invalid URL, or a URL that does not contain a credential metadata file, would result in an empty screen.
- Enabled ID statement checks for Web3 ID proof requests containing account credential statements.

## 1.1.3

Expand Down
5 changes: 4 additions & 1 deletion packages/browser-wallet/src/background/web3Id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
verifyAtomicStatements,
isAccountCredentialStatement,
IDENTITY_SUBJECT_SCHEMA,
verifyIdstatement,
IdStatement,
} from '@concordium/web-sdk';
import {
sessionVerifiableCredentials,
Expand Down Expand Up @@ -178,7 +180,8 @@ export const runIfValidWeb3IdProof: RunCondition<MessageStatusWrapper<undefined>
// If a statement does not verify, an error is thrown.
statements.every((credStatement) =>
isAccountCredentialStatement(credStatement)
? verifyAtomicStatements(credStatement.statement, IDENTITY_SUBJECT_SCHEMA)
? verifyAtomicStatements(credStatement.statement, IDENTITY_SUBJECT_SCHEMA) &&
verifyIdstatement(credStatement.statement as IdStatement)
: verifyAtomicStatements(credStatement.statement)
);

Expand Down

0 comments on commit 9bc7afb

Please sign in to comment.