From f7f0f3a74b6afd426e72b67fa8bdf8c5189d5e6d Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Mon, 2 Mar 2015 21:09:31 -0500 Subject: [PATCH] Remove ccs_header_st. It doesn't do anything. Change-Id: I0bba4e22a0b2053aae491d0ad695c892803cafca Reviewed-on: https://boringssl-review.googlesource.com/3767 Reviewed-by: Adam Langley --- include/openssl/dtls1.h | 5 ----- ssl/d1_both.c | 6 ------ ssl/d1_pkt.c | 13 +++---------- ssl/ssl_locl.h | 1 - 4 files changed, 3 insertions(+), 22 deletions(-) diff --git a/include/openssl/dtls1.h b/include/openssl/dtls1.h index 5ee652fb..ad49aedb 100644 --- a/include/openssl/dtls1.h +++ b/include/openssl/dtls1.h @@ -105,11 +105,6 @@ struct hm_header_st { uint16_t epoch; }; -struct ccs_header_st { - uint8_t type; - uint16_t seq; -}; - typedef struct record_pqueue_st { uint16_t epoch; pqueue q; diff --git a/ssl/d1_both.c b/ssl/d1_both.c index a19ee3d3..0dcab407 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -924,12 +924,6 @@ void dtls1_get_message_header(uint8_t *data, n2l3(data, msg_hdr->frag_len); } -void dtls1_get_ccs_header(uint8_t *data, struct ccs_header_st *ccs_hdr) { - memset(ccs_hdr, 0x00, sizeof(struct ccs_header_st)); - - ccs_hdr->type = *(data++); -} - int dtls1_shutdown(SSL *s) { int ret; ret = ssl3_shutdown(s); diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c index a5631f7c..69d0f042 100644 --- a/ssl/d1_pkt.c +++ b/ssl/d1_pkt.c @@ -786,16 +786,9 @@ start: } if (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC) { - struct ccs_header_st ccs_hdr; - unsigned int ccs_hdr_len = DTLS1_CCS_HEADER_LENGTH; - - dtls1_get_ccs_header(rr->data, &ccs_hdr); - - /* 'Change Cipher Spec' is just a single byte, so we know - * exactly what the record payload has to look like */ - /* XDTLS: check that epoch is consistent */ - if ((rr->length != ccs_hdr_len) || (rr->off != 0) || - (rr->data[0] != SSL3_MT_CCS)) { + /* 'Change Cipher Spec' is just a single byte, so we know exactly what the + * record payload has to look like */ + if (rr->length != 1 || rr->off != 0 || rr->data[0] != SSL3_MT_CCS) { al = SSL_AD_ILLEGAL_PARAMETER; OPENSSL_PUT_ERROR(SSL, dtls1_read_bytes, SSL_R_BAD_CHANGE_CIPHER_SPEC); goto f_err; diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 8e6f121e..5cc1cfc5 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -815,7 +815,6 @@ int dtls1_get_queue_priority(unsigned short seq, int is_ccs); int dtls1_retransmit_buffered_messages(SSL *s); void dtls1_clear_record_buffer(SSL *s); void dtls1_get_message_header(uint8_t *data, struct hm_header_st *msg_hdr); -void dtls1_get_ccs_header(uint8_t *data, struct ccs_header_st *ccs_hdr); void dtls1_reset_seq_numbers(SSL *s, int rw); int dtls1_check_timeout_num(SSL *s); int dtls1_handle_timeout(SSL *s);