From: Tobias Brunner Date: Tue, 18 Apr 2023 14:48:08 +0000 (+0200) Subject: drbg: Fix build with DEBUG_LEVEL < 4 X-Git-Tag: 5.9.11rc1~12^2~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b58e8c3861875e05bf3ebe1687b18e1d5bac136;p=thirdparty%2Fstrongswan.git drbg: Fix build with DEBUG_LEVEL < 4 --- diff --git a/src/libstrongswan/plugins/drbg/drbg_hmac.c b/src/libstrongswan/plugins/drbg/drbg_hmac.c index 704adb5800..a0aa05ab9b 100644 --- a/src/libstrongswan/plugins/drbg/drbg_hmac.c +++ b/src/libstrongswan/plugins/drbg/drbg_hmac.c @@ -158,7 +158,6 @@ METHOD(drbg_t, generate, bool, private_drbg_hmac_t *this, uint32_t len, uint8_t *out) { size_t delta; - chunk_t output; if (len > MAX_DRBG_BYTES) { @@ -179,7 +178,9 @@ METHOD(drbg_t, generate, bool, { return FALSE; } - output = chunk_create(out, len); +#if DEBUG_LEVEL >= 4 + chunk_t output = chunk_create(out, len); +#endif while (len) { @@ -192,7 +193,7 @@ METHOD(drbg_t, generate, bool, len -= delta; out += delta; } - DBG4(DBG_LIB, "HMAC_DRBG Out: %B", &output); + DBG4(DBG_LIB, "HMAC_DRBG out: %B", &output); if (!update(this, chunk_empty)) {