Make PrivateKey loading libctx aware#11494
Make PrivateKey loading libctx aware#11494mattcaswell wants to merge 9 commits intoopenssl:masterfrom
Conversation
crypto/evp/evp_pkey.c
Outdated
There was a problem hiding this comment.
So while you're making new public functions out of the others, this one you're making internal... it seems inconsistent, wanna tell me why?
There was a problem hiding this comment.
It wasn't clear to me whether we wanted to encourage the use of EVP_PKCS82PKEY or not. While I wasn't sure I erred on the side of caution thinking it was easier to make things public later than the other way around.
ed1c8ed to
7d154a8
Compare
|
Fixup pushed addressing the comment above. I also rebased to resolve a conflict with master. Please look again. |
|
travis error is relevant.. include/openssl/pem.h:353:34: error: unknown type name 'FILE' |
7d154a8 to
bfbc677
Compare
|
I've rebased this and pushed a fixup to (hopefully) resolve the travis issue. Please take another look. |
The Ed448 private key decoding makes algorithm fetches. Therefore we teach d2i_PrivateKey et al about libctx and make sure it is passed through the layers.
The Ed448 private key deconding needs to use a library ctx. So we implement a priv_decode_with_libctx function for it.
We restrict this to just the PrivateKey loading code at the moment.
Now that d2i_PrivateKey_ex() and other similar functions exist we should use it when loading a PEM PrivateKey.
Since loading a private key might require algorithm fetches we should make sure the correct libctx is used.
bfbc677 to
93be520
Compare
|
Rebased again to fix conflicts with master. Also another fix up to address travis issues. Ping? |
|
This pull request is ready to merge |
|
Pushed. Thanks. |
The Ed448 private key decoding makes algorithm fetches. Therefore we teach d2i_PrivateKey et al about libctx and make sure it is passed through the layers. Reviewed-by: Shane Lontis <[email protected]> (Merged from #11494)
The Ed448 private key deconding needs to use a library ctx. So we implement a priv_decode_with_libctx function for it. Reviewed-by: Shane Lontis <[email protected]> (Merged from #11494)
We restrict this to just the PrivateKey loading code at the moment. Reviewed-by: Shane Lontis <[email protected]> (Merged from #11494)
Now that d2i_PrivateKey_ex() and other similar functions exist we should use it when loading a PEM PrivateKey. Reviewed-by: Shane Lontis <[email protected]> (Merged from #11494)
Since loading a private key might require algorithm fetches we should make sure the correct libctx is used. Reviewed-by: Shane Lontis <[email protected]> (Merged from #11494)
Reviewed-by: Shane Lontis <[email protected]> (Merged from #11494)
|
Do you have more PR's that you are about to merge? libcrypto.num is a bit of a problem. |
During loading of a private key it is possible that the implementation will need to use a cryptographic algorithm Notably in decoding an Ed448 private key we automatically derive the public key (because it is not encoded along with the private key). To do so we need to use SHAKE256. This means that we have to make the private key loading functions OPENSSL_CTX aware.
We also update libssl to use the new private key loading functions.
This is needed for alpha1