Version 1.1.6
- Several bug fixes, by Arne Thomassen.
+- Fixed a bug where 'server name' extension was always sent.
Version 1.1.5 (06/01/2004)
- Added the gnutls_sign_algorithm type.
\index{Compression algorithms}
The TLS' record layer also supports compression. The algorithms
implemented in \gnutls{} can be found in figure \ref{fig:compression}.
-All the algorithms except for ZLIB which is referenced in \cite{TLSCOMP}, should be
+All the algorithms except for DEFLATE which is referenced in \cite{TLSCOMP}, should be
considered as \gnutls' extensions\footnote{You should use \printfunc{gnutls_handshake_set_private_extensions}{gnutls\_handshake\_set\_private\_extensions}
to enable private extensions.}, and
should be advertised only when the peer is known to have a compliant client,
\begin{tabular}{|l|p{9cm}|}
\hline
-ZLIB & ZLIB compression, using the deflate algorithm.
+DEFLATE & Zlib compression, using the deflate algorithm.
\\
\hline
LZO & LZO is a very fast compression algorithm. This algorithm is only
*/
if (session->security_parameters.entity == GNUTLS_CLIENT) {
- /* uint16 */
+ if (session->security_parameters.extensions.server_names_size == 0)
+ return 0;
+
+ /* uint16
+ */
total_size = 2;
for (i = 0;
i < session->security_parameters.extensions.server_names_size;
*/
#define GNUTLS_MAX_ALGORITHM_NUM 16
+#define GNUTLS_COMP_ZLIB GNUTLS_COMP_DEFLATE
typedef enum gnutls_compression_method { GNUTLS_COMP_NULL=1,
- GNUTLS_COMP_ZLIB,
+ GNUTLS_COMP_DEFLATE,
GNUTLS_COMP_LZO /* only available if gnutls-extra has been initialized
*/
} gnutls_compression_method;
return GNUTLS_E_MEMORY_ERROR;
}
+fprintf(stderr, "Data type: [%d]\n", next);
/* write extension type */
_gnutls_write_uint16( next, &(*data)[pos]);
pos+=2;
+fprintf(stderr, "Data size: %d\n", size);
/* write size */
_gnutls_write_uint16( size, &(*data)[pos]);
pos-=2; /* remove the size of the size header! */
_gnutls_write_uint16( pos, (*data));
+fprintf(stderr, "Total size: %d\n", pos);
if (size==2) { /* empty */
size = 0;
static gnutls_anon_client_credentials anon_cred;
static gnutls_certificate_credentials xcred;
-int protocol_priority[PRI_MAX] = { GNUTLS_TLS1_1, GNUTLS_TLS1, GNUTLS_SSL3, 0 };
+int protocol_priority[PRI_MAX] = { GNUTLS_TLS1_1, GNUTLS_TLS1_0, GNUTLS_SSL3, 0 };
int kx_priority[PRI_MAX] =
{ GNUTLS_KX_RSA, GNUTLS_KX_DHE_DSS, GNUTLS_KX_DHE_RSA, GNUTLS_KX_SRP,
/* Do not use anonymous authentication, unless you know what that means */
/* allow the use of private ciphersuites.
*/
- if (disable_extensions == 0)
+ if (disable_extensions == 0) {
gnutls_handshake_set_private_extensions(session, 1);
-
- if (disable_extensions == 0)
gnutls_server_name_set(session, GNUTLS_NAME_DNS, hostname,
strlen(hostname));
+ gnutls_certificate_type_set_priority(session, cert_type_priority);
+ }
gnutls_cipher_set_priority(session, cipher_priority);
gnutls_compression_set_priority(session, comp_priority);
gnutls_kx_set_priority(session, kx_priority);
gnutls_protocol_set_priority(session, protocol_priority);
gnutls_mac_set_priority(session, mac_priority);
- gnutls_certificate_type_set_priority(session, cert_type_priority);
+
gnutls_dh_set_prime_bits(session, 512);
protocol_priority[j++] = GNUTLS_SSL3;
else if (strncasecmp(protocols[i], "TLS1.1", 6) == 0)
protocol_priority[j++] = GNUTLS_TLS1_1;
- else if (strncasecmp(protocols[i], "TLS", 6) == 0)
- protocol_priority[j++] = GNUTLS_TLS1;
+ else if (strncasecmp(protocols[i], "TLS", 3) == 0)
+ protocol_priority[j++] = GNUTLS_TLS1_0;
else fprintf(stderr, "Unknown protocol: '%s'\n", protocols[i]);
}
protocol_priority[j] = 0;