diff options
Diffstat (limited to 'src/lib/libssl/ssl_both.c')
| -rw-r--r-- | src/lib/libssl/ssl_both.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/lib/libssl/ssl_both.c b/src/lib/libssl/ssl_both.c index 14fd121d53..d1a0879b72 100644 --- a/src/lib/libssl/ssl_both.c +++ b/src/lib/libssl/ssl_both.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_both.c,v 1.6 2017/02/07 02:08:38 beck Exp $ */ | 1 | /* $OpenBSD: ssl_both.c,v 1.7 2017/03/05 14:24:12 jsing Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -166,9 +166,11 @@ ssl3_do_write(SSL *s, int type) | |||
| 166 | int | 166 | int |
| 167 | ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) | 167 | ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) |
| 168 | { | 168 | { |
| 169 | unsigned char *p; | 169 | CBB cbb, finished; |
| 170 | int md_len; | 170 | int md_len; |
| 171 | 171 | ||
| 172 | memset(&cbb, 0, sizeof(cbb)); | ||
| 173 | |||
| 172 | if (s->internal->state == a) { | 174 | if (s->internal->state == a) { |
| 173 | md_len = TLS1_FINISH_MAC_LENGTH; | 175 | md_len = TLS1_FINISH_MAC_LENGTH; |
| 174 | OPENSSL_assert(md_len <= EVP_MAX_MD_SIZE); | 176 | OPENSSL_assert(md_len <= EVP_MAX_MD_SIZE); |
| @@ -189,14 +191,23 @@ ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) | |||
| 189 | S3I(s)->previous_server_finished_len = md_len; | 191 | S3I(s)->previous_server_finished_len = md_len; |
| 190 | } | 192 | } |
| 191 | 193 | ||
| 192 | p = ssl3_handshake_msg_start(s, SSL3_MT_FINISHED); | 194 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &finished, |
| 193 | memcpy(p, S3I(s)->tmp.finish_md, md_len); | 195 | SSL3_MT_FINISHED)) |
| 194 | ssl3_handshake_msg_finish(s, md_len); | 196 | goto err; |
| 197 | if (!CBB_add_bytes(&finished, S3I(s)->tmp.finish_md, md_len)) | ||
| 198 | goto err; | ||
| 199 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | ||
| 200 | goto err; | ||
| 195 | 201 | ||
| 196 | s->internal->state = b; | 202 | s->internal->state = b; |
| 197 | } | 203 | } |
| 198 | 204 | ||
| 199 | return (ssl3_handshake_write(s)); | 205 | return (ssl3_handshake_write(s)); |
| 206 | |||
| 207 | err: | ||
| 208 | CBB_cleanup(&cbb); | ||
| 209 | |||
| 210 | return (-1); | ||
| 200 | } | 211 | } |
| 201 | 212 | ||
| 202 | /* | 213 | /* |
