Skip to content

Commit 262799d

Browse files
committed
wolfcrypt/src/evp.c: in wolfSSL_EVP_MD_type(), fix -Wswitch-enums for WC_HASH_TYPE_BLAKE2B and WC_HASH_TYPE_BLAKE2S exposed in default+opensslall configs.
1 parent 7996376 commit 262799d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

wolfcrypt/src/evp.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11193,24 +11193,28 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type)
1119311193
ret = NOT_COMPILED_IN;
1119411194
#endif
1119511195
break;
11196-
#ifdef HAVE_BLAKE2
1119711196
case WC_HASH_TYPE_BLAKE2B:
11197+
#ifdef HAVE_BLAKE2
1119811198
if (wc_Blake2bFinal(&ctx->hash.digest.blake2b, md,
1119911199
WC_BLAKE2B_DIGEST_SIZE) == 0) {
1120011200
if (s) *s = WC_BLAKE2B_DIGEST_SIZE;
1120111201
ret = WOLFSSL_SUCCESS;
1120211202
}
11203-
break;
11203+
#else
11204+
ret = NOT_COMPILED_IN;
1120411205
#endif
11205-
#ifdef HAVE_BLAKE2S
11206+
break;
1120611207
case WC_HASH_TYPE_BLAKE2S:
11208+
#ifdef HAVE_BLAKE2S
1120711209
if (wc_Blake2sFinal(&ctx->hash.digest.blake2s, md,
1120811210
WC_BLAKE2S_DIGEST_SIZE) == 0) {
1120911211
if (s) *s = WC_BLAKE2S_DIGEST_SIZE;
1121011212
ret = WOLFSSL_SUCCESS;
1121111213
}
11212-
break;
11214+
#else
11215+
ret = NOT_COMPILED_IN;
1121311216
#endif
11217+
break;
1121411218
case WC_HASH_TYPE_NONE:
1121511219
case WC_HASH_TYPE_MD2:
1121611220
case WC_HASH_TYPE_MD5_SHA:

0 commit comments

Comments
 (0)