fix for MD5 case, "recover hmac", in HMAC_init

pull/1319/head
Takashi Kojo 2017-11-23 07:00:37 +09:00 committed by Jacob Barthelmeh
parent 937c759998
commit e93d7d3c93
1 changed files with 1 additions and 1 deletions

View File

@ -24812,7 +24812,7 @@ int wolfSSL_HMAC_Init(WOLFSSL_HMAC_CTX* ctx, const void* key, int keylen,
ctx->save_len = keylen;
}
/* OpenSSL compat, no error */
} else if(ctx->type) {
} else if(ctx->type >= 0) { /* MD5 == 0 */
WOLFSSL_MSG("recover hmac");
if (wc_HmacInit(&ctx->hmac, NULL, INVALID_DEVID) == 0) {
wc_HmacSetKey(&ctx->hmac, ctx->type, (byte *)&ctx->save_key,