diff --git a/CHANGELOG.md b/CHANGELOG.md index e1ef223d..16621220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,8 @@ ## 11.1.0 - 2023-TBD ### Changed -- Update `matchProof()` to check if the proof cryptosuite matches along with - proof type for `DataIntegrityProof`. +- Update `matchProof()` to check if proof contains `cryptosuite` and if so, + check if `proof.cryptosuite` matches along with `proof.type`. ## 11.1.0 - 2023-02-07 diff --git a/lib/suites/LinkedDataProof.js b/lib/suites/LinkedDataProof.js index 7067141d..02cb58ed 100644 --- a/lib/suites/LinkedDataProof.js +++ b/lib/suites/LinkedDataProof.js @@ -53,8 +53,8 @@ module.exports = class LinkedDataProof { async matchProof({ proof /*, document, purpose, documentLoader, expansionMap */ }) { - if(proof.type === 'DataIntegrityProof') { - const {type, cryptosuite} = proof; + const {type, cryptosuite} = proof; + if(cryptosuite) { return type === this.type && cryptosuite === this.cryptosuite; } return proof.type === this.type;