diff options
author | Paul Yang <yang.yang@baishancloud.com> | 2017-09-11 23:15:55 +0800 |
---|---|---|
committer | Paul Yang <yang.yang@baishancloud.com> | 2017-09-14 12:41:34 +0800 |
commit | 0822e89addcb8c6b8a135a54a503a429efbe0dbe (patch) | |
tree | d9bcd486c0ac11e5f265011b7134c1b1ff2aac03 /crypto | |
parent | 76b2ae832679d25e6952934481ac38e0e76e2271 (diff) |
Support EVP_PKEY_meth_remove and pmeth internal cleanup
1. make app pkey methods cleanup internal
2. add EVP_PKEY_meth_remove
Fixes travis-ci failure in #4337
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4356)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/evp/names.c | 2 | ||||
-rw-r--r-- | crypto/evp/pmeth_lib.c | 15 | ||||
-rw-r--r-- | crypto/include/internal/evp_int.h | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/crypto/evp/names.c b/crypto/evp/names.c index 41c3ceee3a..11905690b8 100644 --- a/crypto/evp/names.c +++ b/crypto/evp/names.c @@ -90,6 +90,8 @@ void evp_cleanup_int(void) EVP_PBE_cleanup(); OBJ_sigid_free(); + + evp_app_cleanup_int(); } struct doall_cipher { diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index c62bd81da4..2b9b8a92f8 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -296,6 +296,21 @@ int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth) return 1; } +void evp_app_cleanup_int(void) +{ + if (app_pkey_methods != NULL) + sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free); +} + +int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth) +{ + const EVP_PKEY_METHOD *ret; + + ret = sk_EVP_PKEY_METHOD_delete_ptr(app_pkey_methods, pmeth); + + return ret == NULL ? 0 : 1; +} + size_t EVP_PKEY_meth_get_count(void) { size_t rv = OSSL_NELEM(standard_methods); diff --git a/crypto/include/internal/evp_int.h b/crypto/include/internal/evp_int.h index b9558a60d4..ccfa97ce35 100644 --- a/crypto/include/internal/evp_int.h +++ b/crypto/include/internal/evp_int.h @@ -393,6 +393,7 @@ struct evp_pkey_st { void openssl_add_all_ciphers_int(void); void openssl_add_all_digests_int(void); void evp_cleanup_int(void); +void evp_app_cleanup_int(void); /* Pulling defines out of C soure files */ |