diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2006-05-24 23:49:30 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2006-05-24 23:49:30 +0000 |
commit | 8bdcef40e48f167e0d566fc5a831c05a7d94d7b1 (patch) | |
tree | f8211928483bb76e44a99c233d66d1ca728f13e5 /crypto/ec/ec_pmeth.c | |
parent | 91c9e62123febf74866fa17983e6068ab4962bd7 (diff) | |
download | openssl-8bdcef40e48f167e0d566fc5a831c05a7d94d7b1.tar.gz |
New function to dup EVP_PKEY_CTX. This will be needed to make new signing
functions and EVP_MD_CTX_copy work properly.
Diffstat (limited to 'crypto/ec/ec_pmeth.c')
-rw-r--r-- | crypto/ec/ec_pmeth.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/ec/ec_pmeth.c b/crypto/ec/ec_pmeth.c index 760200892e..caaeebdb6d 100644 --- a/crypto/ec/ec_pmeth.c +++ b/crypto/ec/ec_pmeth.c @@ -88,6 +88,23 @@ static int pkey_ec_init(EVP_PKEY_CTX *ctx) return 1; } +static int pkey_ec_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) + { + EC_PKEY_CTX *dctx, *sctx; + if (!pkey_ec_init(dst)) + return 0; + sctx = src->data; + dctx = dst->data; + if (sctx->gen_group) + { + dctx->gen_group = EC_GROUP_dup(sctx->gen_group); + if (!dctx->gen_group) + return 0; + } + dctx->md = sctx->md; + return 1; + } + static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx) { EC_PKEY_CTX *dctx = ctx->data; @@ -284,6 +301,7 @@ const EVP_PKEY_METHOD ec_pkey_meth = EVP_PKEY_EC, 0, pkey_ec_init, + pkey_ec_copy, pkey_ec_cleanup, 0, |