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 /crypto/err | |
parent | 1793d270f3c6f6b859e40ef1fa7bea1fd7e447c8 (diff) | |
download | openssl-new-866234ac35e665f20c646059b1d92c5e9eb0c7ab.tar.gz |
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 'crypto/err')
-rw-r--r-- | crypto/err/err.c | 1 | ||||
-rw-r--r-- | crypto/err/openssl.txt | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c index 0fb46bef4d..e77cfe83cf 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -113,6 +113,7 @@ static ERR_STRING_DATA ERR_str_reasons[] = { {ERR_R_INIT_FAIL, "init fail"}, {ERR_R_OPERATION_FAIL, "operation fail"}, {ERR_R_INVALID_PROVIDER_FUNCTIONS, "invalid provider functions"}, + {ERR_R_INTERRUPTED_OR_CANCELLED, "interrupted or cancelled"}, {0, NULL}, }; diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt index b103f8605b..8febc5c210 100644 --- a/crypto/err/openssl.txt +++ b/crypto/err/openssl.txt @@ -2550,6 +2550,7 @@ OCSP_R_STATUS_TOO_OLD:127:status too old OCSP_R_UNKNOWN_MESSAGE_DIGEST:119:unknown message digest OCSP_R_UNKNOWN_NID:120:unknown nid OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE:129:unsupported requestorname type +OSSL_SERIALIZER_R_INCORRECT_PROPERTY_QUERY:100:incorrect property query OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE:107:ambiguous content type OSSL_STORE_R_BAD_PASSWORD_READ:115:bad password read OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC:113:error verifying pkcs12 mac |