diff options
Diffstat (limited to 'src/lib/libssl/s3_lib.c')
-rw-r--r-- | src/lib/libssl/s3_lib.c | 42 |
1 files changed, 3 insertions, 39 deletions
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 @@ | |||
1 | /* $OpenBSD: s3_lib.c,v 1.167 2018/06/02 16:29:01 jsing Exp $ */ | 1 | /* $OpenBSD: s3_lib.c,v 1.168 2018/08/24 17:30:32 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 | * |
@@ -1397,44 +1397,8 @@ ssl3_handshake_msg_hdr_len(SSL *s) | |||
1397 | SSL3_HM_HEADER_LENGTH); | 1397 | SSL3_HM_HEADER_LENGTH); |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | unsigned char * | ||
1401 | ssl3_handshake_msg_start(SSL *s, uint8_t msg_type) | ||
1402 | { | ||
1403 | unsigned char *d, *p; | ||
1404 | |||
1405 | d = p = (unsigned char *)s->internal->init_buf->data; | ||
1406 | |||
1407 | /* Handshake message type and length. */ | ||
1408 | *(p++) = msg_type; | ||
1409 | l2n3(0, p); | ||
1410 | |||
1411 | return (d + ssl3_handshake_msg_hdr_len(s)); | ||
1412 | } | ||
1413 | |||
1414 | void | ||
1415 | ssl3_handshake_msg_finish(SSL *s, unsigned int len) | ||
1416 | { | ||
1417 | unsigned char *p; | ||
1418 | uint8_t msg_type; | ||
1419 | |||
1420 | p = (unsigned char *)s->internal->init_buf->data; | ||
1421 | |||
1422 | /* Handshake message length. */ | ||
1423 | msg_type = *(p++); | ||
1424 | l2n3(len, p); | ||
1425 | |||
1426 | s->internal->init_num = ssl3_handshake_msg_hdr_len(s) + (int)len; | ||
1427 | s->internal->init_off = 0; | ||
1428 | |||
1429 | if (SSL_IS_DTLS(s)) { | ||
1430 | dtls1_set_message_header(s, msg_type, len, 0, len); | ||
1431 | dtls1_buffer_message(s, 0); | ||
1432 | } | ||
1433 | } | ||
1434 | |||
1435 | int | 1400 | int |
1436 | ssl3_handshake_msg_start_cbb(SSL *s, CBB *handshake, CBB *body, | 1401 | ssl3_handshake_msg_start(SSL *s, CBB *handshake, CBB *body, uint8_t msg_type) |
1437 | uint8_t msg_type) | ||
1438 | { | 1402 | { |
1439 | int ret = 0; | 1403 | int ret = 0; |
1440 | 1404 | ||
@@ -1459,7 +1423,7 @@ ssl3_handshake_msg_start_cbb(SSL *s, CBB *handshake, CBB *body, | |||
1459 | } | 1423 | } |
1460 | 1424 | ||
1461 | int | 1425 | int |
1462 | ssl3_handshake_msg_finish_cbb(SSL *s, CBB *handshake) | 1426 | ssl3_handshake_msg_finish(SSL *s, CBB *handshake) |
1463 | { | 1427 | { |
1464 | unsigned char *data = NULL; | 1428 | unsigned char *data = NULL; |
1465 | size_t outlen; | 1429 | size_t outlen; |