From: Matt Caswell Date: Thu, 29 Sep 2016 21:32:36 +0000 (+0100) Subject: Remove ssl_set_handshake_header() X-Git-Tag: OpenSSL_1_1_1-pre1~3407 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e2726ce64dc0762d9678fb10639b0f42d9abfc52;p=oweals%2Fopenssl.git Remove ssl_set_handshake_header() Remove the old ssl_set_handshake_header() implementations. Later we will rename ssl_set_handshake_header2() to ssl_set_handshake_header(). Reviewed-by: Rich Salz --- diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index f34818bbcd..27b8ccb162 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -22,7 +22,6 @@ #endif static void get_current_time(struct timeval *t); -static int dtls1_set_handshake_header(SSL *s, int type, unsigned long len); static int dtls1_handshake_write(SSL *s); static unsigned int dtls1_link_min_mtu(void); @@ -43,7 +42,6 @@ const SSL3_ENC_METHOD DTLSv1_enc_data = { tls1_export_keying_material, SSL_ENC_FLAG_DTLS | SSL_ENC_FLAG_EXPLICIT_IV, DTLS1_HM_HEADER_LENGTH, - dtls1_set_handshake_header, dtls1_set_handshake_header2, dtls1_close_construct_packet, dtls1_handshake_write @@ -64,7 +62,6 @@ const SSL3_ENC_METHOD DTLSv1_2_enc_data = { SSL_ENC_FLAG_DTLS | SSL_ENC_FLAG_EXPLICIT_IV | SSL_ENC_FLAG_SIGALGS | SSL_ENC_FLAG_SHA256_PRF | SSL_ENC_FLAG_TLS1_2_CIPHERS, DTLS1_HM_HEADER_LENGTH, - dtls1_set_handshake_header, dtls1_set_handshake_header2, dtls1_close_construct_packet, dtls1_handshake_write @@ -861,19 +858,6 @@ int DTLSv1_listen(SSL *s, BIO_ADDR *client) } #endif -static int dtls1_set_handshake_header(SSL *s, int htype, unsigned long len) -{ - dtls1_set_message_header(s, htype, len, 0, len); - s->init_num = (int)len + DTLS1_HM_HEADER_LENGTH; - s->init_off = 0; - /* Buffer the message to handle re-xmits */ - - if (!dtls1_buffer_message(s, 0)) - return 0; - - return 1; -} - static int dtls1_handshake_write(SSL *s) { return dtls1_do_write(s, SSL3_RT_HANDSHAKE); diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index ea607a51b9..02cf88be45 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -2750,7 +2750,6 @@ const SSL3_ENC_METHOD SSLv3_enc_data = { int use_context))ssl_undefined_function, 0, SSL3_HM_HEADER_LENGTH, - ssl3_set_handshake_header, ssl3_set_handshake_header2, tls_close_construct_packet, ssl3_handshake_write @@ -2778,17 +2777,6 @@ const SSL_CIPHER *ssl3_get_cipher(unsigned int u) return (NULL); } -int ssl3_set_handshake_header(SSL *s, int htype, unsigned long len) -{ - unsigned char *p = (unsigned char *)s->init_buf->data; - *(p++) = htype; - l2n3(len, p); - s->init_num = (int)len + SSL3_HM_HEADER_LENGTH; - s->init_off = 0; - - return 1; -} - /* * Temporary name. To be renamed ssl3_set_handshake_header() once all WPACKET * conversion is complete. The old ssl3_set_handshake_heder() can be deleted diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index bad9ff72df..cd44e37f41 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -1584,8 +1584,6 @@ typedef struct ssl3_enc_method { /* Handshake header length */ unsigned int hhlen; /* Set the handshake header */ - int (*set_handshake_header) (SSL *s, int type, unsigned long len); - /* Set the handshake header */ int (*set_handshake_header2) (SSL *s, WPACKET *pkt, int type); /* Close construction of the handshake message */ int (*close_construct_packet) (SSL *s, WPACKET *pkt); @@ -1596,8 +1594,6 @@ typedef struct ssl3_enc_method { # define SSL_HM_HEADER_LENGTH(s) s->method->ssl3_enc->hhlen # define ssl_handshake_start(s) \ (((unsigned char *)s->init_buf->data) + s->method->ssl3_enc->hhlen) -# define ssl_set_handshake_header(s, htype, len) \ - s->method->ssl3_enc->set_handshake_header(s, htype, len) # define ssl_set_handshake_header2(s, pkt, htype) \ s->method->ssl3_enc->set_handshake_header2((s), (pkt), (htype)) # define ssl_close_construct_packet(s, pkt) \ @@ -1903,7 +1899,6 @@ __owur long ssl3_ctx_callback_ctrl(SSL_CTX *s, int cmd, void (*fp) (void)); __owur int ssl3_do_change_cipher_spec(SSL *ssl); __owur long ssl3_default_timeout(void); -__owur int ssl3_set_handshake_header(SSL *s, int htype, unsigned long len); __owur int ssl3_set_handshake_header2(SSL *s, WPACKET *pkt, int htype); __owur int tls_close_construct_packet(SSL *s, WPACKET *pkt); __owur int dtls1_set_handshake_header2(SSL *s, WPACKET *pkt, int htype); diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 69a472be15..9c11081621 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -40,7 +40,6 @@ SSL3_ENC_METHOD const TLSv1_enc_data = { tls1_export_keying_material, 0, SSL3_HM_HEADER_LENGTH, - ssl3_set_handshake_header, ssl3_set_handshake_header2, tls_close_construct_packet, ssl3_handshake_write @@ -60,7 +59,6 @@ SSL3_ENC_METHOD const TLSv1_1_enc_data = { tls1_export_keying_material, SSL_ENC_FLAG_EXPLICIT_IV, SSL3_HM_HEADER_LENGTH, - ssl3_set_handshake_header, ssl3_set_handshake_header2, tls_close_construct_packet, ssl3_handshake_write @@ -81,7 +79,6 @@ SSL3_ENC_METHOD const TLSv1_2_enc_data = { SSL_ENC_FLAG_EXPLICIT_IV | SSL_ENC_FLAG_SIGALGS | SSL_ENC_FLAG_SHA256_PRF | SSL_ENC_FLAG_TLS1_2_CIPHERS, SSL3_HM_HEADER_LENGTH, - ssl3_set_handshake_header, ssl3_set_handshake_header2, tls_close_construct_packet, ssl3_handshake_write