Use OPENSSL_NO_DTLS instead of OPENSSL_NO_DTLS1

Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Kurt Roeckx 2015-12-12 11:12:22 +01:00
parent 8ca8fc4804
commit a5ecdc6af8
4 changed files with 14 additions and 20 deletions

View File

@ -823,7 +823,7 @@ my @disablables = (
"dh", "dh",
"dsa", "dsa",
"dso", "dso",
"dtls1?", "dtls",
"dynamic[-_]engine", "dynamic[-_]engine",
"ec", "ec",
"ec2m", "ec2m",

View File

@ -761,8 +761,8 @@ static void list_disabled(void)
#ifdef OPENSSL_NO_DSA #ifdef OPENSSL_NO_DSA
BIO_puts(bio_out, "DSA\n"); BIO_puts(bio_out, "DSA\n");
#endif #endif
#if defined(OPENSSL_NO_DTLS1) || defined(OPENSSL_NO_DTLS) #if defined(OPENSSL_NO_DTLS)
BIO_puts(bio_out, "DTLS1\n"); BIO_puts(bio_out, "DTLS\n");
#endif #endif
#ifdef OPENSSL_NO_EC #ifdef OPENSSL_NO_EC
BIO_puts(bio_out, "EC\n"); BIO_puts(bio_out, "EC\n");

View File

@ -567,7 +567,7 @@ OPTIONS s_client_options[] = {
#ifndef OPENSSL_NO_SSL3 #ifndef OPENSSL_NO_SSL3
{"ssl3", OPT_SSL3, '-', "Just use SSLv3"}, {"ssl3", OPT_SSL3, '-', "Just use SSLv3"},
#endif #endif
#ifndef OPENSSL_NO_DTLS1 #ifndef OPENSSL_NO_DTLS
{"dtls", OPT_DTLS, '-'}, {"dtls", OPT_DTLS, '-'},
{"dtls1", OPT_DTLS1, '-', "Just use DTLSv1"}, {"dtls1", OPT_DTLS1, '-', "Just use DTLSv1"},
{"dtls1_2", OPT_DTLS1_2, '-'}, {"dtls1_2", OPT_DTLS1_2, '-'},
@ -954,7 +954,7 @@ int s_client_main(int argc, char **argv)
case OPT_TLS1: case OPT_TLS1:
meth = TLSv1_client_method(); meth = TLSv1_client_method();
break; break;
#ifndef OPENSSL_NO_DTLS1 #ifndef OPENSSL_NO_DTLS
case OPT_DTLS: case OPT_DTLS:
meth = DTLS_client_method(); meth = DTLS_client_method();
socket_type = SOCK_DGRAM; socket_type = SOCK_DGRAM;

View File

@ -259,7 +259,7 @@ static const char *session_id_prefix = NULL;
static int enable_timeouts = 0; static int enable_timeouts = 0;
static long socket_mtu; static long socket_mtu;
#ifndef OPENSSL_NO_DTLS1 #ifndef OPENSSL_NO_DTLS
static int cert_chain = 0; static int cert_chain = 0;
#endif #endif
static int dtlslisten = 0; static int dtlslisten = 0;
@ -936,7 +936,7 @@ OPTIONS s_server_options[] = {
#ifndef OPENSSL_NO_SSL3 #ifndef OPENSSL_NO_SSL3
{"ssl3", OPT_SSL3, '-', "Just talk SSLv3"}, {"ssl3", OPT_SSL3, '-', "Just talk SSLv3"},
#endif #endif
#ifndef OPENSSL_NO_DTLS1 #ifndef OPENSSL_NO_DTLS
{"dtls", OPT_DTLS, '-'}, {"dtls", OPT_DTLS, '-'},
{"dtls1", OPT_DTLS1, '-', "Just talk DTLSv1"}, {"dtls1", OPT_DTLS1, '-', "Just talk DTLSv1"},
{"dtls1_2", OPT_DTLS1_2, '-', "Just talk DTLSv1.2"}, {"dtls1_2", OPT_DTLS1_2, '-', "Just talk DTLSv1.2"},
@ -1044,13 +1044,14 @@ int s_server_main(int argc, char *argv[])
case OPT_PSK_HINT: case OPT_PSK_HINT:
case OPT_PSK: case OPT_PSK:
#endif #endif
#ifdef OPENSSL_NO_DTLS1 #ifdef OPENSSL_NO_DTLS
case OPT_DTLS: case OPT_DTLS:
case OPT_DTLS1: case OPT_DTLS1:
case OPT_DTLS1_2: case OPT_DTLS1_2:
case OPT_TIMEOUT: case OPT_TIMEOUT:
case OPT_MTU: case OPT_MTU:
case OPT_CHAIN: case OPT_CHAIN:
case OPT_LISTEN:
#endif #endif
case OPT_EOF: case OPT_EOF:
case OPT_ERR: case OPT_ERR:
@ -1355,7 +1356,7 @@ int s_server_main(int argc, char *argv[])
case OPT_TLS1: case OPT_TLS1:
meth = TLSv1_server_method(); meth = TLSv1_server_method();
break; break;
#ifndef OPENSSL_NO_DTLS1 #ifndef OPENSSL_NO_DTLS
case OPT_DTLS: case OPT_DTLS:
meth = DTLS_server_method(); meth = DTLS_server_method();
socket_type = SOCK_DGRAM; socket_type = SOCK_DGRAM;
@ -1380,15 +1381,6 @@ int s_server_main(int argc, char *argv[])
case OPT_LISTEN: case OPT_LISTEN:
dtlslisten = 1; dtlslisten = 1;
break; break;
#else
case OPT_DTLS:
case OPT_DTLS1:
case OPT_DTLS1_2:
case OPT_TIMEOUT:
case OPT_MTU:
case OPT_CHAIN:
case OPT_LISTEN:
break;
#endif #endif
case OPT_ID_PREFIX: case OPT_ID_PREFIX:
session_id_prefix = opt_arg(); session_id_prefix = opt_arg();
@ -1444,7 +1436,7 @@ int s_server_main(int argc, char *argv[])
argc = opt_num_rest(); argc = opt_num_rest();
argv = opt_rest(); argv = opt_rest();
#ifndef OPENSSL_NO_DTLS1 #ifndef OPENSSL_NO_DTLS
if (www && socket_type == SOCK_DGRAM) { if (www && socket_type == SOCK_DGRAM) {
BIO_printf(bio_err, "Can't use -HTTP, -www or -WWW with DTLS\n"); BIO_printf(bio_err, "Can't use -HTTP, -www or -WWW with DTLS\n");
goto end; goto end;
@ -2419,9 +2411,11 @@ static int init_ssl_connection(SSL *con)
unsigned next_proto_neg_len; unsigned next_proto_neg_len;
#endif #endif
unsigned char *exportedkeymat; unsigned char *exportedkeymat;
#ifndef OPENSSL_NO_DTLS
struct sockaddr_storage client; struct sockaddr_storage client;
#endif
#ifndef OPENSSL_NO_DTLS1 #ifndef OPENSSL_NO_DTLS
if(dtlslisten) { if(dtlslisten) {
i = DTLSv1_listen(con, &client); i = DTLSv1_listen(con, &client);
if (i > 0) { if (i > 0) {