This repository was archived by the owner on Jun 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathgnutls-patch-2.10.4.diff
135 lines (119 loc) · 4.55 KB
/
gnutls-patch-2.10.4.diff
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
--- src/gnutls-2.10.4/src/serv.c 2011-02-01 16:30:13.000000000 +0100
+++ tmp/gnutls-2.10.4/src/serv.c 2010-12-06 14:04:44.000000000 +0100
@@ -438,8 +438,7 @@
/* Creates html with the current session information.
*/
-#define tmp2b &http_buffer[strlen(http_buffer)]
-#define tmp2l len-strlen(http_buffer)
+#define tmp2 &http_buffer[strlen(http_buffer)], len-strlen(http_buffer)
static char *
peer_print_info (gnutls_session_t session, int *ret_length,
const char *header)
@@ -513,11 +512,11 @@
/* print session_id */
gnutls_session_get_id (session, sesid, &sesid_size);
- snprintf (tmp2b, tmp2l, "\n<p>Session ID: <i>");
+ snprintf (tmp2, "\n<p>Session ID: <i>");
for (i = 0; i < sesid_size; i++)
- snprintf (tmp2b, tmp2l, "%.2X", sesid[i]);
- snprintf (tmp2b, tmp2l, "</i></p>\n");
- snprintf (tmp2b, tmp2l,
+ snprintf (tmp2, "%.2X", sesid[i]);
+ snprintf (tmp2, "</i></p>\n");
+ snprintf (tmp2,
"<h5>If your browser supports session resuming, then you should see the "
"same session ID, when you press the <b>reload</b> button.</h5>\n");
@@ -531,7 +530,7 @@
if (gnutls_server_name_get (session, dns, &dns_size, &type, 0) == 0)
{
- snprintf (tmp2b, tmp2l, "\n<p>Server Name: %s</p>\n", dns);
+ snprintf (tmp2, "\n<p>Server Name: %s</p>\n", dns);
}
}
@@ -542,7 +541,7 @@
#ifdef ENABLE_SRP
if (kx_alg == GNUTLS_KX_SRP)
{
- snprintf (tmp2b, tmp2l, "<p>Connected as user '%s'.</p>\n",
+ snprintf (tmp2, "<p>Connected as user '%s'.</p>\n",
gnutls_srp_server_get_username (session));
}
#endif
@@ -550,7 +549,7 @@
#ifdef ENABLE_PSK
if (kx_alg == GNUTLS_KX_PSK)
{
- snprintf (tmp2b, tmp2l, "<p>Connected as user '%s'.</p>\n",
+ snprintf (tmp2, "<p>Connected as user '%s'.</p>\n",
gnutls_psk_server_get_username (session));
}
#endif
@@ -558,7 +557,7 @@
#ifdef ENABLE_ANON
if (kx_alg == GNUTLS_KX_ANON_DH)
{
- snprintf (tmp2b, tmp2l,
+ snprintf (tmp2,
"<p> Connect using anonymous DH (prime of %d bits)</p>\n",
gnutls_dh_get_prime_bits (session));
}
@@ -566,7 +565,7 @@
if (kx_alg == GNUTLS_KX_DHE_RSA || kx_alg == GNUTLS_KX_DHE_DSS)
{
- snprintf (tmp2b, tmp2l,
+ snprintf (tmp2,
"Ephemeral DH using prime of <b>%d</b> bits.<br>\n",
gnutls_dh_get_prime_bits (session));
}
@@ -577,7 +576,7 @@
tmp = gnutls_protocol_get_name (gnutls_protocol_get_version (session));
if (tmp == NULL)
tmp = str_unknown;
- snprintf (tmp2b, tmp2l,
+ snprintf (tmp2,
"<TABLE border=1><TR><TD>Protocol version:</TD><TD>%s</TD></TR>\n",
tmp);
@@ -588,44 +587,44 @@
(session));
if (tmp == NULL)
tmp = str_unknown;
- snprintf (tmp2b, tmp2l, "<TR><TD>Certificate Type:</TD><TD>%s</TD></TR>\n", tmp);
+ snprintf (tmp2, "<TR><TD>Certificate Type:</TD><TD>%s</TD></TR>\n", tmp);
}
tmp = gnutls_kx_get_name (kx_alg);
if (tmp == NULL)
tmp = str_unknown;
- snprintf (tmp2b, tmp2l, "<TR><TD>Key Exchange:</TD><TD>%s</TD></TR>\n", tmp);
+ snprintf (tmp2, "<TR><TD>Key Exchange:</TD><TD>%s</TD></TR>\n", tmp);
tmp = gnutls_compression_get_name (gnutls_compression_get (session));
if (tmp == NULL)
tmp = str_unknown;
- snprintf (tmp2b, tmp2l, "<TR><TD>Compression</TD><TD>%s</TD></TR>\n", tmp);
+ snprintf (tmp2, "<TR><TD>Compression</TD><TD>%s</TD></TR>\n", tmp);
tmp = gnutls_cipher_get_name (gnutls_cipher_get (session));
if (tmp == NULL)
tmp = str_unknown;
- snprintf (tmp2b, tmp2l, "<TR><TD>Cipher</TD><TD>%s</TD></TR>\n", tmp);
+ snprintf (tmp2, "<TR><TD>Cipher</TD><TD>%s</TD></TR>\n", tmp);
tmp = gnutls_mac_get_name (gnutls_mac_get (session));
if (tmp == NULL)
tmp = str_unknown;
- snprintf (tmp2b, tmp2l, "<TR><TD>MAC</TD><TD>%s</TD></TR>\n", tmp);
+ snprintf (tmp2, "<TR><TD>MAC</TD><TD>%s</TD></TR>\n", tmp);
tmp = gnutls_cipher_suite_get_name (kx_alg,
gnutls_cipher_get (session),
gnutls_mac_get (session));
if (tmp == NULL)
tmp = str_unknown;
- snprintf (tmp2b, tmp2l, "<TR><TD>Ciphersuite</TD><TD>%s</TD></TR></p></TABLE>\n",
+ snprintf (tmp2, "<TR><TD>Ciphersuite</TD><TD>%s</TD></TR></p></TABLE>\n",
tmp);
if (crtinfo)
{
- snprintf(tmp2b, tmp2l, "<hr><PRE>%s\n</PRE>\n", crtinfo);
+ snprintf(tmp2, "<hr><PRE>%s\n</PRE>\n", crtinfo);
free (crtinfo);
}
- snprintf(tmp2b, tmp2l, "<hr><P>Your HTTP header was:<PRE>%s</PRE></P>\n" HTTP_END, header);
+ snprintf(tmp2, "<hr><P>Your HTTP header was:<PRE>%s</PRE></P>\n" HTTP_END, header);
*ret_length = strlen (http_buffer);