Skip to content

Commit a1ba229

Browse files
tobluxherbertx
authored andcommitted
crypto: drbg - Use str_true_false() and str_enabled_disabled() helpers
Remove hard-coded strings by using the helper functions str_true_false() and str_enabled_disabled(). Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 5a61fd6 commit a1ba229

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crypto/drbg.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
#include <crypto/internal/cipher.h>
102102
#include <linux/kernel.h>
103103
#include <linux/jiffies.h>
104+
#include <linux/string_choices.h>
104105

105106
/***************************************************************
106107
* Backend cipher definitions available to DRBG
@@ -1412,7 +1413,7 @@ static int drbg_generate(struct drbg_state *drbg,
14121413
if (drbg->pr || drbg->seeded == DRBG_SEED_STATE_UNSEEDED) {
14131414
pr_devel("DRBG: reseeding before generation (prediction "
14141415
"resistance: %s, state %s)\n",
1415-
drbg->pr ? "true" : "false",
1416+
str_true_false(drbg->pr),
14161417
(drbg->seeded == DRBG_SEED_STATE_FULL ?
14171418
"seeded" : "unseeded"));
14181419
/* 9.3.1 steps 7.1 through 7.3 */
@@ -1562,7 +1563,7 @@ static int drbg_instantiate(struct drbg_state *drbg, struct drbg_string *pers,
15621563
bool reseed = true;
15631564

15641565
pr_devel("DRBG: Initializing DRBG core %d with prediction resistance "
1565-
"%s\n", coreref, pr ? "enabled" : "disabled");
1566+
"%s\n", coreref, str_enabled_disabled(pr));
15661567
mutex_lock(&drbg->drbg_mutex);
15671568

15681569
/* 9.1 step 1 is implicit with the selected DRBG type */

0 commit comments

Comments
 (0)