-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 3 ecdsa-sd-2023 proof value tests (D -> C) #101
base: add-cbor-tests-sd
Are you sure you want to change the base?
Conversation
`Expected VC from issuer ${name} to have an ' + | ||
'"ecdsa-sd-2023" proof`).to.exist; | ||
expect( | ||
proof.proofValue, | ||
`Expected VC from issuer ${name} to have a ' + | ||
'"proof.proofValue"` | ||
).to.exist; | ||
expect( | ||
proof.proofValue, | ||
`Expected VC "proof.proofValue" from issuer ${name} to be ` + | ||
'a string.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either all Expect ...
clauses should end with a fullstop .
, or none should. I prefer the former.
I also note mixed up use of '
and `
. I strongly advise that these be used consistently, especially but not only in any given statement.
I'm not going to make all the suggestions the above would call for, unless you request that I do so. (I'm betting that changes will be needed throughout the documents touched by this PR, and possibly across other documents.)
`Expected VC from issuer ${name} to have an ' + | |
'"ecdsa-sd-2023" proof`).to.exist; | |
expect( | |
proof.proofValue, | |
`Expected VC from issuer ${name} to have a ' + | |
'"proof.proofValue"` | |
).to.exist; | |
expect( | |
proof.proofValue, | |
`Expected VC "proof.proofValue" from issuer ${name} to be ` + | |
'a string.' | |
'Expected VC from issuer ${name} to have an ' + | |
'"ecdsa-sd-2023" proof.').to.exist; | |
expect( | |
proof.proofValue, | |
'Expected VC from issuer ${name} to have a ' + | |
'"proof.proofValue".' | |
).to.exist; | |
expect( | |
proof.proofValue, | |
'Expected VC "proof.proofValue" from issuer ${name} to be ' + | |
'a string.' |
`Expected "proof.proofValue" to start with u received ` + | ||
`${proof.proofValue[0]}`).to.be.true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`Expected "proof.proofValue" to start with u received ` + | |
`${proof.proofValue[0]}`).to.be.true; | |
'Expected "proof.proofValue" to start with u received ' + | |
'${proof.proofValue[0]}.').to.be.true; |
// now test the encoding which is bs64 url no pad for this suite | ||
expect( | ||
shouldBeBs64UrlNoPad(proof.proofValue), | ||
'Expected "proof.proofValue" to be bs64 url no pad encoded.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When aimed at humans, best to use the full string for "bs64 url no pad encoded".
Adds 3 proofValue related tests:
The base proof assertion: "If the decodedProofValue does not start with the ECDSA-SD base proof header bytes 0xd9, 0x5d, and 0x00, an error MUST be raised and SHOULD convey an error type of PROOF_VERIFICATION_ERROR." Is tested by examing the base proof from the issuer. As base proofs are not designed to pass verification the statement from the spec might be incorrect.
"If the decodedProofValue does not start with the ECDSA-SD disclosure proof header bytes 0xd9, 0x5d, and 0x01, an error MUST be raised and SHOULD convey an error type of PROOF_VERIFICATION_ERROR."
The invalid disclosure proof header bytes are
[0xA1, 0x44, 0x01]
and replace the original proof value header bytes. The actual proofValue is left as is and the invalid header bytes are encoded as a base64 url with the prefixu
.Additionally: