From 4ca92876cd1aa45f9ac5ea123afc11e1ef4574cb Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 24 Aug 2018 17:30:32 +0000 Subject: Clean up handshake message start/finish functions. Now that all handshake messages are created using CBB, remove the non-CBB ssl3_handshake_msg_start()/ssl3_handshake_msg_finish() functions. Rename the CBB variants by dropping the _cbb suffix. ok bcook@ inoguchi@ tb@ --- src/lib/libssl/s3_lib.c | 42 +++--------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) (limited to 'src/lib/libssl/s3_lib.c') diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c index b3162ff657..1d8eff9fb6 100644 --- a/src/lib/libssl/s3_lib.c +++ b/src/lib/libssl/s3_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_lib.c,v 1.167 2018/06/02 16:29:01 jsing Exp $ */ +/* $OpenBSD: s3_lib.c,v 1.168 2018/08/24 17:30:32 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1397,44 +1397,8 @@ ssl3_handshake_msg_hdr_len(SSL *s) SSL3_HM_HEADER_LENGTH); } -unsigned char * -ssl3_handshake_msg_start(SSL *s, uint8_t msg_type) -{ - unsigned char *d, *p; - - d = p = (unsigned char *)s->internal->init_buf->data; - - /* Handshake message type and length. */ - *(p++) = msg_type; - l2n3(0, p); - - return (d + ssl3_handshake_msg_hdr_len(s)); -} - -void -ssl3_handshake_msg_finish(SSL *s, unsigned int len) -{ - unsigned char *p; - uint8_t msg_type; - - p = (unsigned char *)s->internal->init_buf->data; - - /* Handshake message length. */ - msg_type = *(p++); - l2n3(len, p); - - s->internal->init_num = ssl3_handshake_msg_hdr_len(s) + (int)len; - s->internal->init_off = 0; - - if (SSL_IS_DTLS(s)) { - dtls1_set_message_header(s, msg_type, len, 0, len); - dtls1_buffer_message(s, 0); - } -} - int -ssl3_handshake_msg_start_cbb(SSL *s, CBB *handshake, CBB *body, - uint8_t msg_type) +ssl3_handshake_msg_start(SSL *s, CBB *handshake, CBB *body, uint8_t msg_type) { int ret = 0; @@ -1459,7 +1423,7 @@ ssl3_handshake_msg_start_cbb(SSL *s, CBB *handshake, CBB *body, } int -ssl3_handshake_msg_finish_cbb(SSL *s, CBB *handshake) +ssl3_handshake_msg_finish(SSL *s, CBB *handshake) { unsigned char *data = NULL; size_t outlen; -- cgit v1.2.3-55-g6feb