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/rsa | |
parent | 91c9e62123febf74866fa17983e6068ab4962bd7 (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/rsa')
-rw-r--r-- | crypto/rsa/rsa_pmeth.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c index 168a33ee56..9f4a2ca336 100644 --- a/crypto/rsa/rsa_pmeth.c +++ b/crypto/rsa/rsa_pmeth.c @@ -109,6 +109,25 @@ static int pkey_rsa_init(EVP_PKEY_CTX *ctx) return 1; } +static int pkey_rsa_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) + { + RSA_PKEY_CTX *dctx, *sctx; + if (!pkey_rsa_init(dst)) + return 0; + sctx = src->data; + dctx = dst->data; + dctx->nbits = sctx->nbits; + if (sctx->pub_exp) + { + dctx->pub_exp = BN_dup(sctx->pub_exp); + if (!dctx->pub_exp) + return 0; + } + dctx->pad_mode = sctx->pad_mode; + dctx->md = sctx->md; + return 1; + } + static int setup_tbuf(RSA_PKEY_CTX *ctx, EVP_PKEY_CTX *pk) { if (ctx->tbuf) @@ -523,6 +542,7 @@ const EVP_PKEY_METHOD rsa_pkey_meth = EVP_PKEY_RSA, EVP_PKEY_FLAG_AUTOARGLEN, pkey_rsa_init, + pkey_rsa_copy, pkey_rsa_cleanup, 0,0, |