From 1f7b954d47609d280a7977883dbc8a76604b2fda Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 12 Apr 2018 06:51:23 -0700 Subject: [PATCH] Fix for `wc_GetCTC_HashOID` in FIPS mode. Uses the new `wc_HashTypeConvert` to handle conversion from unique WC_ALGO (`int`) to WC_HASH_TYPE_ALGO (`enum wc_HashType`). --- wolfcrypt/src/asn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index c6aac170f..a7d7615b5 100755 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4898,9 +4898,10 @@ word32 wc_EncodeSignature(byte* out, const byte* digest, word32 digSz, int wc_GetCTC_HashOID(int type) { int ret; + enum wc_HashType hType; - /* hash type is same as enum HashType (ex WC_SHA is WC_HASH_TYPE_SHA) */ - ret = wc_HashGetOID((enum wc_HashType)type); + hType = wc_HashTypeConvert(type); + ret = wc_HashGetOID(hType); if (ret < 0) ret = 0; /* backwards compatibility */