diff options
Diffstat (limited to 'crypto/dsa')
-rw-r--r-- | crypto/dsa/dsa_lib.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c index 1b33705f46..48b228f3a1 100644 --- a/crypto/dsa/dsa_lib.c +++ b/crypto/dsa/dsa_lib.c @@ -146,17 +146,24 @@ DSA *DSA_new_method(ENGINE *engine) DSAerr(DSA_F_DSA_NEW,ERR_R_MALLOC_FAILURE); return(NULL); } - if(engine) - ret->engine = engine; + + if (engine) + { + if(ENGINE_init(engine)) + ret->engine = engine; + else + ret->engine = NULL; + } else + ret->engine=ENGINE_get_default_DSA(); + + if(ret->engine == NULL) { - if((ret->engine=ENGINE_get_default_DSA()) == NULL) - { - DSAerr(DSA_F_DSA_NEW,ERR_LIB_ENGINE); - OPENSSL_free(ret); - return NULL; - } + DSAerr(DSA_F_DSA_NEW,ERR_LIB_ENGINE); + OPENSSL_free(ret); + return NULL; } + meth = ENGINE_get_DSA(ret->engine); ret->pad=0; ret->version=0; |