Update EVP_MD_CTX_copy_ex() to use EVP_PKEY_CTX_dup().
authorDr. Stephen Henson <steve@openssl.org>
Thu, 25 May 2006 00:55:00 +0000 (00:55 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 25 May 2006 00:55:00 +0000 (00:55 +0000)
crypto/evp/digest.c
crypto/evp/evp.h
util/libeay.num

index 762e6d3450d31d41d5ff042f030a11db20753bc6..11d73388d4b7b6d969065e626789f6c583bff86f 100644 (file)
@@ -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);
        
index 7af4860b9318aee92df4a9af5f042cab9ac22538..a8795d8c4c8b0ecce5f771a05c137958cdec8fca 100644 (file)
@@ -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,
index 1ea9177ba9c2010744c0cea3020906d838409049..81ad22da167ac072c0b3e4f973ad4b31477aff7e 100755 (executable)
@@ -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: