提交 18327cd0 编写于 作者: D Dr. Stephen Henson

Copy update callback across when copying EVP_MD_CTX.

Remove unnecessary reference to EVP_MD_CTX in HMAC pkey method.
上级 2022cfe0
......@@ -292,6 +292,8 @@ 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);
}
out->update = in->update;
if (in->pctx)
{
out->pctx = EVP_PKEY_CTX_dup(in->pctx);
......
......@@ -68,7 +68,6 @@
typedef struct
{
const EVP_MD *md; /* MD for HMAC use */
EVP_MD_CTX *mctx; /* Parent EVP_MD_CTX */
ASN1_OCTET_STRING ktmp; /* Temp storage for key */
HMAC_CTX ctx;
} HMAC_PKEY_CTX;
......@@ -80,7 +79,6 @@ static int pkey_hmac_init(EVP_PKEY_CTX *ctx)
if (!hctx)
return 0;
hctx->md = NULL;
hctx->mctx = NULL;
hctx->ktmp.data = NULL;
HMAC_CTX_init(&hctx->ctx);
......@@ -145,8 +143,6 @@ static int int_update(EVP_MD_CTX *ctx,const void *data,size_t count)
static int hmac_signctx_init(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)
{
HMAC_PKEY_CTX *hctx = ctx->data;
hctx->mctx = mctx;
EVP_MD_CTX_set_flags(mctx, EVP_MD_CTX_FLAG_NO_INIT);
mctx->update = int_update;
return 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册