From 7726786998d65e3ffddd2a6d5bf83c746769831a Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 3 Aug 2018 15:04:37 -0600 Subject: [PATCH] fix comment and remove duplicate free --- wolfcrypt/src/hash.c | 1 - wolfcrypt/src/port/af_alg/afalg_hash.c | 1 + wolfcrypt/src/sha256.c | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/hash.c b/wolfcrypt/src/hash.c index ced259fa9..78fdaa189 100644 --- a/wolfcrypt/src/hash.c +++ b/wolfcrypt/src/hash.c @@ -840,7 +840,6 @@ int wc_HashFree(wc_HashAlg* hash, enum wc_HashType type) } wc_Sha256Free(sha256); } - wc_Sha256Free(sha256); #ifdef WOLFSSL_SMALL_STACK diff --git a/wolfcrypt/src/port/af_alg/afalg_hash.c b/wolfcrypt/src/port/af_alg/afalg_hash.c index c007e97dc..57c6ad0b0 100644 --- a/wolfcrypt/src/port/af_alg/afalg_hash.c +++ b/wolfcrypt/src/port/af_alg/afalg_hash.c @@ -64,6 +64,7 @@ int wc_InitSha256_ex(wc_Sha256* sha, void* heap, int devId) sha->rdFd = wc_Afalg_CreateRead(sha->alFd, WC_TYPE_HASH, WC_NAME_SHA256); if (sha->rdFd < 0) { + close(sha->alFd); return WC_AFALG_SOCK_E; } diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 78fe6b7d7..a2d822bf9 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -2578,8 +2578,8 @@ SHA256_NOINLINE static int Transform_Sha256_AVX2_RORX_Len(wc_Sha256* sha256, #elif defined(WOLFSSL_IMX6_CAAM) && !defined(NO_IMX6_CAAM_HASH) /* functions defined in wolfcrypt/src/port/caam/caam_sha256.c */ -//#elif defined(WOLFSSL_AFALG_HASH) -// /* implemented in wolfcrypt/src/port/af_alg/afalg_hash.c */ +#elif defined(WOLFSSL_AFALG_HASH) + #error SHA224 currently not supported with AF_ALG enabled #else