-
Notifications
You must be signed in to change notification settings - Fork 44
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
MIC calculation on outgoing AS2 is incorrect when using compress before signing #140
Comments
I think I understand the problem. |
Ok. Quote from RFC 5402, chapter 3
And chapter 4.1. MIC Calculation for Signed Message
|
So it should work with compress BEFORE sign and with compress AFTER sign. But I'm getting a "MIC IS NOT MATCHED; " error whenever I test compress before sign. Is there a reason why this is happening?
Even though the data I'm transferring is the same with all tests? |
To add to this, when testing AS2Lib -> Mendelson. This is what I get:
So it looks like the MIC is calculated the same with No Compression as it is with Compress After Sign. But with Compress Before Sign, the MIC is calculated differently resulting in a different MIC. However when testing AS2Lib -> AS2Lib, the received MIC for Compress Before Sign is the same as the original MIC for No Compression and Compress After Sign. Which makes me believe that it is being calculated incorrectly. |
Thanks for your thorough analysis 👍🏼 |
I checked with the latest version (4.11.0-SNAPSHOT) with my
In all 3 cases the MIC is matched by Mendelson. So my assumption is, that the sending MIC calculation works as expected. But as you mentioned the |
Yes, I believe that's where the issue is occurring. Thank you for taking a look at this issue. Let me know if you need any more information from me to recreate it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Using as2lib as both client and server. When sending a non-compressed, or a compressed after signed file, the MIC for the MDN is matched as MIC: Xc9uKhufeGS/tEPvxjbe9g==, md5
But when using compress before sign, the original MIC is MIC: bMUIBjelUf5Zy+kPrtaMRw==, md5. And the MIC for the MDN is MIC: Xc9uKhufeGS/tEPvxjbe9g==, md5
MIC IS NOT MATCHED; original MIC: bMUIBjelUf5Zy+kPrtaMRw==, md5 received MIC: Xc9uKhufeGS/tEPvxjbe9g==, md5 [<local-20220802-115713-0300-4490@local_ec2Key>]
It seems that within the secure method of the AS2SenderModule, the data is cleared, and the original MIC is calculated with blank data as an input. However the actual as2 message that is sent has the correct data and thus the MDN is sent with the 'correct' MIC
The text was updated successfully, but these errors were encountered: