From 7b8b7973750f65ecce161af012f004b9c7be45f9 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Tue, 22 May 2007 12:58:39 +0000 Subject: [PATCH] Revert broken change to ccgost. Initialize context properly for HMAC pkey method. --- crypto/hmac/hm_pmeth.c | 5 ++++- engines/ccgost/gost_pmeth.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/hmac/hm_pmeth.c b/crypto/hmac/hm_pmeth.c index 53a3f00f2f..27a5c8ea57 100644 --- a/crypto/hmac/hm_pmeth.c +++ b/crypto/hmac/hm_pmeth.c @@ -80,11 +80,14 @@ static int pkey_hmac_init(EVP_PKEY_CTX *ctx) return 0; hctx->md = NULL; hctx->ktmp.data = NULL; + hctx->ktmp.length = 0; + hctx->ktmp.flags = 0; + hctx->ktmp.type = V_ASN1_OCTET_STRING; HMAC_CTX_init(&hctx->ctx); ctx->data = hctx; ctx->keygen_info_count = 0; - + return 1; } diff --git a/engines/ccgost/gost_pmeth.c b/engines/ccgost/gost_pmeth.c index 03e0244027..746e681db1 100644 --- a/engines/ccgost/gost_pmeth.c +++ b/engines/ccgost/gost_pmeth.c @@ -545,7 +545,7 @@ static int pkey_gost_mac_ctrl (EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { case EVP_PKEY_CTRL_MD: { - if (p2 != NULL) + if (EVP_MD_type((const EVP_MD *)p2) != NID_id_Gost28147_89_MAC) { GOSTerr(GOST_F_PKEY_GOST_MAC_CTRL, GOST_R_INVALID_DIGEST_TYPE); return 0;