Closed daviialvesjr closed 2 years ago
Well we cannot always assume that it is binary as the message could also be base64 encoded. There are a few options:
Message.parse
canonicalize_as_binary
as part of Message.parse
that force treats the message as binary, the idea being that a particular partner will always send in binary and for that partner you can set this argument to TrueLet me know your thoughts @daviialvesjr
cc @chadgates
I'd suggest to extend Partner class with canonicalize_as_binary option and make it configurable in django-pyas2 on a partner level as well.
All right, I'll do it as suggested by @chadgates. Thanks!!
We are receiving a message from IBM Starling. The message is encrypted, signed and compressed. The symptom is that the
self.digest_alg = verify_message(mic_content, signature, verify_cert)
function fails. We realised that thecanonicalize
is not treating the message as binary as it should because of the lack of theContent-Transfer-Encoding
property. Insidecanonicalize
theemail_message
has the following header:Content-Type: application/pkcs7-mime; smime-type=compressed-data; name=smime.p7m
By forcing the message as binary everything works well, however it will probably break other messages. What is the best way to deal with this case?