From 9cbd4a809e02b47b4226642bcd208db6726c3df9 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sun, 23 Nov 2014 14:46:34 -0500 Subject: [PATCH] Remove SSL_(CTX_)get_ssl_method. We intend to deprecate the version-locked methods and unify them. Don't expose that there's a method swap. (The existing version-locked methods will merely be a shorthand for configuring minimum/maximum versions.) There is one consumer of SSL_get_ssl_method in internal code, but it's just some logging in test-only code. All it's doing is getting the version as a string which should be SSL_get_version instead. While here, also remove dead ssl_bad_method function. Also the bogus ssl_crock_st forward-declaration. The forward declaration in base.h should be perfectly sufficient. Change-Id: I50480808f51022e05b078a285f58ec85d5ad7c8e Reviewed-on: https://boringssl-review.googlesource.com/2408 Reviewed-by: Adam Langley --- include/openssl/ssl.h | 6 ------ ssl/ssl_lib.c | 16 ---------------- ssl/ssl_locl.h | 2 -- 3 files changed, 24 deletions(-) diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index b5e0d8bf4..cc47bdee2 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -276,10 +276,6 @@ extern "C" { #define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1 #define SSL_FILETYPE_PEM X509_FILETYPE_PEM -/* This is needed to stop compilers complaining about the - * 'struct ssl_st *' function parameters used to prototype callbacks - * in SSL_CTX. */ -typedef struct ssl_st *ssl_crock_st; typedef struct ssl_method_st SSL_METHOD; typedef struct ssl_cipher_st SSL_CIPHER; typedef struct ssl_session_st SSL_SESSION; @@ -2053,8 +2049,6 @@ OPENSSL_EXPORT int SSL_renegotiate_abbreviated(SSL *s); OPENSSL_EXPORT int SSL_renegotiate_pending(SSL *s); OPENSSL_EXPORT int SSL_shutdown(SSL *s); -OPENSSL_EXPORT const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx); -OPENSSL_EXPORT const SSL_METHOD *SSL_get_ssl_method(SSL *s); OPENSSL_EXPORT const char *SSL_alert_type_string_long(int value); OPENSSL_EXPORT const char *SSL_alert_type_string(int value); OPENSSL_EXPORT const char *SSL_alert_desc_string_long(int value); diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 4cbf86ddd..2a20248f0 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -2284,16 +2284,6 @@ void ssl_update_cache(SSL *s,int mode) } } -const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx) - { - return ctx->method; - } - -const SSL_METHOD *SSL_get_ssl_method(SSL *s) - { - return(s->method); - } - int SSL_get_error(const SSL *s,int i) { int reason; @@ -2446,12 +2436,6 @@ int ssl_undefined_const_function(const SSL *s) return(0); } -SSL_METHOD *ssl_bad_method(int ver) - { - OPENSSL_PUT_ERROR(SSL, ssl_bad_method, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return(NULL); - } - static const char *ssl_get_version(int version) { if (version == TLS1_2_VERSION) diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 23b8be20e..9b0c8f3e3 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -640,8 +640,6 @@ extern SSL3_ENC_METHOD ssl3_undef_enc_method; extern const SSL_CIPHER ssl3_ciphers[]; -SSL_METHOD *ssl_bad_method(int ver); - extern SSL3_ENC_METHOD TLSv1_enc_data; extern SSL3_ENC_METHOD TLSv1_1_enc_data; extern SSL3_ENC_METHOD TLSv1_2_enc_data;