-
Notifications
You must be signed in to change notification settings - Fork 8
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
Added support for RFC5652 types of MS countersignatures (#16) #17
Conversation
It seems that some (maybe newer) MS countersignatures are not PKCS7 per RFC2315 but rather CMS structures defined by RFC5652. Unfortunately, PKCS7_* family of OpenSSL functions is not able to handle it, but there are CMS_* functions which are. They however do not provide same set of functions to do the same things as with PKCS7 structures. This PR adds possibility to fall back to CMS if PKCS7 fails. Some functions had to be simulated and therefore might not be *that* accurate but just from testing on a few files, it seems to validate them correctly. But it might need a tuning in the future if we test it on a more extensive set of samples.
3368279
to
b6b9bf3
Compare
8785e93
to
d14a974
Compare
b17f59a
to
2aac779
Compare
369404b
to
8a03bda
Compare
8a03bda
to
01b1de1
Compare
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.
Thanks a lot for the feature, I've got a bit confused and slowed down while reading the macros, but after a while it reads fine and seems kind of neat.
I've added a test case with some dev scripts to ease up writing tests. I've also updated the CI to use proper versions 1.1 and 3.0, as the machines and packages got updated and they all used 3+. The project also uses .clang-format for formatting and I've reformated the newly added code for consistency.
It seems that some (maybe newer) MS countersignatures are not PKCS7 per RFC2315 but rather CMS structures defined by RFC5652. Unfortunately, PKCS7_* family of OpenSSL functions is not able to handle it, but there are CMS_* functions which are. They however do not provide same set of functions to do the same things as with PKCS7 structures.
This PR adds possibility to fall back to CMS if PKCS7 fails. Some functions had to be simulated and therefore might not be that accurate but just from testing on a few files, it seems to validate them correctly. But it might need a tuning in the future if we test it on a more extensive set of samples.