From 605fa68efaf2ebc891330ed1ae9e5053a2228c1e Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 27 Oct 2017 22:42:04 +0200 Subject: EVP_PKEY_asn1_add0(): Check that this method isn't already registered No two public key ASN.1 methods with the same pkey_id can be registered at the same time. Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/4620) --- crypto/evp/evp_err.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crypto/evp') diff --git a/crypto/evp/evp_err.c b/crypto/evp/evp_err.c index ab4b614026..f5b8635afd 100644 --- a/crypto/evp/evp_err.c +++ b/crypto/evp/evp_err.c @@ -49,6 +49,7 @@ static ERR_STRING_DATA EVP_str_functs[] = { {ERR_FUNC(EVP_F_EVP_PBE_SCRYPT), "EVP_PBE_scrypt"}, {ERR_FUNC(EVP_F_EVP_PKCS82PKEY), "EVP_PKCS82PKEY"}, {ERR_FUNC(EVP_F_EVP_PKEY2PKCS8), "EVP_PKEY2PKCS8"}, + {ERR_FUNC(EVP_F_EVP_PKEY_ASN1_ADD0), "EVP_PKEY_asn1_add0"}, {ERR_FUNC(EVP_F_EVP_PKEY_COPY_PARAMETERS), "EVP_PKEY_copy_parameters"}, {ERR_FUNC(EVP_F_EVP_PKEY_CTX_CTRL), "EVP_PKEY_CTX_ctrl"}, {ERR_FUNC(EVP_F_EVP_PKEY_CTX_CTRL_STR), "EVP_PKEY_CTX_ctrl_str"}, @@ -142,6 +143,8 @@ static ERR_STRING_DATA EVP_str_reasons[] = { {ERR_REASON(EVP_R_OPERATON_NOT_INITIALIZED), "operaton not initialized"}, {ERR_REASON(EVP_R_PARTIALLY_OVERLAPPING), "partially overlapping buffers"}, + {ERR_REASON(EVP_R_PKEY_ASN1_METHOD_ALREADY_REGISTERED), + "pkey asn1 method already registered"}, {ERR_REASON(EVP_R_PRIVATE_KEY_DECODE_ERROR), "private key decode error"}, {ERR_REASON(EVP_R_PRIVATE_KEY_ENCODE_ERROR), "private key encode error"}, {ERR_REASON(EVP_R_PUBLIC_KEY_NOT_RSA), "public key not rsa"}, -- cgit v1.2.3