From 343d327fc13befa69643d8929e2c9e176e532b9d Mon Sep 17 00:00:00 2001 From: jsing <> Date: Thu, 26 Jan 2017 00:42:44 +0000 Subject: Remove ssl3_undef_enc_method - if we have internal bugs we want to segfault so that we can debug it, rather than adding a "should not be called" error to the stack. Discussed with beck@ --- src/lib/libssl/ssl_lib.c | 29 +---------------------------- src/lib/libssl/ssl_locl.h | 3 +-- src/lib/libssl/t1_clnt.c | 4 ++-- src/lib/libssl/t1_meth.c | 4 ++-- src/lib/libssl/t1_srvr.c | 4 ++-- 5 files changed, 8 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 8afb4909c3..649b238bd9 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.150 2017/01/25 10:54:23 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.151 2017/01/26 00:42:44 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -159,33 +159,6 @@ const char *SSL_version_str = OPENSSL_VERSION_TEXT; -SSL3_ENC_METHOD ssl3_undef_enc_method = { - /* - * Evil casts, but these functions are only called if there's a - * library bug. - */ - .enc = (int (*)(SSL *, int))ssl_undefined_function, - .mac = (int (*)(SSL *, unsigned char *, int))ssl_undefined_function, - .setup_key_block = ssl_undefined_function, - .generate_master_secret = (int (*)(SSL *, unsigned char *, - unsigned char *, int))ssl_undefined_function, - .change_cipher_state = (int (*)(SSL*, int))ssl_undefined_function, - .final_finish_mac = (int (*)(SSL *, const char*, int, - unsigned char *))ssl_undefined_function, - .finish_mac_length = 0, - .cert_verify_mac = (int (*)(SSL *, int, - unsigned char *))ssl_undefined_function, - .client_finished_label = NULL, - .client_finished_label_len = 0, - .server_finished_label = NULL, - .server_finished_label_len = 0, - .alert_value = (int (*)(int))ssl_undefined_function, - .export_keying_material = (int (*)(SSL *, unsigned char *, size_t, - const char *, size_t, const unsigned char *, size_t, - int use_context))ssl_undefined_function, - .enc_flags = 0, -}; - int SSL_clear(SSL *s) { diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index 7c3fb4f5e4..b682fc062e 100644 --- a/src/lib/libssl/ssl_locl.h +++ b/src/lib/libssl/ssl_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_locl.h,v 1.167 2017/01/25 10:54:23 jsing Exp $ */ +/* $OpenBSD: ssl_locl.h,v 1.168 2017/01/26 00:42:44 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1074,7 +1074,6 @@ struct ssl_aead_ctx_st { char variable_nonce_in_record; }; -extern SSL3_ENC_METHOD ssl3_undef_enc_method; extern SSL_CIPHER ssl3_ciphers[]; const char *ssl_version_string(int ver); diff --git a/src/lib/libssl/t1_clnt.c b/src/lib/libssl/t1_clnt.c index 5b8f7cd412..d185df3c79 100644 --- a/src/lib/libssl/t1_clnt.c +++ b/src/lib/libssl/t1_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_clnt.c,v 1.22 2017/01/23 13:36:13 jsing Exp $ */ +/* $OpenBSD: t1_clnt.c,v 1.23 2017/01/26 00:42:44 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -88,7 +88,7 @@ static const SSL_METHOD_INTERNAL TLS_client_method_internal_data = { .ssl_get_message = ssl3_get_message, .ssl_read_bytes = ssl3_read_bytes, .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &ssl3_undef_enc_method, + .ssl3_enc = NULL, }; static const SSL_METHOD TLS_client_method_data = { diff --git a/src/lib/libssl/t1_meth.c b/src/lib/libssl/t1_meth.c index 51c129b2c9..d6262e48cd 100644 --- a/src/lib/libssl/t1_meth.c +++ b/src/lib/libssl/t1_meth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_meth.c,v 1.21 2017/01/23 13:36:13 jsing Exp $ */ +/* $OpenBSD: t1_meth.c,v 1.22 2017/01/26 00:42:44 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -86,7 +86,7 @@ static const SSL_METHOD_INTERNAL TLS_method_internal_data = { .ssl_get_message = ssl3_get_message, .ssl_read_bytes = ssl3_read_bytes, .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &ssl3_undef_enc_method, + .ssl3_enc = NULL, }; static const SSL_METHOD TLS_method_data = { diff --git a/src/lib/libssl/t1_srvr.c b/src/lib/libssl/t1_srvr.c index 3083ed65a4..69da5cbb67 100644 --- a/src/lib/libssl/t1_srvr.c +++ b/src/lib/libssl/t1_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_srvr.c,v 1.23 2017/01/23 13:36:13 jsing Exp $ */ +/* $OpenBSD: t1_srvr.c,v 1.24 2017/01/26 00:42:44 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -89,7 +89,7 @@ static const SSL_METHOD_INTERNAL TLS_server_method_internal_data = { .ssl_get_message = ssl3_get_message, .ssl_read_bytes = ssl3_read_bytes, .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &ssl3_undef_enc_method, + .ssl3_enc = NULL, }; static const SSL_METHOD TLS_server_method_data = { -- cgit v1.2.3-55-g6feb