about summary refs log tree commit diff stats
path: root/src/tidy_tls.c
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/tidy_tls.c
parentf388b2a11503c04e1b49047fd6e35d0f49e00b0b (diff)
downloadlynx-snapshots-116c37fb1346231af41de015e612bb0fd74f218e.tar.gz
snapshot of project "lynx", label v2-8-9dev_6i
Diffstat (limited to 'src/tidy_tls.c')
-rw-r--r--src/tidy_tls.c36
1 files changed, 18 insertions, 18 deletions
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;
 }
e516ff8b8b90af6c89e8cef90f63407831'>^
dd660682 ^
7a84094a ^
a0331a9b ^
7a84094a ^
51b0936f ^
4f3510d0 ^

760f683f ^
dd660682 ^
4f3510d0 ^
9acf5c0f ^




760f683f ^
050a93ac ^
4a48bedc ^
85b2f61b ^
dd660682 ^
7a84094a ^
a0331a9b ^
7a84094a ^
51b0936f ^
4f3510d0 ^

760f683f ^
dd660682 ^
4f3510d0 ^
050a93ac ^


760f683f ^
77d5b5d6 ^
4a48bedc ^
85b2f61b ^
7a84094a ^
ea19d0dc ^
7a84094a ^
748b6865 ^



8fb0e672 ^

760f683f ^
77d5b5d6 ^
4a48bedc ^
85b2f61b ^
7a84094a ^
a0331a9b ^
7a84094a ^
104854ca ^
8fb0e672 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80