diff options
Diffstat (limited to 'crypto/engine/eng_pkey.c')
-rw-r--r-- | crypto/engine/eng_pkey.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/crypto/engine/eng_pkey.c b/crypto/engine/eng_pkey.c index c94c2eacb3..9feb52d83b 100644 --- a/crypto/engine/eng_pkey.c +++ b/crypto/engine/eng_pkey.c @@ -59,26 +59,23 @@ EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, EVP_PKEY *pkey; if (e == NULL) { - ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY, - ERR_R_PASSED_NULL_PARAMETER); + ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER); return 0; } CRYPTO_THREAD_write_lock(global_engine_lock); if (e->funct_ref == 0) { CRYPTO_THREAD_unlock(global_engine_lock); - ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY, ENGINE_R_NOT_INITIALISED); + ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED); return 0; } CRYPTO_THREAD_unlock(global_engine_lock); if (!e->load_privkey) { - ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY, - ENGINE_R_NO_LOAD_FUNCTION); + ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION); return 0; } pkey = e->load_privkey(e, key_id, ui_method, callback_data); if (pkey == NULL) { - ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY, - ENGINE_R_FAILED_LOADING_PRIVATE_KEY); + ERR_raise(ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY); return 0; } return pkey; @@ -90,25 +87,23 @@ EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, EVP_PKEY *pkey; if (e == NULL) { - ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY, - ERR_R_PASSED_NULL_PARAMETER); + ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER); return 0; } CRYPTO_THREAD_write_lock(global_engine_lock); if (e->funct_ref == 0) { CRYPTO_THREAD_unlock(global_engine_lock); - ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY, ENGINE_R_NOT_INITIALISED); + ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED); return 0; } CRYPTO_THREAD_unlock(global_engine_lock); if (!e->load_pubkey) { - ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY, ENGINE_R_NO_LOAD_FUNCTION); + ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION); return 0; } pkey = e->load_pubkey(e, key_id, ui_method, callback_data); if (pkey == NULL) { - ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY, - ENGINE_R_FAILED_LOADING_PUBLIC_KEY); + ERR_raise(ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY); return 0; } return pkey; @@ -121,21 +116,18 @@ int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, { if (e == NULL) { - ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT, - ERR_R_PASSED_NULL_PARAMETER); + ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER); return 0; } CRYPTO_THREAD_write_lock(global_engine_lock); if (e->funct_ref == 0) { CRYPTO_THREAD_unlock(global_engine_lock); - ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT, - ENGINE_R_NOT_INITIALISED); + ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED); return 0; } CRYPTO_THREAD_unlock(global_engine_lock); if (!e->load_ssl_client_cert) { - ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT, - ENGINE_R_NO_LOAD_FUNCTION); + ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION); return 0; } return e->load_ssl_client_cert(e, s, ca_dn, pcert, ppkey, pother, |