summaryrefslogtreecommitdiffstats
path: root/crypto/evp/names.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-02-10 13:59:15 +0000
committerMatt Caswell <matt@openssl.org>2016-02-10 17:40:59 +0000
commit0fc32b0718ec210e03b6d8623d4819ed04615a1b (patch)
tree9491a02a740d05b415790bcfeb16eb65f6a06267 /crypto/evp/names.c
parent8bd8221be80708825ddb9771d4c9fff67860119b (diff)
The new init functions can now fail so shouldn't be void
The new init functions can fail if the library has already been stopped. We should be able to indicate failure with a 0 return value. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/evp/names.c')
-rw-r--r--crypto/evp/names.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/evp/names.c b/crypto/evp/names.c
index f6e5004471..2a5606b040 100644
--- a/crypto/evp/names.c
+++ b/crypto/evp/names.c
@@ -110,7 +110,8 @@ const EVP_CIPHER *EVP_get_cipherbyname(const char *name)
{
const EVP_CIPHER *cp;
- OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL);
+ if (!OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL))
+ return NULL;
cp = (const EVP_CIPHER *)OBJ_NAME_get(name, OBJ_NAME_TYPE_CIPHER_METH);
return (cp);
@@ -120,7 +121,8 @@ const EVP_MD *EVP_get_digestbyname(const char *name)
{
const EVP_MD *cp;
- OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
+ if (!OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL))
+ return NULL;
cp = (const EVP_MD *)OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
return (cp);
@@ -166,6 +168,7 @@ void EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph,
{
struct doall_cipher dc;
+ /* Ignore errors */
OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL);
dc.fn = fn;
@@ -179,6 +182,7 @@ void EVP_CIPHER_do_all_sorted(void (*fn) (const EVP_CIPHER *ciph,
{
struct doall_cipher dc;
+ /* Ignore errors */
OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL);
dc.fn = fn;
@@ -207,6 +211,7 @@ void EVP_MD_do_all(void (*fn) (const EVP_MD *md,
{
struct doall_md dc;
+ /* Ignore errors */
OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
dc.fn = fn;