Fix #69882: OpenSSL error "key values mismatch" after openssl_pkcs12_read with extra certs#1359
Closed
Furgas wants to merge 1 commit intophp:PHP-5.6from
Closed
Fix #69882: OpenSSL error "key values mismatch" after openssl_pkcs12_read with extra certs#1359Furgas wants to merge 1 commit intophp:PHP-5.6from
Furgas wants to merge 1 commit intophp:PHP-5.6from
Conversation
Contributor
|
The test failure doesn't seem to be related to your PR, not sure why you've closed it ;-) |
ext/openssl/openssl.c
Outdated
Contributor
There was a problem hiding this comment.
Use block-style comments, i.e. /* fix for bug 69882 */
Contributor
Author
|
I've closed the one based on PHP-5.6.7. AFAIK you can't change the base branch in Github PR, you must create another one. |
…read with extra certs The "key values mismatch" error is triggered in openssl_pkcs12_read by PKCS12_parse, because it uses X509_check_private_key to separate main certificate (which corresponds to private key) from extra certificates. Extra certificates usually comes first (p12 contents are reversed as stack) and X509_check_private_key triggers X509_R_KEY_VALUES_MISMATCH error. The fix pops "key values mismatch" error from OpenSSL error stack for each extra certificate if there are any.
|
Comment on behalf of datibbaw at php.net: Merged via 2ff3daf Thanks for your contribution! |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "key values mismatch" error is triggered in openssl_pkcs12_read by PKCS12_parse, because it uses X509_check_private_key to separate main certificate (which corresponds to private key) from extra certificates. Extra certificates usually comes first (p12 contents are reversed as stack) and X509_check_private_key triggers X509_R_KEY_VALUES_MISMATCH error.
The fix pops "key values mismatch" error from OpenSSL error stack for each extra certificate if there are any.