diff options
-rw-r--r-- | ssl/d1_lib.c | 4 | ||||
-rw-r--r-- | ssl/s3_lib.c | 10 | ||||
-rw-r--r-- | ssl/ssl_locl.h | 10 | ||||
-rw-r--r-- | ssl/statem/statem_clnt.c | 8 | ||||
-rw-r--r-- | ssl/statem/statem_dtls.c | 8 | ||||
-rw-r--r-- | ssl/statem/statem_lib.c | 4 | ||||
-rw-r--r-- | ssl/statem/statem_srvr.c | 23 | ||||
-rw-r--r-- | ssl/t1_lib.c | 6 |
8 files changed, 30 insertions, 43 deletions
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index 27b8ccb162..112c69904e 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -42,7 +42,7 @@ 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_header2, + dtls1_set_handshake_header, dtls1_close_construct_packet, dtls1_handshake_write }; @@ -62,7 +62,7 @@ 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_header2, + dtls1_set_handshake_header, dtls1_close_construct_packet, dtls1_handshake_write }; diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 02cf88be45..630c94d383 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -2750,7 +2750,7 @@ const SSL3_ENC_METHOD SSLv3_enc_data = { int use_context))ssl_undefined_function, 0, SSL3_HM_HEADER_LENGTH, - ssl3_set_handshake_header2, + ssl3_set_handshake_header, tls_close_construct_packet, ssl3_handshake_write }; @@ -2777,13 +2777,7 @@ const SSL_CIPHER *ssl3_get_cipher(unsigned int u) return (NULL); } -/* - * Temporary name. To be renamed ssl3_set_handshake_header() once all WPACKET - * conversion is complete. The old ssl3_set_handshake_heder() can be deleted - * at that point. - * TODO - RENAME ME - */ -int ssl3_set_handshake_header2(SSL *s, WPACKET *pkt, int htype) +int ssl3_set_handshake_header(SSL *s, WPACKET *pkt, int htype) { /* Set the content type and 3 bytes for the message len */ if (!WPACKET_put_bytes_u8(pkt, htype) diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index cd44e37f41..eb29740429 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -1584,7 +1584,7 @@ typedef struct ssl3_enc_method { /* Handshake header length */ unsigned int hhlen; /* Set the handshake header */ - int (*set_handshake_header2) (SSL *s, WPACKET *pkt, int type); + int (*set_handshake_header) (SSL *s, WPACKET *pkt, int type); /* Close construction of the handshake message */ int (*close_construct_packet) (SSL *s, WPACKET *pkt); /* Write out handshake message */ @@ -1594,8 +1594,8 @@ 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_header2(s, pkt, htype) \ - s->method->ssl3_enc->set_handshake_header2((s), (pkt), (htype)) +# define ssl_set_handshake_header(s, pkt, htype) \ + s->method->ssl3_enc->set_handshake_header((s), (pkt), (htype)) # define ssl_close_construct_packet(s, pkt) \ s->method->ssl3_enc->close_construct_packet((s), (pkt)) # define ssl_do_write(s) s->method->ssl3_enc->do_write(s) @@ -1899,9 +1899,9 @@ __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_header2(SSL *s, WPACKET *pkt, int htype); +__owur int ssl3_set_handshake_header(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); +__owur int dtls1_set_handshake_header(SSL *s, WPACKET *pkt, int htype); __owur int dtls1_close_construct_packet(SSL *s, WPACKET *pkt); __owur int ssl3_handshake_write(SSL *s); diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index e4b2219f06..02d1b7af89 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -738,7 +738,7 @@ int tls_construct_client_hello(SSL *s) if (i && ssl_fill_hello_random(s, 0, p, sizeof(s->s3->client_random)) <= 0) goto err; - if (!ssl_set_handshake_header2(s, &pkt, SSL3_MT_CLIENT_HELLO)) { + if (!ssl_set_handshake_header(s, &pkt, SSL3_MT_CLIENT_HELLO)) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); goto err; @@ -2469,7 +2469,7 @@ int tls_construct_client_key_exchange(SSL *s) goto err; } - if (!ssl_set_handshake_header2(s, &pkt, SSL3_MT_CLIENT_KEY_EXCHANGE)) { + if (!ssl_set_handshake_header(s, &pkt, SSL3_MT_CLIENT_KEY_EXCHANGE)) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); goto err; @@ -2605,7 +2605,7 @@ int tls_construct_client_verify(SSL *s) goto err; } - if (!ssl_set_handshake_header2(s, &pkt, SSL3_MT_CERTIFICATE_VERIFY)) { + if (!ssl_set_handshake_header(s, &pkt, SSL3_MT_CERTIFICATE_VERIFY)) { SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } @@ -2878,7 +2878,7 @@ int tls_construct_next_proto(SSL *s) goto err; } - if (!ssl_set_handshake_header2(s, &pkt, SSL3_MT_NEXT_PROTO)) { + if (!ssl_set_handshake_header(s, &pkt, SSL3_MT_NEXT_PROTO)) { SSLerr(SSL_F_TLS_CONSTRUCT_NEXT_PROTO, ERR_R_INTERNAL_ERROR); goto err; } diff --git a/ssl/statem/statem_dtls.c b/ssl/statem/statem_dtls.c index 7e23ad91a1..0328ab7def 100644 --- a/ssl/statem/statem_dtls.c +++ b/ssl/statem/statem_dtls.c @@ -1212,13 +1212,7 @@ void dtls1_get_message_header(unsigned char *data, struct hm_header_st *msg_hdr) n2l3(data, msg_hdr->frag_len); } -/* - * Temporary name. To be renamed dtls1_set_handshake_header() once all WPACKET - * conversion is complete. The old dtls1_set_handshake_heder() can be deleted - * at that point. - * TODO - RENAME ME - */ -int dtls1_set_handshake_header2(SSL *s, WPACKET *pkt, int htype) +int dtls1_set_handshake_header(SSL *s, WPACKET *pkt, int htype) { unsigned char *header; diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c index 0a482fd3a7..da26ef8c16 100644 --- a/ssl/statem/statem_lib.c +++ b/ssl/statem/statem_lib.c @@ -78,7 +78,7 @@ int tls_construct_finished(SSL *s, const char *sender, int slen) WPACKET pkt; if (!WPACKET_init(&pkt, s->init_buf) - || !ssl_set_handshake_header2(s, &pkt, SSL3_MT_FINISHED)) { + || !ssl_set_handshake_header(s, &pkt, SSL3_MT_FINISHED)) { SSLerr(SSL_F_TLS_CONSTRUCT_FINISHED, ERR_R_INTERNAL_ERROR); goto err; } @@ -297,7 +297,7 @@ unsigned long ssl3_output_cert_chain(SSL *s, CERT_PKEY *cpk) goto err; } - if (!ssl_set_handshake_header2(s, &pkt, SSL3_MT_CERTIFICATE) + if (!ssl_set_handshake_header(s, &pkt, SSL3_MT_CERTIFICATE) || !WPACKET_start_sub_packet_u24(&pkt)) { SSLerr(SSL_F_SSL3_OUTPUT_CERT_CHAIN, ERR_R_INTERNAL_ERROR); goto err; diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 008ebda132..cc737ba846 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -834,7 +834,7 @@ int tls_construct_hello_request(SSL *s) WPACKET pkt; if (!WPACKET_init(&pkt, s->init_buf) - || !ssl_set_handshake_header2(s, &pkt, SSL3_MT_HELLO_REQUEST) + || !ssl_set_handshake_header(s, &pkt, SSL3_MT_HELLO_REQUEST) || !ssl_close_construct_packet(s, &pkt)) { SSLerr(SSL_F_TLS_CONSTRUCT_HELLO_REQUEST, ERR_R_INTERNAL_ERROR); ossl_statem_set_error(s); @@ -872,8 +872,8 @@ int dtls_construct_hello_verify_request(SSL *s) } if (!WPACKET_init(&pkt, s->init_buf) - || !ssl_set_handshake_header2(s, &pkt, - DTLS1_MT_HELLO_VERIFY_REQUEST) + || !ssl_set_handshake_header(s, &pkt, + DTLS1_MT_HELLO_VERIFY_REQUEST) || !dtls_raw_hello_verify_request(&pkt, s->d1->cookie, s->d1->cookie_len) /* @@ -1504,7 +1504,7 @@ int tls_construct_server_hello(SSL *s) WPACKET pkt; if (!WPACKET_init(&pkt, s->init_buf) - || !ssl_set_handshake_header2(s, &pkt, SSL3_MT_SERVER_HELLO) + || !ssl_set_handshake_header(s, &pkt, SSL3_MT_SERVER_HELLO) || !WPACKET_put_bytes_u16(&pkt, s->version) /* * Random stuff. Filling of the server_random takes place in @@ -1575,7 +1575,7 @@ int tls_construct_server_done(SSL *s) WPACKET pkt; if (!WPACKET_init(&pkt, s->init_buf) - || !ssl_set_handshake_header2(s, &pkt, SSL3_MT_SERVER_DONE) + || !ssl_set_handshake_header(s, &pkt, SSL3_MT_SERVER_DONE) || !ssl_close_construct_packet(s, &pkt)) { SSLerr(SSL_F_TLS_CONSTRUCT_SERVER_DONE, ERR_R_INTERNAL_ERROR); goto err; @@ -1614,8 +1614,8 @@ int tls_construct_server_key_exchange(SSL *s) size_t paramlen, paramoffset; if (!WPACKET_init(&pkt, s->init_buf) - || !ssl_set_handshake_header2(s, &pkt, - SSL3_MT_SERVER_KEY_EXCHANGE) + || !ssl_set_handshake_header(s, &pkt, + SSL3_MT_SERVER_KEY_EXCHANGE) || !WPACKET_get_total_written(&pkt, ¶moffset)) { SSLerr(SSL_F_TLS_CONSTRUCT_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); goto f_err; @@ -1950,8 +1950,8 @@ int tls_construct_certificate_request(SSL *s) WPACKET pkt; if (!WPACKET_init(&pkt, s->init_buf) - || !ssl_set_handshake_header2(s, &pkt, - SSL3_MT_CERTIFICATE_REQUEST)) { + || !ssl_set_handshake_header(s, &pkt, + SSL3_MT_CERTIFICATE_REQUEST)) { SSLerr(SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST, ERR_R_INTERNAL_ERROR); goto err; } @@ -2985,7 +2985,7 @@ int tls_construct_new_session_ticket(SSL *s) } if (!WPACKET_init(&pkt, s->init_buf) - || !ssl_set_handshake_header2(s, &pkt, SSL3_MT_NEWSESSION_TICKET)) { + || !ssl_set_handshake_header(s, &pkt, SSL3_MT_NEWSESSION_TICKET)) { SSLerr(SSL_F_TLS_CONSTRUCT_NEW_SESSION_TICKET, ERR_R_INTERNAL_ERROR); goto err; } @@ -3123,8 +3123,7 @@ int tls_construct_cert_status(SSL *s) WPACKET pkt; if (!WPACKET_init(&pkt, s->init_buf) - || !ssl_set_handshake_header2(s, &pkt, - SSL3_MT_CERTIFICATE_STATUS) + || !ssl_set_handshake_header(s, &pkt, SSL3_MT_CERTIFICATE_STATUS) || !WPACKET_put_bytes_u8(&pkt, s->tlsext_status_type) || !WPACKET_sub_memcpy_u24(&pkt, s->tlsext_ocsp_resp, s->tlsext_ocsp_resplen) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 9c11081621..71c480f402 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -40,7 +40,7 @@ SSL3_ENC_METHOD const TLSv1_enc_data = { tls1_export_keying_material, 0, SSL3_HM_HEADER_LENGTH, - ssl3_set_handshake_header2, + ssl3_set_handshake_header, tls_close_construct_packet, ssl3_handshake_write }; @@ -59,7 +59,7 @@ SSL3_ENC_METHOD const TLSv1_1_enc_data = { tls1_export_keying_material, SSL_ENC_FLAG_EXPLICIT_IV, SSL3_HM_HEADER_LENGTH, - ssl3_set_handshake_header2, + ssl3_set_handshake_header, tls_close_construct_packet, ssl3_handshake_write }; @@ -79,7 +79,7 @@ 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_header2, + ssl3_set_handshake_header, tls_close_construct_packet, ssl3_handshake_write }; |