abhishek-ram / pyas2

This repo is no longer maintained and has been moved to https://github.com/abhishek-ram/django-pyas2
GNU General Public License v2.0
47 stars 23 forks source link

Binary payload #26

Closed fredy2015 closed 6 years ago

fredy2015 commented 8 years ago

Hi,

At the moment, we can't use pyas2 with one of our client because signing failed with binary payload. Is Could you implement binary payload?

Thanks

abhishek-ram commented 8 years ago

Can you please elaborate as to what is the error that you are getting and so on.

Vio-san commented 8 years ago

I believe it's related to \r\n canonicalization within MIME message. According to RFC3851 and RFC5751 for binary data that can not be canonicalized due to data modification related to it you need to utilize 7bit compatible encoding like base64. It can be solved by having a checkbox in partner settings with a name like "Is it safe to perform canonicalization?" and according to RFC should be based on an agreement between organization and partner. In this way, it will not conflict with RFC3851. Another option is to have complex canonicalization algorithm that will canonicalize only headers for the document part and full content for the signature and encrypted data.

abhishek-ram commented 8 years ago

AS2 was never meant for transferring binary payload so I never factored this in when I developed pyas2. The current process is very convoluted so I have started working on a separate project which only handles building/parsing the MIME messages. I will test there with binary payloads and see what will be the result.