about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2015-11-17 01:29:09 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2015-11-17 01:29:09 -0500
commit116c37fb1346231af41de015e612bb0fd74f218e (patch)
tree48ca500dbc605892ef938a6d0ff5ffec19da5618 /src
parentf388b2a11503c04e1b49047fd6e35d0f49e00b0b (diff)
downloadlynx-snapshots-116c37fb1346231af41de015e612bb0fd74f218e.tar.gz
snapshot of project "lynx", label v2-8-9dev_6i
Diffstat (limited to 'src')
-rw-r--r--src/LYMain.c5
-rw-r--r--src/LYReadCFG.c6
-rw-r--r--src/tidy_tls.c36
3 files changed, 23 insertions, 24 deletions
diff --git a/src/LYMain.c b/src/LYMain.c
index a09e9626..003c3516 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMain.c,v 1.258 2015/10/08 09:24:13 tom Exp $
+ * $LynxId: LYMain.c,v 1.259 2015/10/12 00:23:00 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -553,7 +553,7 @@ char *XLoadImageCommand = NULL;	/* Default image viewer for X */
 BOOLEAN LYNoISMAPifUSEMAP = FALSE;	/* Omit ISMAP link if MAP present? */
 int LYHiddenLinks = HIDDENLINKS_SEPARATE;	/* Show hidden links? */
 
-char *SSL_cert_file = NULL;	/*y Default CA CERT file */
+char *SSL_cert_file = NULL;	/* Default CA CERT file */
 char *SSL_client_cert_file = NULL;
 char *SSL_client_key_file = NULL;
 
@@ -1590,7 +1590,6 @@ int main(int argc,
 		    "HTGetSSLHandle: client keyfile is set to %s by SSL_CLIENT_KEY_FILE\n",
 		    client_keyfile));
 	    StrAllocCopy(SSL_client_key_file, client_keyfile);
