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
Fix PEM_write_bio_PrivateKey_traditional() to not output PKCS#8 #12728
Closed
levitte
wants to merge
3
commits into
openssl:master
from
levitte:fix-PEM_write_bio_PrivateKey_traditional-1
Closed
Fix PEM_write_bio_PrivateKey_traditional() to not output PKCS#8 #12728
levitte
wants to merge
3
commits into
openssl:master
from
levitte:fix-PEM_write_bio_PrivateKey_traditional-1
Conversation
This file contains 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
PEM_write_bio_PrivateKey_traditional() uses i2d_PrivateKey() to do the actual encoding to DER. However, i2d_PrivateKey() is a generic function that will do what it can to produce output according to what the associated EVP_PKEY_ASN1_METHOD offers. If that method offers a function 'old_priv_encode', which is expected to produce the "traditional" encoded form, then i2d_PrivateKey() uses that. If not, i2d_PrivateKey() will go on and used more modern methods, which are all expected to produce PKCS#8. To ensure that PEM_write_bio_PrivateKey_traditional() never produces more modern encoded forms, an extra check that 'old_priv_encode' is non-NULL is added. If it is NULL, an error is returned.
levitte
added
branch: master
Merge to master branch
approval: review pending
This pull request needs review by a committer
branch: 1.1.1
Merge to OpenSSL_1_1_1-stable branch
labels
Aug 27, 2020
A backport to 1.1.1 will come in a separate PR |
Backport to 1.1.1 in #12729 |
... and with this, we discover that not all of our |
…ional() - test/endecode_test.c
t8m
approved these changes
Aug 27, 2020
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.
Approved if CI passes.
t8m
added
approval: done
This pull request has the required number of approvals
and removed
approval: review pending
This pull request needs review by a committer
branch: 1.1.1
Merge to OpenSSL_1_1_1-stable branch
labels
Aug 27, 2020
openssl-machine
removed
the
approval: done
This pull request has the required number of approvals
label
Aug 28, 2020
This pull request is ready to merge |
openssl-machine
added
the
approval: ready to merge
The 24 hour grace period has passed, ready to merge
label
Aug 28, 2020
openssl-machine
pushed a commit
that referenced
this pull request
Aug 28, 2020
PEM_write_bio_PrivateKey_traditional() uses i2d_PrivateKey() to do the actual encoding to DER. However, i2d_PrivateKey() is a generic function that will do what it can to produce output according to what the associated EVP_PKEY_ASN1_METHOD offers. If that method offers a function 'old_priv_encode', which is expected to produce the "traditional" encoded form, then i2d_PrivateKey() uses that. If not, i2d_PrivateKey() will go on and used more modern methods, which are all expected to produce PKCS#8. To ensure that PEM_write_bio_PrivateKey_traditional() never produces more modern encoded forms, an extra check that 'old_priv_encode' is non-NULL is added. If it is NULL, an error is returned. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from #12728)
openssl-machine
pushed a commit
that referenced
this pull request
Aug 28, 2020
…ional() - test/endecode_test.c Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from #12728)
swenkeratmicrosoft
pushed a commit
to swenkeratmicrosoft/openssl
that referenced
this pull request
Sep 1, 2020
PEM_write_bio_PrivateKey_traditional() uses i2d_PrivateKey() to do the actual encoding to DER. However, i2d_PrivateKey() is a generic function that will do what it can to produce output according to what the associated EVP_PKEY_ASN1_METHOD offers. If that method offers a function 'old_priv_encode', which is expected to produce the "traditional" encoded form, then i2d_PrivateKey() uses that. If not, i2d_PrivateKey() will go on and used more modern methods, which are all expected to produce PKCS#8. To ensure that PEM_write_bio_PrivateKey_traditional() never produces more modern encoded forms, an extra check that 'old_priv_encode' is non-NULL is added. If it is NULL, an error is returned. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from openssl#12728)
swenkeratmicrosoft
pushed a commit
to swenkeratmicrosoft/openssl
that referenced
this pull request
Sep 1, 2020
…ional() - test/endecode_test.c Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from openssl#12728)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
approval: ready to merge
The 24 hour grace period has passed, ready to merge
branch: master
Merge to master branch
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.
PEM_write_bio_PrivateKey_traditional() uses i2d_PrivateKey() to do the
actual encoding to DER. However, i2d_PrivateKey() is a generic
function that will do what it can to produce output according to what
the associated EVP_PKEY_ASN1_METHOD offers. If that method offers a
function 'old_priv_encode', which is expected to produce the
"traditional" encoded form, then i2d_PrivateKey() uses that. If not,
i2d_PrivateKey() will go on and used more modern methods, which are
all expected to produce PKCS#8.
To ensure that PEM_write_bio_PrivateKey_traditional() never produces
more modern encoded forms, an extra check that 'old_priv_encode' is
non-NULL is added. If it is NULL, an error is returned.