diff options
author | Richard Levitte <levitte@openssl.org> | 2019-11-18 01:34:26 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-11-29 20:55:16 +0100 |
commit | 866234ac35e665f20c646059b1d92c5e9eb0c7ab (patch) | |
tree | 53cbf9072506794da60fdadc02c8d97676e7f125 /util | |
parent | 1793d270f3c6f6b859e40ef1fa7bea1fd7e447c8 (diff) |
SERIALIZER: add support for serializing EVP_PKEYs
The following public functions is added:
- OSSL_SERIALIZER_CTX_new_by_EVP_PKEY()
- OSSL_SERIALIZER_CTX_set_cipher()
- OSSL_SERIALIZER_CTX_set_passphrase()
- OSSL_SERIALIZER_CTX_set_passphrase_cb()
- OSSL_SERIALIZER_CTX_set_passphrase_ui()
OSSL_SERIALIZER_CTX_new_by_EVP_PKEY() selects a suitable serializer
for the given EVP_PKEY, and sets up the OSSL_SERIALIZER_CTX to
function together with OSSL_SERIALIZER_to_bio() and
OSSL_SERIALIZER_to_fp().
OSSL_SERIALIZER_CTX_set_cipher() indicates what cipher should be used
to produce an encrypted serialization of the EVP_PKEY. This is passed
directly to the provider using OSSL_SERIALIZER_CTX_set_params().
OSSL_SERIALIZER_CTX_set_passphrase() can be used to set a pass phrase
to be used for the encryption. This is passed directly to the
provider using OSSL_SERIALIZER_CTX_set_params().
OSSL_SERIALIZER_CTX_set_passphrase_cb() and
OSSL_SERIALIZER_CTX_set_passphrase_ui() sets up a callback to be used
to prompt for a passphrase. This is stored in the context, and is
called via an internal intermediary at the time of serialization.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10394)
Diffstat (limited to 'util')
-rw-r--r-- | util/libcrypto.num | 6 | ||||
-rw-r--r-- | util/missingcrypto.txt | 1 | ||||
-rw-r--r-- | util/other.syms | 6 |
3 files changed, 13 insertions, 0 deletions
diff --git a/util/libcrypto.num b/util/libcrypto.num index cc94d580cd..d83f675f53 100644 --- a/util/libcrypto.num +++ b/util/libcrypto.num @@ -4894,3 +4894,9 @@ OSSL_SERIALIZER_CTX_free ? 3_0_0 EXIST::FUNCTION: OSSL_SERIALIZER_properties ? 3_0_0 EXIST::FUNCTION: OSSL_SERIALIZER_to_bio ? 3_0_0 EXIST::FUNCTION: OSSL_SERIALIZER_to_fp ? 3_0_0 EXIST::FUNCTION:STDIO +OSSL_SERIALIZER_CTX_new_by_EVP_PKEY ? 3_0_0 EXIST::FUNCTION: +OSSL_SERIALIZER_CTX_set_cipher ? 3_0_0 EXIST::FUNCTION: +OSSL_SERIALIZER_CTX_set_passphrase ? 3_0_0 EXIST::FUNCTION: +OSSL_SERIALIZER_CTX_set_passphrase_cb ? 3_0_0 EXIST::FUNCTION: +OSSL_SERIALIZER_CTX_set_passphrase_ui ? 3_0_0 EXIST::FUNCTION: +ERR_load_OSSL_SERIALIZER_strings ? 3_0_0 EXIST::FUNCTION: diff --git a/util/missingcrypto.txt b/util/missingcrypto.txt index 00b76abae5..6de82cfc21 100644 --- a/util/missingcrypto.txt +++ b/util/missingcrypto.txt @@ -455,6 +455,7 @@ ERR_load_PKCS12_strings ERR_load_PKCS7_strings ERR_load_RAND_strings ERR_load_RSA_strings +ERR_load_OSSL_SERIALIZER_strings ERR_load_TS_strings ERR_load_UI_strings ERR_load_X509V3_strings diff --git a/util/other.syms b/util/other.syms index 080244c54e..e07471f9ab 100644 --- a/util/other.syms +++ b/util/other.syms @@ -370,6 +370,12 @@ OSSL_PARAM_utf8_string define OSSL_PARAM_get_TYPE generic OSSL_PARAM_END define OSSL_PARAM_set_TYPE generic +OSSL_SERIALIZER_PUBKEY_TO_PEM_PQ define +OSSL_SERIALIZER_PrivateKey_TO_PEM_PQ define +OSSL_SERIALIZER_Parameters_TO_PEM_PQ define +OSSL_SERIALIZER_PUBKEY_TO_TEXT_PQ define +OSSL_SERIALIZER_PrivateKey_TO_TEXT_PQ define +OSSL_SERIALIZER_Parameters_TO_TEXT_PQ define PEM_FLAG_EAY_COMPATIBLE define PEM_FLAG_ONLY_B64 define PEM_FLAG_SECURE define |