drbg: Add missing format specifiers to debug output
authorThomas Egerer <thomas.egerer@secunet.com>
Mon, 12 Oct 2020 16:41:53 +0000 (16:41 +0000)
committerTobias Brunner <tobias@strongswan.org>
Tue, 13 Oct 2020 08:05:43 +0000 (10:05 +0200)
Fixes: 737375a2d27e ("drbg: Implemented NIST SP-800-90A DRBG")

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
src/libstrongswan/plugins/drbg/drbg_ctr.c
src/libstrongswan/plugins/drbg/drbg_hmac.c

index a40cf44..22aa6f1 100644 (file)
@@ -283,7 +283,7 @@ drbg_ctr_t *drbg_ctr_create(drbg_type_t type, uint32_t strength,
        if (strength >  key_len * BITS_PER_BYTE)
        {
                DBG1(DBG_LIB, "%d bit block encryption key not sufficient for security "
-                        "strength of % bits", key_len * BITS_PER_BYTE, strength);
+                        "strength of %u bits", key_len * BITS_PER_BYTE, strength);
                return NULL;
        }
 
@@ -300,7 +300,7 @@ drbg_ctr_t *drbg_ctr_create(drbg_type_t type, uint32_t strength,
        if (personalization_str.len > seed_len)
        {
                DBG1(DBG_LIB, "personalization string length of %d bytes is larger "
-                        "than seed length of % bytes", personalization_str.len, seed_len);
+                        "than seed length of %u bytes", personalization_str.len, seed_len);
                crypter->destroy(crypter);
                return NULL;
        }
index 577044d..a7acd33 100644 (file)
@@ -266,7 +266,7 @@ drbg_hmac_t *drbg_hmac_create(drbg_type_t type, uint32_t strength,
 
        if (strength >  out_len * BITS_PER_BYTE)
        {
-               DBG1(DBG_LIB, "%N not sufficient for security strength of % bits",
+               DBG1(DBG_LIB, "%N not sufficient for security strength of %u bits",
                         pseudo_random_function_names, prf_type, strength);
                prf->destroy(prf);
                return NULL;