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
OopenSSL 1.1.0 compatibility #107
Conversation
tool/yubico-piv-tool.c
Outdated
| /* XXX: this should probably use X509_REQ_digest() but that's buggy */ | ||
| if(!ASN1_item_digest(ASN1_ITEM_rptr(X509_REQ_INFO), md, req->req_info, | ||
| digest + oid_len, &digest_len)) { | ||
| if (!X509_REQ_digest(req, md, digest + oid_len, &digest_len)) { |
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.
Have you tested if this works? The problem with X509_REQ_digest() is (used to be?) that it hashes the entire X509_REQ, ideally I guess there would be a X509_REQ_INFO_digest().
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.
I didn't test this part, but I am not sure if there is an interface in the new OpenSSL to get the req_info from the structure. I will remove this chunk for now.
I planned to do all the changes, but some of the certificate handling was more complex than I was familiar with. Currently dumping what is available for others to have possibility to continue or I will finish that later.
|
The approach of doing this with a compat layer is probably the only way to go ahead. I haven't looked it over to see how many of those would need to be added. |
|
Thank you for prompt comment. There are really only few more changes, but they are probably harder to address than this part in this commit. |
|
I added few more changes I was able to handle. The embedded tests work except the hardware ones (failing even before the change). What is missing is working with I believe that is a good start, but I don't have enough internal knowledge to test further changes to make sure they will not break some use cases. I will build the package against old OpenSSL so far, but having this fixed in future would be very nice. |
|
I was tweaking with it little bit more added the straight-forward parts, but the certificates are still little bit more complicated. From what I see, with opaque structures, it is not possible to do exactly what you were doing in functions On the other hand, the I am pushing a WIP status, that builds with OpenSSL 1.1.0, but for older is still using the same approach. Unfortunately, currently I do not have any capable yubikey at hand to test the actual functionality, so the last commit is for further review/testing, but the idea should be clear. |
… around certificates)
|
Finally my new Yubikey arrived so before setting it up for myself I finished with this PR and made even the HW tests pass with OpenSSL 1.1.0 and hopefully also with the old version (including the rebase to the current master). |
Update 2017-11-14: Resolves #104. Tested with latest Yubikey 4 with hardware tests, provisioning new key and selfsigning certificates.