-
Notifications
You must be signed in to change notification settings - Fork 133
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
fix(credential-ld): fix Ed25519Signature2020 verification #1166
Conversation
…o bytes, rename util function
* fix(utils): fix typo in key comparison * fix(credential-ld): pre-process DID doc for Ed25519Signature2020 * feat(credential-ld): add more granularity to the documentLoader for DID docs * feat(utils): test multibase/multicoded for ed25519 keys * fix(credential-ld): return correct signature bytes for Ed25519-2020 suite
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.
some comments to help the review
}) | ||
return u8a.fromString(signature) | ||
return base64ToBytes(signature) |
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.
This was the culprit of signature verification failures
} | ||
|
||
// this signature suite requires the document loader to dereference the DID URL | ||
if (didUrl.includes('#') && didUrl !== document.id) { |
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.
This is the workaround for the very strict documentLoader requirements.
972cf74
to
d8e0530
Compare
Nice work getting to the bottom of this! |
What issue is this PR fixing
This fixes the Ed25519Signature2020 signature verification.
What is being changed
This PR fixes several issues with the suite:
@context
andpublicKeyMultibase
to be set on the verification method used for verificationThis PR also cleans the default contexts and adds a
schema.org
@context
as well.Quality
Check all that apply:
pnpm i
,pnpm build
,pnpm test
,pnpm test:browser
locally.closes #1146