diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-05-20 15:01:49 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-05-20 15:02:54 +0200 |
commit | ac1f960d4ac4345b5ec2f766cdc69e47632136d6 (patch) | |
tree | 050d8db7a8cfbe6614a32e3862768bcfdfca9d62 /lib/buffers.c | |
parent | 369a364007a141c73831e95b60be4cd81eec0d63 (diff) | |
download | gnutls-ac1f960d4ac4345b5ec2f766cdc69e47632136d6.tar.gz |
Allow for conditional compilation of SSL 2.0 client hello support
This allows to completely remove SSL 2.0 support by calling configure
with the '--disable-ssl2-support' option.
Relates #97
Diffstat (limited to 'lib/buffers.c')
-rw-r--r-- | lib/buffers.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/buffers.c b/lib/buffers.c index e43a0c4b5d..f0faa709ae 100644 --- a/lib/buffers.c +++ b/lib/buffers.c @@ -887,6 +887,7 @@ parse_handshake_header(gnutls_session_t session, mbuffer_st * bufel, dataptr = _mbuffer_get_udata_ptr(bufel); /* if reading a client hello of SSLv2 */ +#ifdef ENABLE_SSL2 if (unlikely (!IS_DTLS(session) && bufel->htype == GNUTLS_HANDSHAKE_CLIENT_HELLO_V2)) { @@ -903,7 +904,9 @@ parse_handshake_header(gnutls_session_t session, mbuffer_st * bufel, hsk->sequence = 0; hsk->start_offset = 0; hsk->end_offset = hsk->length; - } else { /* TLS or DTLS handshake headers */ + } else +#endif + { /* TLS or DTLS handshake headers */ hsk->htype = dataptr[0]; @@ -1075,7 +1078,10 @@ inline static int cmp_hsk_types(gnutls_handshake_description_t expected, gnutls_handshake_description_t recvd) { if ((expected != GNUTLS_HANDSHAKE_CLIENT_HELLO - || recvd != GNUTLS_HANDSHAKE_CLIENT_HELLO_V2) +#ifdef ENABLE_SSL2 + || recvd != GNUTLS_HANDSHAKE_CLIENT_HELLO_V2 +#endif + ) && (expected != recvd)) return 0; |