diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 2efb58e8..8beb002c 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -2224,7 +2224,7 @@ void ssl3_clear(SSL *s) s->s3->total_renegotiations=0; s->s3->num_renegotiations=0; s->s3->in_read_app_data=0; - s->version=SSL3_VERSION; + s->version = s->method->version; #if !defined(OPENSSL_NO_NEXTPROTONEG) if (s->next_proto_negotiated) diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 182b9ebb..66b25287 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -707,6 +707,11 @@ void SSL_free(SSL *s) if (s->srtp_profiles) sk_SRTP_PROTECTION_PROFILE_free(s->srtp_profiles); + if (s->tlsext_session_ticket) + { + OPENSSL_free(s->tlsext_session_ticket); + } + OPENSSL_free(s); } diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 3d72a63e..3555692a 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -710,9 +710,9 @@ const SSL_METHOD *func_name(void) \ { \ static const SSL_METHOD func_name##_data= { \ version, \ - tls1_new, \ - tls1_clear, \ - tls1_free, \ + ssl3_new, \ + ssl3_clear, \ + ssl3_free, \ s_accept, \ s_connect, \ ssl3_read, \ @@ -731,7 +731,7 @@ const SSL_METHOD *func_name(void) \ ssl3_num_ciphers, \ ssl3_get_cipher, \ s_get_meth, \ - tls1_default_timeout, \ + ssl3_default_timeout, \ &enc_data, \ ssl_undefined_void_function, \ ssl3_callback_ctrl, \ @@ -780,9 +780,9 @@ const SSL_METHOD *func_name(void) \ { \ static const SSL_METHOD func_name##_data= { \ TLS1_2_VERSION, \ - tls1_new, \ - tls1_clear, \ - tls1_free, \ + ssl3_new, \ + ssl3_clear, \ + ssl3_free, \ s_accept, \ s_connect, \ ssl23_read, \ @@ -1054,12 +1054,6 @@ int ssl23_connect(SSL *s); int ssl23_read_bytes(SSL *s, int n); int ssl23_write_bytes(SSL *s); -int tls1_new(SSL *s); -void tls1_free(SSL *s); -void tls1_clear(SSL *s); -long tls1_ctrl(SSL *s,int cmd, long larg, void *parg); -long tls1_callback_ctrl(SSL *s,int cmd, void (*fp)(void)); - int dtls1_new(SSL *s); int dtls1_accept(SSL *s); int dtls1_connect(SSL *s); diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index a8004a7e..e79d4a5d 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -182,35 +182,6 @@ SSL3_ENC_METHOD TLSv1_2_enc_data={ ssl3_handshake_write }; -long tls1_default_timeout(void) - { - /* 2 hours, the 24 hours mentioned in the TLSv1 spec - * is way too long for http, the cache would over fill */ - return(60*60*2); - } - -int tls1_new(SSL *s) - { - if (!ssl3_new(s)) return(0); - s->method->ssl_clear(s); - return(1); - } - -void tls1_free(SSL *s) - { - if (s->tlsext_session_ticket) - { - OPENSSL_free(s->tlsext_session_ticket); - } - ssl3_free(s); - } - -void tls1_clear(SSL *s) - { - ssl3_clear(s); - s->version = s->method->version; - } - static int compare_uint16_t(const void *p1, const void *p2) { uint16_t u1 = *((const uint16_t*)p1);