Remove ssl_set_handshake_header()
authorMatt Caswell <matt@openssl.org>
Thu, 29 Sep 2016 21:32:36 +0000 (22:32 +0100)
committerMatt Caswell <matt@openssl.org>
Sun, 2 Oct 2016 19:25:57 +0000 (20:25 +0100)
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 <rsalz@openssl.org>
ssl/d1_lib.c
ssl/s3_lib.c
ssl/ssl_locl.h
ssl/t1_lib.c

index f34818b..27b8ccb 100644 (file)
@@ -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);
index ea607a5..02cf88b 100644 (file)
@@ -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
index bad9ff7..cd44e37 100644 (file)
@@ -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);
index 69a472b..9c11081 100644 (file)
@@ -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