From a47d5eba571ee53ff331ebd0f20a284bd9b8cdfb Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 30 Nov 2014 23:28:13 -0500 Subject: snapshot of project "lynx", label v2-8-9dev_1d --- src/LYCookie.c | 7 ++++--- src/tidy_tls.c | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/LYCookie.c b/src/LYCookie.c index 04ee12fd..be801ab5 100644 --- a/src/LYCookie.c +++ b/src/LYCookie.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYCookie.c,v 1.128 2013/11/28 11:18:12 tom Exp $ + * $LynxId: LYCookie.c,v 1.129 2014/11/29 15:28:10 Mike.Gorse Exp $ * * Lynx Cookie Support LYCookie.c * =================== @@ -716,13 +716,14 @@ static char *scan_cookie_sublist(char *hostname, char *header, int secure) { - HTList *hl; + HTList *hl, *next; cookie *co; time_t now = time(NULL); char crlftab[8]; sprintf(crlftab, "%c%c%c", CR, LF, '\t'); - for (hl = sublist; hl != NULL; hl = hl->next) { + for (hl = sublist; hl != NULL; hl = next) { + next = hl->next; co = (cookie *) hl->object; if (co == NULL) { diff --git a/src/tidy_tls.c b/src/tidy_tls.c index e6afeefa..f6dea810 100644 --- a/src/tidy_tls.c +++ b/src/tidy_tls.c @@ -1,5 +1,5 @@ /* - * $LynxId: tidy_tls.c,v 1.22 2014/01/11 17:34:51 tom Exp $ + * $LynxId: tidy_tls.c,v 1.24 2014/11/30 23:28:13 tom Exp $ * Copyright 2008-2013,2014 Thomas E. Dickey * with fix Copyright 2008 by Thomas Viehmann * @@ -11,7 +11,11 @@ #include #include +#ifdef HAVE_GNUTLS_RND +#include +#else #include +#endif #include /* ASN1_SUCCESS,etc */ #include @@ -95,8 +99,15 @@ unsigned long ERR_get_error(void) */ int RAND_bytes(unsigned char *buffer, int num) { + int rc; + +#ifdef HAVE_GNUTLS_RND + rc = gnutls_rnd(GNUTLS_RND_KEY, buffer, num); +#else gcry_randomize(buffer, num, GCRY_VERY_STRONG_RANDOM); - return 1; + rc = 1; +#endif + return rc; } /* -- cgit 1.4.1-2-gfad0