]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
drbg: Fix build with DEBUG_LEVEL < 4
authorTobias Brunner <tobias@strongswan.org>
Tue, 18 Apr 2023 14:48:08 +0000 (16:48 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 May 2023 15:32:17 +0000 (17:32 +0200)
src/libstrongswan/plugins/drbg/drbg_hmac.c

index 704adb58000fcf80837e6491f4de7c770319109a..a0aa05ab9b4e1d82d06528d7dd883bf7d768535b 100644 (file)
@@ -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))
        {