Skip to content

Commit a8384bb

Browse files
authored
Merge pull request wolfSSL#8602 from dgarske/cryptocb_no_hmac
Fix for crypto callback macro guards with `DEBUG_CRYPTOCB`
2 parents 04a3f1c + e1ec90a commit a8384bb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

wolfcrypt/src/cryptocb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,20 +207,25 @@ WOLFSSL_API void wc_CryptoCb_InfoString(wc_CryptoInfo* info)
207207
info->cipher.type, info->cipher.ctx);
208208
}
209209
#endif /* !NO_AES || !NO_DES3 */
210+
#if !defined(NO_SHA) || !defined(NO_SHA256) || \
211+
defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA3)
210212
else if (info->algo_type == WC_ALGO_TYPE_HASH) {
211213
printf("Crypto CB: %s %s (%d) (%p ctx) %s\n",
212214
GetAlgoTypeStr(info->algo_type),
213215
GetHashTypeStr(info->hash.type),
214216
info->hash.type, info->hash.ctx,
215217
(info->hash.in != NULL) ? "Update" : "Final");
216218
}
219+
#endif
220+
#ifndef NO_HMAC
217221
else if (info->algo_type == WC_ALGO_TYPE_HMAC) {
218222
printf("Crypto CB: %s %s (%d) (%p ctx) %s\n",
219223
GetAlgoTypeStr(info->algo_type),
220224
GetHashTypeStr(info->hmac.macType),
221225
info->hmac.macType, info->hmac.hmac,
222226
(info->hmac.in != NULL) ? "Update" : "Final");
223227
}
228+
#endif
224229
#ifdef WOLFSSL_CMAC
225230
else if (info->algo_type == WC_ALGO_TYPE_CMAC) {
226231
printf("Crypto CB: %s %s (%d) (%p ctx) %s %s %s\n",

wolfssl/wolfcrypt/cryptocb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ typedef struct wc_CryptoInfo {
375375
} cipher;
376376
#endif /* !NO_AES || !NO_DES3 */
377377
#if !defined(NO_SHA) || !defined(NO_SHA256) || \
378-
defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)
378+
defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA3)
379379
struct {
380380
int type; /* enum wc_HashType */
381381
const byte* in;

0 commit comments

Comments
 (0)