summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/evp/digest.c10
-rw-r--r--crypto/evp/evp.h1
-rwxr-xr-xutil/libeay.num1
3 files changed, 12 insertions, 0 deletions
diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c
index 762e6d3450..11d73388d4 100644
--- a/crypto/evp/digest.c
+++ b/crypto/evp/digest.c
@@ -279,6 +279,16 @@ int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
memcpy(out->md_data,in->md_data,out->digest->ctx_size);
}
+ if (in->pctx)
+ {
+ out->pctx = EVP_PKEY_CTX_dup(in->pctx);
+ if (!out->pctx)
+ {
+ EVP_MD_CTX_cleanup(out);
+ return 0;
+ }
+ }
+
if (out->digest->copy)
return out->digest->copy(out,in);
diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h
index 7af4860b93..a8795d8c4c 100644
--- a/crypto/evp/evp.h
+++ b/crypto/evp/evp.h
@@ -960,6 +960,7 @@ int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth);
EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
+EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx);
void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype,
diff --git a/util/libeay.num b/util/libeay.num
index 1ea9177ba9..81ad22da16 100755
--- a/util/libeay.num
+++ b/util/libeay.num
@@ -3707,3 +3707,4 @@ EVP_DigestSignInit 4102 EXIST::FUNCTION:
EVP_DigestVerifyFinal 4103 EXIST::FUNCTION:
EVP_DigestVerifyInit 4104 EXIST::FUNCTION:
EVP_DigestSignFinal 4105 EXIST::FUNCTION:
+EVP_PKEY_CTX_dup 4106 EXIST::FUNCTION: