48 lines
1.5 KiB
Diff
48 lines
1.5 KiB
Diff
From d2cc9f2ef31092c1ce5e5ad967a6be4f3bc84c06 Mon Sep 17 00:00:00 2001
|
|
From: Andreas Schneider <asn@samba.org>
|
|
Date: Mon, 12 Aug 2019 18:55:56 +0200
|
|
Subject: [PATCH 080/187] lib:util: Use generate_secret_buffer() for long term
|
|
passwords
|
|
|
|
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
Reviewed-by: Alexander Bokovoy <ab@samba.org>
|
|
(cherry picked from commit 93196dd823e114f260a68d28bb59eac3909c30d8)
|
|
---
|
|
lib/util/genrand_util.c | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/lib/util/genrand_util.c b/lib/util/genrand_util.c
|
|
index d7b74c6cf1a..05d1f3ef6e5 100644
|
|
--- a/lib/util/genrand_util.c
|
|
+++ b/lib/util/genrand_util.c
|
|
@@ -185,7 +185,7 @@ _PUBLIC_ char *generate_random_str_list(TALLOC_CTX *mem_ctx, size_t len, const c
|
|
char *retstr = talloc_array(mem_ctx, char, len + 1);
|
|
if (!retstr) return NULL;
|
|
|
|
- generate_random_buffer((uint8_t *)retstr, len);
|
|
+ generate_secret_buffer((uint8_t *)retstr, len);
|
|
for (i = 0; i < len; i++) {
|
|
retstr[i] = list[retstr[i] % list_len];
|
|
}
|
|
@@ -247,7 +247,7 @@ _PUBLIC_ char *generate_random_password(TALLOC_CTX *mem_ctx, size_t min, size_t
|
|
if (diff > 0 ) {
|
|
size_t tmp;
|
|
|
|
- generate_random_buffer((uint8_t *)&tmp, sizeof(tmp));
|
|
+ generate_secret_buffer((uint8_t *)&tmp, sizeof(tmp));
|
|
|
|
tmp %= diff;
|
|
|
|
@@ -317,7 +317,7 @@ _PUBLIC_ char *generate_random_machine_password(TALLOC_CTX *mem_ctx, size_t min,
|
|
if (diff > 0) {
|
|
size_t tmp;
|
|
|
|
- generate_random_buffer((uint8_t *)&tmp, sizeof(tmp));
|
|
+ generate_secret_buffer((uint8_t *)&tmp, sizeof(tmp));
|
|
|
|
tmp %= diff;
|
|
|
|
--
|
|
2.23.0
|
|
|