diff options
author | jsing <> | 2015-09-11 15:59:21 +0000 |
---|---|---|
committer | jsing <> | 2015-09-11 15:59:21 +0000 |
commit | 7cc0ff236ba2392f4e38f24b0ff89771d4a18a2b (patch) | |
tree | b71f82cfd69ea9ce705bfdd684f42178e684ccb6 /src/lib/libssl/d1_both.c | |
parent | 2bd1bf718be85a3952cec7ea9be3652a4a51bf3d (diff) | |
download | openbsd-7cc0ff236ba2392f4e38f24b0ff89771d4a18a2b.tar.gz openbsd-7cc0ff236ba2392f4e38f24b0ff89771d4a18a2b.tar.bz2 openbsd-7cc0ff236ba2392f4e38f24b0ff89771d4a18a2b.zip |
Convert dtls1_send_finished() and ssl3_send_finished() to
ssl3_handshake_msg_start()/ssl3_handshake_msg_finish().
ok beck@
Diffstat (limited to 'src/lib/libssl/d1_both.c')
-rw-r--r-- | src/lib/libssl/d1_both.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/lib/libssl/d1_both.c b/src/lib/libssl/d1_both.c index 567a074535..4d2827a2c0 100644 --- a/src/lib/libssl/d1_both.c +++ b/src/lib/libssl/d1_both.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_both.c,v 1.35 2015/09/10 17:57:50 jsing Exp $ */ | 1 | /* $OpenBSD: d1_both.c,v 1.36 2015/09/11 15:59:21 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -905,13 +905,12 @@ f_err: | |||
905 | int | 905 | int |
906 | dtls1_send_finished(SSL *s, int a, int b, const char *sender, int slen) | 906 | dtls1_send_finished(SSL *s, int a, int b, const char *sender, int slen) |
907 | { | 907 | { |
908 | unsigned char *p, *d; | 908 | unsigned char *p; |
909 | int i; | 909 | int i; |
910 | unsigned long l; | 910 | unsigned long l; |
911 | 911 | ||
912 | if (s->state == a) { | 912 | if (s->state == a) { |
913 | d = (unsigned char *)s->init_buf->data; | 913 | p = ssl3_handshake_msg_start(s, SSL3_MT_FINISHED); |
914 | p = &(d[DTLS1_HM_HEADER_LENGTH]); | ||
915 | 914 | ||
916 | i = s->method->ssl3_enc->final_finish_mac(s, sender, slen, | 915 | i = s->method->ssl3_enc->final_finish_mac(s, sender, slen, |
917 | s->s3->tmp.finish_md); | 916 | s->s3->tmp.finish_md); |
@@ -936,18 +935,12 @@ dtls1_send_finished(SSL *s, int a, int b, const char *sender, int slen) | |||
936 | s->s3->previous_server_finished_len = i; | 935 | s->s3->previous_server_finished_len = i; |
937 | } | 936 | } |
938 | 937 | ||
939 | d = dtls1_set_message_header(s, d, SSL3_MT_FINISHED, l, 0, l); | 938 | ssl3_handshake_msg_finish(s, l); |
940 | s->init_num = (int)l + DTLS1_HM_HEADER_LENGTH; | ||
941 | s->init_off = 0; | ||
942 | |||
943 | /* buffer the message to handle re-xmits */ | ||
944 | dtls1_buffer_message(s, 0); | ||
945 | 939 | ||
946 | s->state = b; | 940 | s->state = b; |
947 | } | 941 | } |
948 | 942 | ||
949 | /* SSL3_ST_SEND_xxxxxx_HELLO_B */ | 943 | return (ssl3_handshake_write(s)); |
950 | return (dtls1_do_write(s, SSL3_RT_HANDSHAKE)); | ||
951 | } | 944 | } |
952 | 945 | ||
953 | /* | 946 | /* |