summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/engine/eng_init.c
diff options
context:
space:
mode:
authorbeck <>2017-01-29 17:49:23 +0000
committerbeck <>2017-01-29 17:49:23 +0000
commit957b11334a7afb14537322f0e4795b2e368b3f59 (patch)
tree1a54abba678898ee5270ae4f3404a50ee9a92eea /src/lib/libcrypto/engine/eng_init.c
parentdf96e020e729c6c37a8c7fe311fdd1fe6a8718c5 (diff)
downloadopenbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.gz
openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.bz2
openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.zip
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 'src/lib/libcrypto/engine/eng_init.c')
-rw-r--r--src/lib/libcrypto/engine/eng_init.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/libcrypto/engine/eng_init.c b/src/lib/libcrypto/engine/eng_init.c
index b50e22594c..75d6698c70 100644
--- a/src/lib/libcrypto/engine/eng_init.c
+++ b/src/lib/libcrypto/engine/eng_init.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_init.c,v 1.7 2015/02/11 03:19:37 doug Exp $ */ 1/* $OpenBSD: eng_init.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -106,8 +106,7 @@ engine_unlocked_finish(ENGINE *e, int unlock_for_handlers)
106 106
107 /* Release the structural reference too */ 107 /* Release the structural reference too */
108 if (!engine_free_util(e, 0)) { 108 if (!engine_free_util(e, 0)) {
109 ENGINEerr(ENGINE_F_ENGINE_UNLOCKED_FINISH, 109 ENGINEerror(ENGINE_R_FINISH_FAILED);
110 ENGINE_R_FINISH_FAILED);
111 return 0; 110 return 0;
112 } 111 }
113 return to_return; 112 return to_return;
@@ -120,7 +119,7 @@ ENGINE_init(ENGINE *e)
120 int ret; 119 int ret;
121 120
122 if (e == NULL) { 121 if (e == NULL) {
123 ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_PASSED_NULL_PARAMETER); 122 ENGINEerror(ERR_R_PASSED_NULL_PARAMETER);
124 return 0; 123 return 0;
125 } 124 }
126 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); 125 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
@@ -136,14 +135,14 @@ ENGINE_finish(ENGINE *e)
136 int to_return = 1; 135 int to_return = 1;
137 136
138 if (e == NULL) { 137 if (e == NULL) {
139 ENGINEerr(ENGINE_F_ENGINE_FINISH, ERR_R_PASSED_NULL_PARAMETER); 138 ENGINEerror(ERR_R_PASSED_NULL_PARAMETER);
140 return 0; 139 return 0;
141 } 140 }
142 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); 141 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
143 to_return = engine_unlocked_finish(e, 1); 142 to_return = engine_unlocked_finish(e, 1);
144 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); 143 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
145 if (!to_return) { 144 if (!to_return) {
146 ENGINEerr(ENGINE_F_ENGINE_FINISH, ENGINE_R_FINISH_FAILED); 145 ENGINEerror(ENGINE_R_FINISH_FAILED);
147 return 0; 146 return 0;
148 } 147 }
149 return to_return; 148 return to_return;