diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/LYCookie.c | 7 | ||||
-rw-r--r-- | src/tidy_tls.c | 15 |
2 files changed, 17 insertions, 5 deletions
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 <tidy_tls.h> #include <gnutls/x509.h> +#ifdef HAVE_GNUTLS_RND +#include <gnutls/crypto.h> +#else #include <gcrypt.h> +#endif #include <libtasn1.h> /* ASN1_SUCCESS,etc */ #include <string.h> @@ -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; } /* |