From 7cc0ff236ba2392f4e38f24b0ff89771d4a18a2b Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 11 Sep 2015 15:59:21 +0000 Subject: Convert dtls1_send_finished() and ssl3_send_finished() to ssl3_handshake_msg_start()/ssl3_handshake_msg_finish(). ok beck@ --- src/lib/libssl/s3_both.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/lib/libssl/s3_both.c') diff --git a/src/lib/libssl/s3_both.c b/src/lib/libssl/s3_both.c index 5a1d1e7443..6448f27a03 100644 --- a/src/lib/libssl/s3_both.c +++ b/src/lib/libssl/s3_both.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_both.c,v 1.43 2015/07/18 19:41:54 doug Exp $ */ +/* $OpenBSD: s3_both.c,v 1.44 2015/09/11 15:59:21 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -155,13 +155,12 @@ ssl3_do_write(SSL *s, int type) int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) { - unsigned char *p, *d; + unsigned char *p; unsigned long l; int md_len; if (s->state == a) { - d = (unsigned char *)s->init_buf->data; - p = &(d[4]); + p = ssl3_handshake_msg_start(s, SSL3_MT_FINISHED); md_len = s->method->ssl3_enc->finish_mac_length; if (s->method->ssl3_enc->final_finish_mac(s, sender, slen, @@ -184,16 +183,12 @@ ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) s->s3->previous_server_finished_len = md_len; } - *(d++) = SSL3_MT_FINISHED; - l2n3(l, d); - s->init_num = (int)l + 4; - s->init_off = 0; + ssl3_handshake_msg_finish(s, l); s->state = b; } - /* SSL3_ST_SEND_xxxxxx_HELLO_B */ - return (ssl3_do_write(s, SSL3_RT_HANDSHAKE)); + return (ssl3_handshake_write(s)); } /* ssl3_take_mac calculates the Finished MAC for the handshakes messages seen to far. */ -- cgit v1.2.3-55-g6feb