summaryrefslogtreecommitdiff
path: root/lib/libcrypto/cryptlib.c
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2017-01-29 17:49:24 +0000
committerBob Beck <beck@cvs.openbsd.org>2017-01-29 17:49:24 +0000
commitc95f3b2c0c39020aafaffd84899a33ece0210769 (patch)
tree6d6e55f6c8b4047319196f43823ad30170dfe061 /lib/libcrypto/cryptlib.c
parentb8dd3a8e12bfab2c15794994bc5bdc1397125536 (diff)
Send the function codes from the error functions to the bit bucket,
as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
Diffstat (limited to 'lib/libcrypto/cryptlib.c')
-rw-r--r--lib/libcrypto/cryptlib.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/libcrypto/cryptlib.c b/lib/libcrypto/cryptlib.c
index 8dec9caa93e..1bc245ed0a5 100644
--- a/lib/libcrypto/cryptlib.c
+++ b/lib/libcrypto/cryptlib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptlib.c,v 1.39 2016/11/04 17:30:30 miod Exp $ */
+/* $OpenBSD: cryptlib.c,v 1.40 2017/01/29 17:49:22 beck Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
@@ -210,11 +210,11 @@ CRYPTO_get_new_lockid(char *name)
if ((app_locks == NULL) &&
((app_locks = sk_OPENSSL_STRING_new_null()) == NULL)) {
- CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID, ERR_R_MALLOC_FAILURE);
+ CRYPTOerror(ERR_R_MALLOC_FAILURE);
return (0);
}
if (name == NULL || (str = strdup(name)) == NULL) {
- CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID, ERR_R_MALLOC_FAILURE);
+ CRYPTOerror(ERR_R_MALLOC_FAILURE);
return (0);
}
i = sk_OPENSSL_STRING_push(app_locks, str);
@@ -238,32 +238,28 @@ CRYPTO_get_new_dynlockid(void)
CRYPTO_dynlock *pointer = NULL;
if (dynlock_create_callback == NULL) {
- CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,
- CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK);
+ CRYPTOerror(CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK);
return (0);
}
CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
if ((dyn_locks == NULL) &&
((dyn_locks = sk_CRYPTO_dynlock_new_null()) == NULL)) {
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
- CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,
- ERR_R_MALLOC_FAILURE);
+ CRYPTOerror(ERR_R_MALLOC_FAILURE);
return (0);
}
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
pointer = malloc(sizeof(CRYPTO_dynlock));
if (pointer == NULL) {
- CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,
- ERR_R_MALLOC_FAILURE);
+ CRYPTOerror(ERR_R_MALLOC_FAILURE);
return (0);
}
pointer->references = 1;
pointer->data = dynlock_create_callback(__FILE__, __LINE__);
if (pointer->data == NULL) {
free(pointer);
- CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,
- ERR_R_MALLOC_FAILURE);
+ CRYPTOerror(ERR_R_MALLOC_FAILURE);
return (0);
}