summaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-05-24 23:49:30 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-05-24 23:49:30 +0000
commit8bdcef40e48f167e0d566fc5a831c05a7d94d7b1 (patch)
treef8211928483bb76e44a99c233d66d1ca728f13e5 /crypto/dh
parent91c9e62123febf74866fa17983e6068ab4962bd7 (diff)
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/dh')
-rw-r--r--crypto/dh/dh_pmeth.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/dh/dh_pmeth.c b/crypto/dh/dh_pmeth.c
index b8b1362eba..5803b1d711 100644
--- a/crypto/dh/dh_pmeth.c
+++ b/crypto/dh/dh_pmeth.c
@@ -93,6 +93,19 @@ static int pkey_dh_init(EVP_PKEY_CTX *ctx)
return 1;
}
+static int pkey_dh_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)
+ {
+ DH_PKEY_CTX *dctx, *sctx;
+ if (!pkey_dh_init(dst))
+ return 0;
+ sctx = src->data;
+ dctx = dst->data;
+ dctx->prime_len = sctx->prime_len;
+ dctx->generator = sctx->generator;
+ dctx->use_dsa = sctx->use_dsa;
+ return 1;
+ }
+
static void pkey_dh_cleanup(EVP_PKEY_CTX *ctx)
{
DH_PKEY_CTX *dctx = ctx->data;
@@ -208,6 +221,7 @@ const EVP_PKEY_METHOD dh_pkey_meth =
EVP_PKEY_DH,
EVP_PKEY_FLAG_AUTOARGLEN,
pkey_dh_init,
+ pkey_dh_copy,
pkey_dh_cleanup,
0,