-
 	}
 
 	if ((client_certfile = LYGetEnv("SSL_CLIENT_CERT_FILE")) != NULL) {
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index 6dd1e306..81950c64 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYReadCFG.c,v 1.185 2015/10/08 08:51:26 Simon.Kainz Exp $
+ * $LynxId: LYReadCFG.c,v 1.186 2015/10/10 00:31:57 tom Exp $
  */
 #ifndef NO_RULES
 #include <HTRules.h>
@@ -1719,8 +1719,8 @@ static Config_Type Config_Table [] =
      PARSE_ENU(RC_SOURCE_CACHE_FOR_ABORTED, LYCacheSourceForAborted, tbl_abort_source_cache),
 #endif
      PARSE_STR(RC_SSL_CERT_FILE,        SSL_cert_file),
-     PARSE_STR(RC_SSL_CLIENT_CERT_FILE,        SSL_client_cert_file),
-     PARSE_STR(RC_SSL_CLIENT_KEY_FILE,        SSL_client_key_file),
+     PARSE_STR(RC_SSL_CLIENT_CERT_FILE, SSL_client_cert_file),
+     PARSE_STR(RC_SSL_CLIENT_KEY_FILE,  SSL_client_key_file),
      PARSE_FUN(RC_STARTFILE,            startfile_fun),
      PARSE_FUN(RC_STATUS_BUFFER_SIZE,   status_buffer_size_fun),
      PARSE_SET(RC_STRIP_DOTDOT_URLS,    LYStripDotDotURLs),
diff --git a/src/tidy_tls.c b/src/tidy_tls.c
index 559dca06..d94ba5cf 100644
--- a/src/tidy_tls.c
+++ b/src/tidy_tls.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: tidy_tls.c,v 1.29 2015/10/08 08:51:26 Simon.Kainz Exp $
+ * $LynxId: tidy_tls.c,v 1.31 2015/10/12 00:31:21 tom Exp $
  * Copyright 2008-2014,2015 Thomas E. Dickey
  * with fix Copyright 2008 by Thomas Viehmann
  *
@@ -70,7 +70,7 @@ static int ExtractCertificate(const gnutls_datum_t *cert, X509_NAME * result, in
 const char *ERR_error_string(unsigned long e, char *buffer)
 {
     (void) buffer;
-    return gnutls_strerror(-e);
+    return gnutls_strerror((int) -e);
 }
 
 /*
@@ -82,7 +82,7 @@ unsigned long ERR_get_error(void)
 {
     unsigned long rc;
 
-    rc = -last_error;
+    rc = (unsigned long) (-last_error);
     last_error = 0;
 
     return rc;
@@ -96,7 +96,7 @@ int RAND_bytes(unsigned char *buffer, int num)
     int rc;
 
 #ifdef HAVE_GNUTLS_RND
-    rc = gnutls_rnd(GNUTLS_RND_KEY, buffer, num);
+    rc = gnutls_rnd(GNUTLS_RND_KEY, buffer, (size_t) num);
 #else
     gcry_randomize(buffer, num, GCRY_VERY_STRONG_RANDOM);
     rc = 1;
@@ -125,7 +125,7 @@ const char *RAND_file_name(char *buffer, size_t len)
 int RAND_load_file(const char *name, long maxbytes)
 {
     (void) name;
-    return maxbytes;
+    return (int) maxbytes;
 }
 
 /*
@@ -168,7 +168,7 @@ int SSL_CIPHER_get_bits(SSL_CIPHER * cipher, int *bits)
     int result = 0;
 
     if (cipher) {
-	result = (8 * gnutls_cipher_get_key_size(cipher->encrypts));
+	result = (8 * (int) gnutls_cipher_get_key_size(cipher->encrypts));
     }
 
     if (bits)
@@ -457,13 +457,13 @@ int SSL_read(SSL * ssl, void *buffer, int length)
 {
     int rc;
 
-    rc = gnutls_record_recv(ssl->gnutls_state, buffer, length);
+    rc = (int) gnutls_record_recv(ssl->gnutls_state, buffer, (size_t) length);
 
     if (rc < 0 && gnutls_error_is_fatal(rc) == 0) {
 	if (rc == GNUTLS_E_REHANDSHAKE) {
 	    rc = gnutls_handshake(ssl->gnutls_state);
-	    gnutls_record_send(ssl->gnutls_state, ssl->sendbuffer, ssl->bytes_sent);
-	    rc = gnutls_record_recv(ssl->gnutls_state, buffer, length);
+	    gnutls_record_send(ssl->gnutls_state, ssl->sendbuffer, (size_t) ssl->bytes_sent);
+	    rc = (int) gnutls_record_recv(ssl->gnutls_state, buffer, (size_t) length);
 	}
     }
 
@@ -495,18 +495,18 @@ int SSL_write(SSL * ssl, const void *buffer, int length)
 {
     int rc;
 
-    rc = gnutls_record_send(ssl->gnutls_state, buffer, length);
+    rc = (int) gnutls_record_send(ssl->gnutls_state, buffer, (size_t) length);
     ssl->last_error = rc;
 
     if (rc < 0) {
 	last_error = rc;
 	rc = 0;
     } else {
-	if (ssl->sendbuffer) {
-	    free(ssl->sendbuffer);
-	}
-	ssl->sendbuffer = malloc(rc);
-	ssl->bytes_sent = rc;
+	size_t need = (size_t) rc;
+
+	free(ssl->sendbuffer);
+	ssl->sendbuffer = malloc(need);
+	ssl->bytes_sent = need;
     }
 
     return rc;
@@ -587,7 +587,7 @@ SSL_METHOD *SSLv23_client_method(void)
 static int add_name(char *target, int len, const char *tag, const char *data)
 {
     if (*data != '\0') {
-	int need = strlen(tag) + 2;
+	int need = (int) strlen(tag) + 2;
 
 	target += strlen(target);
 	if (need < len) {
@@ -597,10 +597,10 @@ static int add_name(char *target, int len, const char *tag, const char *data)
 	    len -= need;
 	    target += need;
 	}
-	need = strlen(data);
+	need = (int) strlen(data);
 	if (need >= len - 1)
 	    need = len - 1;
-	strncat(target, data, need)[need] = '\0';
+	strncat(target, data, (size_t) need)[need] = '\0';
     }
     return len;
 }