-
Notifications
You must be signed in to change notification settings - Fork 17
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
DidCommV2 doesn't specify 'typ' #93
Conversation
I didn't test anything so someone needs to figure out how to make this according to the specification. |
@FabioPinheiro Thanks for your contribution! From what I read in the specs, DIDComm may use the |
yes and no I'm basically only removing the check. The line 105 is still there: https://github.com/sicpa-dlab/didcomm-python/pull/93/files#diff-cb2b8c37b8a59e04819d6634da7909e96a364413c241a5a17a33c5e7685a4c1eR105 However, JOSE specs recommends to use We are adding to the content of the encrypted bytes... On the outermost envelope, we can have
protected -> is decoded to But in this implementation If you go to all the 'headers' https://identity.foundation/didcomm-messaging/spec/#message-headers and all the additional headers from the DID Comm extensions So I assume this implementation is unable to decrypt any of the test vectors/examples of the DID Comm v2 Sepc: https://identity.foundation/didcomm-messaging/spec/#appendix-c-test-vectors |
In |
@@ -102,7 +102,7 @@ def as_dict(self) -> dict: | |||
d["from"] = d["frm"] | |||
del d["frm"] | |||
|
|||
d["typ"] = DIDCommMessageTypes.PLAINTEXT.value | |||
d["typ"] = DIDCommMessageTypes.PLAINTEXT.value # this is not part of the official specification |
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.
If this is optional, I would rather leave it here. Not require it, but always put.
if f not in d: | ||
raise MalformedMessageError(MalformedMessageCode.INVALID_PLAINTEXT) | ||
|
||
if d["typ"] != DIDCommMessageTypes.PLAINTEXT.value: |
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.
It is important to delete 'typ' if present, not to make problems later.
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.
Also, if present, I think we should check its value.
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.
I am pro these changes, but we need some improvements in this PR. Can we add some tests?
Closing, because of lack of activity, and it is reimplemented here: #96 |
I only do this in my free time and I had very little time on the last three weekends. But important thing is that it's fixed. But you asked for tests and I was trying to create a test set that everyone could use. Would help us to achieve interoperability at the DID Comm libraries level. If you could contribute with your test set would be nice decentralized-identity/didcomm.org#77 |
No problem Fabio, like you said, it is important that it's fixed now 👍 |
When will there be a release with the fix? |
@FabioPinheiro This will be released as soon as #98 is merged |
DidCommV2 doesn't specify 'typ'
This makes it incompatible with other implementations