-
Notifications
You must be signed in to change notification settings - Fork 135
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
feat(did-comm): add support for some of the AES based content and key encryption algorithms #1180
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## next #1180 +/- ##
==========================================
+ Coverage 84.51% 84.85% +0.33%
==========================================
Files 158 167 +9
Lines 16661 18056 +1395
Branches 1829 2027 +198
==========================================
+ Hits 14081 15321 +1240
- Misses 2580 2735 +155
☔ View full report in Codecov by Sentry. |
f9a64cd
to
49a0671
Compare
@@ -167,7 +167,7 @@ describe('database initial migration tests', () => { | |||
encoding: 'utf-8', | |||
}) | |||
expect(signedMessage).toEqual( | |||
'vzDocUViJh7ooOCZ-jBHKZddEsTa4yClHwhIL9SHJwjAv3bC6TZIcUnX36ZqNBWvLbnNAQvdtzqrVf3l0pv3QQ', |
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.
JWT signing for ES256K now uses canonical signatures, with a low S
value (through the use of @noble/curves
)
This eliminates signature malleability, just like what happens for ethereum signatures, but it also means tests will change.
@@ -403,7 +403,7 @@ export default (testContext: { | |||
hello: 'world', | |||
}, | |||
credentialStatus: { | |||
id: 'override me', | |||
id: 'override:me', |
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.
The latest @transmute
libraries fail if the ID value doesn't look like an IRI
… js-sha3, blakejs
49a0671
to
777ec8f
Compare
What issue is this PR fixing
partially fixes #1083
What is being changed
Most relevant changes are in the did-comm package, where the new capabilities of the
did-jwt@7.2.0
are used to create a wider set of encrypters and logic to pick the proper decrypter too.This PR adds support for
A256KW
key wrapping and forA256GCM
andA256CBC-HS512
content encryption.These can be set as options to
packDIDCommMessage
. Example:There are some corner cases that may require an API review for the packing method:
authcrypt
impliesECDH-1PU
, so specifying anECDH-ES
alg will get overridden.anoncrypt
impliesECDH-ES
so specifying anECDH-1PU
alg will be overridden.The only supported key agreement type for now is
X25519
. Besides supporting other key types, there is one more missing piece to full did-comm v2 compliance:ECDH-1PU
implementation is still using the v3 draft of the spec, while the did-comm spec points to the v4 draft. The diff between the 2 versions suggests they will be incompatible because of thecctag
(section 2.3)Quality
Check all that apply:
pnpm i
,pnpm build
,pnpm test
,pnpm test:browser
locally.Details
This PR brings many seemingly unrelated upgrades but they are necessary due to the complicated dependency tree:
@stablelib/*
dependencies were replaced with@noble/*
where available (similar todid-jwt
)