summaryrefslogtreecommitdiffstats
path: root/crypto/evp/pmeth_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-06-02 13:09:59 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-06-02 13:09:59 +0000
commit1892c8bf979ebb759ca8c1f3e454cb659eb75ae5 (patch)
tree313cecf30f31e03a7903896c4c8006240c80f319 /crypto/evp/pmeth_lib.c
parent5e428e7d0d53522e82a1eb6e418de8b7138e4cda (diff)
Extend default method string to include public key methods.
Add missing prototypes. Fix engine method lookup.
Diffstat (limited to 'crypto/evp/pmeth_lib.c')
-rw-r--r--crypto/evp/pmeth_lib.c11
1 files changed, 9 insertions, 2 deletions
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;