-
Notifications
You must be signed in to change notification settings - Fork 782
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document and test PEM_X509_INFO_read_bio's odd decryption behavior
PEM_X509_INFO_read_bio is weird. It decrypts certificates and CRLs, but not private keys. We had some comments just saying we were trying to preserve historical (untested) behavior, but I think I've figured out why. It's so you can inspect a bundle of certs + encrypted keys without knowing the password. Attempting but failing to decrypt is fatal. On the flip side, this means that you cannot use this to decrypt the private key even if you wanted to! This was probably a mistake in SSLeay, but probably not worth fixing since this function's grouping behavior doesn't handle certificate chains right anyway. But we should at least document and test the intended behavior. This tests that encrypted private keys are left as placeholders, though I haven't filled in an encrypted certificate or CRL. (The main nuisance there is assembling a test input because OpenSSL's APIs don't even let you make them.) Bug: 387737061 Change-Id: Iebcafdba4924bbcb6298bde24013a508aecc716a Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/74810 Reviewed-by: Adam Langley <[email protected]> Commit-Queue: David Benjamin <[email protected]>
- Loading branch information
Showing
3 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
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
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
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