You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Added missing support for S/MIME envloped signing #252
I have troubles getting the content of an email that is encrypted and signed (see attachment). The email itself only contains one smime.p7m attachment.
Hi, my apologies for the late reply, but I'm currently unable to look into this as I have recently become father to our second child. Takes rather lot of attention I'm finding out. On top of that, the topic here is rather complicated and needs some proper debugging and research.
I'm always open to suggestions and pull requests though. Sorry I don't have better news for the moment...
Unless you provide the private key along with the encrypted email, I can't do a root-cause analysis. The sample emails included in Simple Java Mail's tests all work fine, so I have no clue what can go wrong.
Can you provide the private key, perhaps email it to me directly so I can analyse (I won't publish it in the GIT repo). That would be of great help.
I have been provided with a matching keystore and have been analysing the issue. It turns out that S/MIME support was incomplete for the backwards compatible legacy signing protocol: Content-Type: application/x-pkcs7-mime; name=smime.p7m; smime-type=signed-data. Nowadays signing is done using certificate added to an attachment, but legacy style is that the entire attachment content is wrapped similarly to how encrypted content still is wrapped (enveloped content).
I've fixed the support (that was pretty complex!), but I've got it working nicely now. Wrapping up on the code quality and then I'll be shipping out a new release...
Activity
bbottema commentedon Jun 3, 2020
Hi, my apologies for the late reply, but I'm currently unable to look into this as I have recently become father to our second child. Takes rather lot of attention I'm finding out. On top of that, the topic here is rather complicated and needs some proper debugging and research.
I'm always open to suggestions and pull requests though. Sorry I don't have better news for the moment...
bbottema commentedon Jul 12, 2020
When I open this file in Thunderbird, I don't see any attachments...
cgruber0 commentedon Jul 13, 2020
If you look at the content of the file (email.txt) you can see a Content-Disposition: attachment; filename="smime.p7m" part.
That's the actual content (= text) of the email. But it's encrypted.
Thunderbird is able to decrypt the email without problems and shows the content (private key provided). The library is not.
You can understand the problem now?
bbottema commentedon Jul 19, 2020
Unless you provide the private key along with the encrypted email, I can't do a root-cause analysis. The sample emails included in Simple Java Mail's tests all work fine, so I have no clue what can go wrong.
Can you provide the private key, perhaps email it to me directly so I can analyse (I won't publish it in the GIT repo). That would be of great help.
bbottema commentedon Jul 24, 2020
I have been provided with a matching keystore and have been analysing the issue. It turns out that S/MIME support was incomplete for the backwards compatible legacy signing protocol:
Content-Type: application/x-pkcs7-mime; name=smime.p7m; smime-type=signed-data. Nowadays signing is done using certificate added to an attachment, but legacy style is that the entire attachment content is wrapped similarly to how encrypted content still is wrapped (enveloped content).I've fixed the support (that was pretty complex!), but I've got it working nicely now. Wrapping up on the code quality and then I'll be shipping out a new release...
#252: Fix support for legacy S/MIME signing envelope
[-]Decrypting smime.p7m attachments[/-][+]Added missing support for S/MIME envloped signing[/+]bbottema commentedon Jul 26, 2020
Fix released in 6.4.1. Again, greatly appreciate your trust, I could not have analysed and fixed this without it!