From 1892c8bf979ebb759ca8c1f3e454cb659eb75ae5 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Fri, 2 Jun 2006 13:09:59 +0000 Subject: Extend default method string to include public key methods. Add missing prototypes. Fix engine method lookup. --- crypto/evp/pmeth_lib.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'crypto/evp/pmeth_lib.c') diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index 94d04a9b9f..8108d448cb 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -126,9 +126,9 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id) EVPerr(EVP_F_INT_CTX_NEW,ERR_R_ENGINE_LIB); return NULL; } - else - e = ENGINE_get_pkey_meth_engine(id); } + else + e = ENGINE_get_pkey_meth_engine(id); /* If an ENGINE handled this method look it up. Othewise * use internal tables. @@ -143,6 +143,13 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id) return NULL; ret = OPENSSL_malloc(sizeof(EVP_PKEY_CTX)); + if (!ret) + { + if (e) + ENGINE_finish(e); + EVPerr(EVP_F_INT_CTX_NEW,ERR_R_MALLOC_FAILURE); + return NULL; + } ret->engine = e; ret->pmeth = pmeth; ret->operation = EVP_PKEY_OP_UNDEFINED; -- cgit v1.2.3