The Samba-Bugzilla – Attachment 17389 Details for
Bug 15103
CVE-2022-1615 [SECURITY] GnuTLS gnutls_rnd() can fail and give predictable random values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
v2 patch with amended message, fixes generate_nonce_buffer()
0001-util-genrand-don-t-ignore-errors-in-random-number-ge.patch (text/plain), 1.82 KB, created by
Douglas Bagnall
on 2022-06-22 22:24:59 UTC
(
hide
)
Description:
v2 patch with amended message, fixes generate_nonce_buffer()
Filename:
MIME Type:
Creator:
Douglas Bagnall
Created:
2022-06-22 22:24:59 UTC
Size:
1.82 KB
patch
obsolete
>From 1a0c0b3596a31c65f9059708b31b74227206f992 Mon Sep 17 00:00:00 2001 >From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Date: Mon, 5 Aug 2019 00:10:53 +1200 >Subject: [PATCH] util/genrand: don't ignore errors in random number generation > >In this case it is probably better to crash out. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15103 > >Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >--- > lib/util/genrand.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > >diff --git a/lib/util/genrand.c b/lib/util/genrand.c >index 18ffa0d95e6..99c725de0a7 100644 >--- a/lib/util/genrand.c >+++ b/lib/util/genrand.c >@@ -34,7 +34,10 @@ > _PUBLIC_ void generate_random_buffer(uint8_t *out, int len) > { > /* Random number generator for temporary keys. */ >- gnutls_rnd(GNUTLS_RND_RANDOM, out, len); >+ int ret = gnutls_rnd(GNUTLS_RND_RANDOM, out, len); >+ if (ret != 0) { >+ smb_panic("GnuTLS could not generate a random buffer"); >+ } > } > > _PUBLIC_ void generate_secret_buffer(uint8_t *out, int len) >@@ -48,7 +51,10 @@ _PUBLIC_ void generate_secret_buffer(uint8_t *out, int len) > * the limit for a re-seed. For its re-seed it mixes mixes data obtained > * from the OS random device with the previous key. > */ >- gnutls_rnd(GNUTLS_RND_KEY, out, len); >+ int ret = gnutls_rnd(GNUTLS_RND_KEY, out, len); >+ if (ret != 0) { >+ smb_panic("GnuTLS could not generate a random buffer"); >+ } > } > > _PUBLIC_ void generate_nonce_buffer(uint8_t *out, int len) >@@ -60,5 +66,8 @@ _PUBLIC_ void generate_nonce_buffer(uint8_t *out, int len) > * bytes (typically few megabytes), or after few hours of operation > * without reaching the limit has passed. > */ >- gnutls_rnd(GNUTLS_RND_NONCE, out, len); >+ int ret = gnutls_rnd(GNUTLS_RND_NONCE, out, len); >+ if (ret != 0) { >+ smb_panic("GnuTLS could not generate a random buffer"); >+ } > } >-- >2.30.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15103
:
17386
|
17389
|
17390
|
17609