-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Openssl 1.1.0 support for 7.0 #2438
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
Conversation
Btw. I see few fails on my 7.0 build with OpenSSL 1.1 but I see them also with 7.1 so I will take a look on them together later. |
/* {{{ php_openssl_pkey_init_dsa */ | ||
zend_bool php_openssl_pkey_init_dsa(DSA *dsa) | ||
zend_bool php_openssl_pkey_init_dsa(DSA *dsa, zval *data) |
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'd suggest not to change signatures in this and similar cases. Reason - the visibility with at least gcc makes such functions visible, so there might be possible breakage. With later versions like master, such functions should be marked as static, so any arbitrary change won't for sure affect the outer world. Probably same would concern the newly introduced ones like php_openssl_pkey_init_and_assign_rsa().
Thanks.
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.
Do we really need to be so strict? That function is not in any header and even marked as API one (meaning not exported on win). Someone would have to copy the signature which seems very unlikely to me considering that I think I added that function in 7.0 as part of one bugfix. I agree that they should be marked as static. It was my omission but I still don't think it needs to be considered as part of the ABI. Anyway if you think there might be some breakage, I will keep the old one around and rename this one but it will be inconsistent with 7.1...
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.
Yeah, i see that, just it was a possible issue that i saw. I've mentioned gcc in particular, as some might willingly misuse the default visibility :) Didn't check it were not in the header, in that case we should be fine to have the signature change as in the patch. I see no other potential issues, so it's now only about to test and to get some feedback.
Thanks.
@bukka, currently looks good to me. The patch doesn't breach any structures, and it's even better. Probably even if it would, it wouldn't matter much, as the possible dependencies have to depend on OpenSSL 1.1 as well. It were to double check, whether there is yet some other place in the core to support the newer OpenSSL version. Probably ext/ftp depends on it directly, others like ext/pgsql seem only to depend on what the corresponding lib provides. Also not sure about Windows side. Probably it can be ignored there, as our default build and all the dependencies are based on OpenSSL 1.0.2 in all the stable branches. It'd only be useful if someone really rebuilds all the stuff depending on 1.1, which is possible but unlikely. Since last week OpenSSL 1.1 dependent deps was placed for AppVeyor and snaps, so it'll be only supported officially starting with PHP 7.2 on Widows side. I'll have time to test by the end of the week. Feedback from yet anyone interested would be great. @remicollet, poke. Thanks. |
@bukka i came earlier to it, so could already test the main part. The current test with OpenSSL 1.0.1 shows no regressions. Yet to test the dependent exts - ftp and possibly some other. With 1.1 i've got these failing OpenSSL private key functions [ext/openssl/tests/001.phpt] We've already discussed the SNI one on ML, probably. The others might be worth investigating anyway, as 7.1 supports this OpenSSL version as well. Whereby the most important thing is, that there are no issues with OpenSSL 1.0. As for me, the status is good so far. I'll come back later after i made some further tests. Thanks. |
This reverts commit 015a80e.
7ddf3b1
to
da42399
Compare
@weltling I have just done further testing with all supported versions and fixed all issues (was failing only with 0.9.8). The tests that you mention are exactly the ones that I plan to look at after this is merged. It will be empty merge for 7.1 so don't want to do it in here. This is just to make it the same as it is in 7.1. I think that it's good to go. Are you ok if I merge it tomorrow or do you plan to do more testing? |
@bukka i couldn't come to additional tests after my last message, unfortunately. Hope i can do more the coming week. It should be ok to merge into dev next week, yes, please squash before merging. And still it'd be great if @remicollet could check, too. Thanks. |
if (!cipher_ctx) { | ||
php_error_docref(NULL, E_WARNING, "Failed to create cipher context"); | ||
RETURN_FALSE; | ||
} |
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.
memleak on outbuf ?
Shouldn't this test move above, before allocation ?
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.
Yep, outbuf leaked, easy to fix before merge.
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.
Should be fixed ;)
Test build (7.0.18RC1 + this patch) Fedora 25 (OpenSSL 1.0.2k) = > Test suite passes. Fedora 25 (Openssl 1.1.0e) => 4 failed test
I think 3 are fixed in 7.1, so only need some cherry-pick, sni_server.phpt also fails in 7.1 |
So looks like it's good to go :) Thanks for the check, @remicollet. |
I just double checked and I see I missed the private key related tests in your info. The reason why I missed them is that I have got a bit different setting for OpenSSL. Basically I have a custom build without using system openssl.cnf and it seems that those tests are dependent on it which is not right of course. For example if I use this one: I don't see the fails that you both do for 001 and openssl_free_key so I think that the tests are broken actually and they need a look. I think it would be much better to use the same cnf for all tests (e.g. using @remicollet I'm actually interested about your openssl.cnf that you used as it could be a bug in this patch if it's fine for 7.1 and failing for 7.0? |
Here is the Fedora 26 default openssl.cnf file
|
I think you need to cherry-pick, from 7.1 |
It makes the test work with OpenSSL 1.1
@remicollet Thanks. I cherry picked all suggested commits so I think it's good to go if you or @weltling don't see any other issues? |
@bukka no issues from my side. There'll be yet a couple of weeks and the next RC for the close checks. Thanks. |
Ok for me (perhaps should squash all not cherry-picked commit to have a clean history). |
Yeah, as a single commit, please :) Thanks. |
This was merged in cdc3325 |
This is a backport and some 7.0 specific ports for OpenSSL 1.1 support.
@weltling Are you ok with that for 7.0 branch? The reason for that is that some distros already applies their own patches just to support OpenSSL 1.1 so this will prevent further diversion. In addition it unifies the code base for openssl ext so it is easier to write fixes for some parts (mainly current pkey bugs) that diverged between 7.0 and 7.1 (I mean I don't have to write it twice if I want to fix it in 7.0...)