summaryrefslogtreecommitdiffstats
path: root/crypto/dsa
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/dsa
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/dsa')
-rw-r--r--crypto/dsa/dsa_pmeth.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/dsa/dsa_pmeth.c b/crypto/dsa/dsa_pmeth.c
index 9909dc8f3b..cdd6440dc3 100644
--- a/crypto/dsa/dsa_pmeth.c
+++ b/crypto/dsa/dsa_pmeth.c
@@ -91,6 +91,18 @@ static int pkey_dsa_init(EVP_PKEY_CTX *ctx)
return 1;
}
+static int pkey_dsa_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)
+ {
+ DSA_PKEY_CTX *dctx, *sctx;
+ if (!pkey_dsa_init(dst))
+ return 0;
+ sctx = src->data;
+ dctx = dst->data;
+ dctx->nbits = sctx->nbits;
+ dctx->md = sctx->md;
+ return 1;
+ }
+
static void pkey_dsa_cleanup(EVP_PKEY_CTX *ctx)
{
DSA_PKEY_CTX *dctx = ctx->data;
@@ -223,6 +235,7 @@ const EVP_PKEY_METHOD dsa_pkey_meth =
EVP_PKEY_DSA,
EVP_PKEY_FLAG_AUTOARGLEN,
pkey_dsa_init,
+ pkey_dsa_copy,
pkey_dsa_cleanup,
0,