FreeBSD Bugzilla – Attachment 249852 Details for
Bug 278076
security/gnutls: GnuTLS 3.8.x breaks any recent version on Samba, 'GnuTLS could not generate a random buffer'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
gnutls.keydbg.patch
gnutls.keydbg.patch (text/plain), 2.60 KB, created by
Tijl Coosemans
on 2024-04-09 12:42:17 UTC
(
hide
)
Description:
gnutls.keydbg.patch
Filename:
MIME Type:
Creator:
Tijl Coosemans
Created:
2024-04-09 12:42:17 UTC
Size:
2.60 KB
patch
obsolete
>diff --git a/security/gnutls/Makefile b/security/gnutls/Makefile >index f72a03894fb0..a83736d7b5c0 100644 >--- a/security/gnutls/Makefile >+++ b/security/gnutls/Makefile >@@ -28,7 +28,7 @@ USE_LDCONFIG= yes > INFO= gnutls > INSTALL_TARGET= install-strip > TEST_TARGET= check >-LDFLAGS= -Wl,--undefined-version >+LDFLAGS= -Wl,--undefined-version -Wl,--allow-shlib-undefined > MAKE_ENV= MAKEINFOFLAGS=--no-split > > CONFIGURE_ARGS= --disable-rpath \ >diff --git a/security/gnutls/files/patch-lib_random.c b/security/gnutls/files/patch-lib_random.c >new file mode 100644 >index 000000000000..e552658d3642 >--- /dev/null >+++ b/security/gnutls/files/patch-lib_random.c >@@ -0,0 +1,77 @@ >+--- lib/random.c.orig 2024-04-03 10:23:23 UTC >++++ lib/random.c >+@@ -23,6 +23,10 @@ >+ /* This file handles all the internal functions that cope with random data >+ */ >+ >++#include <dlfcn.h> >++#include <pthread.h> >++#include <stdio.h> >++ >+ #include "gnutls_int.h" >+ #include "errors.h" >+ #include "random.h" >+@@ -102,6 +106,29 @@ static inline int _gnutls_rnd_init(void) >+ return 0; >+ } >+ >++extern struct pthread_key { >++ volatile int allocated; >++ int seqno; >++ void (*destructor)(void *); >++} _thread_keytable[PTHREAD_KEYS_MAX]; >++ >++static void print_key(int idx) { >++ Dl_info info; >++ int ret; >++ >++ fprintf(stderr, "%d %d %d %p", idx, _thread_keytable[idx].allocated, >++ _thread_keytable[idx].seqno, _thread_keytable[idx].destructor); >++ if (_thread_keytable[idx].destructor != NULL) { >++ ret = dladdr(_thread_keytable[idx].destructor, &info); >++ if (ret != 0) { >++ fprintf(stderr, " %s:%s", info.dli_fname, info.dli_sname); >++ } else { >++ fprintf(stderr, " %s", dlerror()); >++ } >++ } >++ fprintf(stderr, "\n"); >++} >++ >+ int _gnutls_rnd_preinit(void) >+ { >+ int ret; >+@@ -128,8 +155,12 @@ int _gnutls_rnd_preinit(void) >+ return gnutls_assert_val(GNUTLS_E_RANDOM_FAILED); >+ >+ ret = glthread_tls_key_init(&ctx_key, delete_ctx); >+- if (ret) >++ if (ret) { >++ for (int i = 0; i < PTHREAD_KEYS_MAX; i++) { >++ print_key(i); >++ } >+ return gnutls_assert_val(GNUTLS_E_RANDOM_FAILED); >++ } >+ >+ list = gl_list_nx_create_empty(GL_LINKEDHASH_LIST, NULL, NULL, free_ctx, >+ false); >+@@ -141,8 +172,18 @@ void _gnutls_rnd_deinit(void) >+ >+ void _gnutls_rnd_deinit(void) >+ { >++ int ret; >++ >+ gl_list_free(list); >+- glthread_tls_key_destroy(&ctx_key); >++ ret = glthread_tls_key_destroy(&ctx_key); >++ if (ret) { >++ fprintf(stderr, "delerr: %d %d ", ret, ctx_key.key); >++ if ((unsigned int)ctx_key.key - 1 < PTHREAD_KEYS_MAX) { >++ print_key(ctx_key.key - 1); >++ } else { >++ fprintf(stderr, "\n"); >++ } >++ } >+ rnd_initialized = 0; >+ _rnd_system_entropy_deinit(); >+ }
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 278076
:
249637
|
249804
| 249852 |
249909