diff options
author | Geoff Thorpe <geoff@openssl.org> | 2001-04-02 17:06:36 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2001-04-02 17:06:36 +0000 |
commit | 3f86a2b147e6f0ed0a149fa48706cbb6d95bb4b8 (patch) | |
tree | 5a47198cd63ee45d6cf6b07e25edf1f884b1184e /crypto | |
parent | fd664b9fc652db503f823a31be4c48ae522d221e (diff) | |
download | openssl-3f86a2b147e6f0ed0a149fa48706cbb6d95bb4b8.tar.gz |
Don't return an error until the global lock is released.
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/engine/engine_lib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/engine/engine_lib.c b/crypto/engine/engine_lib.c index 48c4fb10cb..781494d1a9 100644 --- a/crypto/engine/engine_lib.c +++ b/crypto/engine/engine_lib.c @@ -288,6 +288,7 @@ EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)()) { + int ctrl_exists; if(e == NULL) { ENGINEerr(ENGINE_F_ENGINE_CTRL,ERR_R_PASSED_NULL_PARAMETER); @@ -299,12 +300,13 @@ int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)()) ENGINEerr(ENGINE_F_ENGINE_CTRL,ENGINE_R_NO_REFERENCE); return 0; } - if (!e->ctrl) + ctrl_exists = (e->ctrl ? 1 : 0); + CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); + if (!ctrl_exists) { ENGINEerr(ENGINE_F_ENGINE_CTRL,ENGINE_R_NO_CONTROL_FUNCTION); return 0; } - CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); return e->ctrl(cmd, i, p, f); } |