X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fmethods.c;h=6cd83dd5dd82889e14ac184df61651d43eed47b9;hp=4e7093ed3cb1899f7fbd6d64da56ecb09edb664d;hb=54bb8f74bd3931f801472e86c481c80f868c2b91;hpb=8ba708e5166b02ab61f2762d36b3e7b7455e9c06 diff --git a/ssl/methods.c b/ssl/methods.c index 4e7093ed3c..6cd83dd5dd 100644 --- a/ssl/methods.c +++ b/ssl/methods.c @@ -1,4 +1,3 @@ -/* ssl/t1_meth.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -121,12 +120,18 @@ static const SSL_METHOD *tls1_get_method(int ver) { if (ver == TLS_ANY_VERSION) return TLS_method(); +#ifndef OPENSSL_NO_TLS1_2 if (ver == TLS1_2_VERSION) return TLSv1_2_method(); +#endif +#ifndef OPENSSL_NO_TLS1_1 if (ver == TLS1_1_VERSION) return TLSv1_1_method(); +#endif +#ifndef OPENSSL_NO_TLS1 if (ver == TLS1_VERSION) return TLSv1_method(); +#endif #ifndef OPENSSL_NO_SSL3 if (ver == SSL3_VERSION) return (SSLv3_method()); @@ -135,25 +140,35 @@ static const SSL_METHOD *tls1_get_method(int ver) return NULL; } -IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, TLS_method, - statem_accept, - statem_connect, tls1_get_method, TLSv1_2_enc_data) +IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0, + TLS_method, + ossl_statem_accept, + ossl_statem_connect, tls1_get_method, TLSv1_2_enc_data) -IMPLEMENT_tls_meth_func(TLS1_2_VERSION, TLSv1_2_method, - statem_accept, - statem_connect, tls1_get_method, TLSv1_2_enc_data) +#ifndef OPENSSL_NO_TLS1_2_METHOD +IMPLEMENT_tls_meth_func(TLS1_2_VERSION, 0, SSL_OP_NO_TLSv1_2, + TLSv1_2_method, + ossl_statem_accept, + ossl_statem_connect, tls1_get_method, TLSv1_2_enc_data) +#endif -IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_method, - statem_accept, - statem_connect, tls1_get_method, TLSv1_1_enc_data) +#ifndef OPENSSL_NO_TLS1_1_METHOD +IMPLEMENT_tls_meth_func(TLS1_1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_TLSv1_1, + TLSv1_1_method, + ossl_statem_accept, + ossl_statem_connect, tls1_get_method, TLSv1_1_enc_data) +#endif -IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_method, - statem_accept, - statem_connect, tls1_get_method, TLSv1_enc_data) +#ifndef OPENSSL_NO_TLS1_METHOD +IMPLEMENT_tls_meth_func(TLS1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_TLSv1, + TLSv1_method, + ossl_statem_accept, + ossl_statem_connect, tls1_get_method, TLSv1_enc_data) +#endif #ifndef OPENSSL_NO_SSL3_METHOD -IMPLEMENT_ssl3_meth_func(SSLv3_method, - statem_accept, statem_connect, tls1_get_method) +IMPLEMENT_ssl3_meth_func(SSLv3_method, ossl_statem_accept, ossl_statem_connect, + tls1_get_method) #endif @@ -165,12 +180,18 @@ static const SSL_METHOD *tls1_get_server_method(int ver) { if (ver == TLS_ANY_VERSION) return TLS_server_method(); +#ifndef OPENSSL_NO_TLS1_2 if (ver == TLS1_2_VERSION) return TLSv1_2_server_method(); +#endif +#ifndef OPENSSL_NO_TLS1_1 if (ver == TLS1_1_VERSION) return TLSv1_1_server_method(); +#endif +#ifndef OPENSSL_NO_TLS1 if (ver == TLS1_VERSION) return TLSv1_server_method(); +#endif #ifndef OPENSSL_NO_SSL3 if (ver == SSL3_VERSION) return (SSLv3_server_method()); @@ -178,29 +199,39 @@ static const SSL_METHOD *tls1_get_server_method(int ver) return NULL; } -IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, TLS_server_method, - statem_accept, +IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0, + TLS_server_method, + ossl_statem_accept, ssl_undefined_function, tls1_get_server_method, TLSv1_2_enc_data) -IMPLEMENT_tls_meth_func(TLS1_2_VERSION, TLSv1_2_server_method, - statem_accept, +#ifndef OPENSSL_NO_TLS1_2_METHOD +IMPLEMENT_tls_meth_func(TLS1_2_VERSION, 0, SSL_OP_NO_TLSv1_2, + TLSv1_2_server_method, + ossl_statem_accept, ssl_undefined_function, tls1_get_server_method, TLSv1_2_enc_data) +#endif -IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_server_method, - statem_accept, +#ifndef OPENSSL_NO_TLS1_1_METHOD +IMPLEMENT_tls_meth_func(TLS1_1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_TLSv1_1, + TLSv1_1_server_method, + ossl_statem_accept, ssl_undefined_function, tls1_get_server_method, TLSv1_1_enc_data) +#endif -IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_server_method, - statem_accept, +#ifndef OPENSSL_NO_TLS1_METHOD +IMPLEMENT_tls_meth_func(TLS1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_TLSv1, + TLSv1_server_method, + ossl_statem_accept, ssl_undefined_function, tls1_get_server_method, TLSv1_enc_data) +#endif #ifndef OPENSSL_NO_SSL3_METHOD IMPLEMENT_ssl3_meth_func(SSLv3_server_method, - statem_accept, + ossl_statem_accept, ssl_undefined_function, tls1_get_server_method) #endif @@ -213,12 +244,18 @@ static const SSL_METHOD *tls1_get_client_method(int ver) { if (ver == TLS_ANY_VERSION) return TLS_client_method(); +#ifndef OPENSSL_NO_TLS1_2 if (ver == TLS1_2_VERSION) return TLSv1_2_client_method(); +#endif +#ifndef OPENSSL_NO_TLS1_1 if (ver == TLS1_1_VERSION) return TLSv1_1_client_method(); +#endif +#ifndef OPENSSL_NO_TLS1 if (ver == TLS1_VERSION) return TLSv1_client_method(); +#endif #ifndef OPENSSL_NO_SSL3 if (ver == SSL3_VERSION) return (SSLv3_client_method()); @@ -226,29 +263,40 @@ static const SSL_METHOD *tls1_get_client_method(int ver) return NULL; } -IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, TLS_client_method, +IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0, + TLS_client_method, ssl_undefined_function, - statem_connect, + ossl_statem_connect, tls1_get_client_method, TLSv1_2_enc_data) -IMPLEMENT_tls_meth_func(TLS1_2_VERSION, TLSv1_2_client_method, +#ifndef OPENSSL_NO_TLS1_2_METHOD +IMPLEMENT_tls_meth_func(TLS1_2_VERSION, 0, SSL_OP_NO_TLSv1_2, + TLSv1_2_client_method, ssl_undefined_function, - statem_connect, + ossl_statem_connect, tls1_get_client_method, TLSv1_2_enc_data) +#endif -IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_client_method, +#ifndef OPENSSL_NO_TLS1_1_METHOD +IMPLEMENT_tls_meth_func(TLS1_1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_TLSv1_1, + TLSv1_1_client_method, ssl_undefined_function, - statem_connect, + ossl_statem_connect, tls1_get_client_method, TLSv1_1_enc_data) +#endif -IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_client_method, +#ifndef OPENSSL_NO_TLS1_METHOD +IMPLEMENT_tls_meth_func(TLS1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_TLSv1, + TLSv1_client_method, ssl_undefined_function, - statem_connect, tls1_get_client_method, TLSv1_enc_data) + ossl_statem_connect, + tls1_get_client_method, TLSv1_enc_data) +#endif #ifndef OPENSSL_NO_SSL3_METHOD IMPLEMENT_ssl3_meth_func(SSLv3_client_method, ssl_undefined_function, - statem_connect, tls1_get_client_method) + ossl_statem_connect, tls1_get_client_method) #endif @@ -257,29 +305,41 @@ IMPLEMENT_ssl3_meth_func(SSLv3_client_method, */ static const SSL_METHOD *dtls1_get_method(int ver) { - if (ver == DTLS1_VERSION) - return (DTLSv1_method()); + if (ver == DTLS_ANY_VERSION) + return DTLS_method(); +#ifndef OPENSSL_NO_DTLS1 + else if (ver == DTLS1_VERSION) + return DTLSv1_method(); +#endif +#ifndef OPENSSL_NO_DTLS1_2 else if (ver == DTLS1_2_VERSION) - return (DTLSv1_2_method()); + return DTLSv1_2_method(); +#endif else - return (NULL); + return NULL; } -IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, +#ifndef OPENSSL_NO_DTLS1_METHOD +IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_DTLSv1, DTLSv1_method, - statem_accept, - statem_connect, dtls1_get_method, DTLSv1_enc_data) + ossl_statem_accept, + ossl_statem_connect, + dtls1_get_method, DTLSv1_enc_data) +#endif -IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, +#ifndef OPENSSL_NO_DTLS1_2_METHOD +IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, 0, SSL_OP_NO_DTLSv1_2, DTLSv1_2_method, - statem_accept, - statem_connect, dtls1_get_method, DTLSv1_2_enc_data) + ossl_statem_accept, + ossl_statem_connect, + dtls1_get_method, DTLSv1_2_enc_data) +#endif -IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, +IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, 0, 0, DTLS_method, - statem_accept, - statem_connect, dtls1_get_method, DTLSv1_2_enc_data) - + ossl_statem_accept, + ossl_statem_connect, + dtls1_get_method, DTLSv1_2_enc_data) /* * DTLS server methods @@ -287,29 +347,39 @@ IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, static const SSL_METHOD *dtls1_get_server_method(int ver) { - if (ver == DTLS1_VERSION) - return (DTLSv1_server_method()); + if (ver == DTLS_ANY_VERSION) + return DTLS_server_method(); +#ifndef OPENSSL_NO_DTLS1 + else if (ver == DTLS1_VERSION) + return DTLSv1_server_method(); +#endif +#ifndef OPENSSL_NO_DTLS1_2 else if (ver == DTLS1_2_VERSION) - return (DTLSv1_2_server_method()); + return DTLSv1_2_server_method(); +#endif else - return (NULL); + return NULL; } -IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, +#ifndef OPENSSL_NO_DTLS1_METHOD +IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_DTLSv1, DTLSv1_server_method, - statem_accept, + ossl_statem_accept, ssl_undefined_function, dtls1_get_server_method, DTLSv1_enc_data) +#endif -IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, +#ifndef OPENSSL_NO_DTLS1_2_METHOD +IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, 0, SSL_OP_NO_DTLSv1_2, DTLSv1_2_server_method, - statem_accept, + ossl_statem_accept, ssl_undefined_function, dtls1_get_server_method, DTLSv1_2_enc_data) +#endif -IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, +IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, 0, 0, DTLS_server_method, - statem_accept, + ossl_statem_accept, ssl_undefined_function, dtls1_get_server_method, DTLSv1_2_enc_data) @@ -320,28 +390,38 @@ IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, static const SSL_METHOD *dtls1_get_client_method(int ver) { - if (ver == DTLS1_VERSION || ver == DTLS1_BAD_VER) - return (DTLSv1_client_method()); + if (ver == DTLS_ANY_VERSION) + return DTLS_client_method(); +#ifndef OPENSSL_NO_DTLS1 + else if (ver == DTLS1_VERSION || ver == DTLS1_BAD_VER) + return DTLSv1_client_method(); +#endif +#ifndef OPENSSL_NO_DTLS1_2 else if (ver == DTLS1_2_VERSION) - return (DTLSv1_2_client_method()); + return DTLSv1_2_client_method(); +#endif else - return (NULL); + return NULL; } -IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, +#ifndef OPENSSL_NO_DTLS1_METHOD +IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_DTLSv1, DTLSv1_client_method, ssl_undefined_function, - statem_connect, + ossl_statem_connect, dtls1_get_client_method, DTLSv1_enc_data) +#endif -IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, +#ifndef OPENSSL_NO_DTLS1_2_METHOD +IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, 0, SSL_OP_NO_DTLSv1_2, DTLSv1_2_client_method, ssl_undefined_function, - statem_connect, + ossl_statem_connect, dtls1_get_client_method, DTLSv1_2_enc_data) +#endif -IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, +IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, 0, 0, DTLS_client_method, ssl_undefined_function, - statem_connect, + ossl_statem_connect, dtls1_get_client_method, DTLSv1_2_enc_data)