diff options
| author | jsing <> | 2018-08-24 17:30:32 +0000 |
|---|---|---|
| committer | jsing <> | 2018-08-24 17:30:32 +0000 |
| commit | dd7cee845ba455372d9339ef09b4c365da4166ac (patch) | |
| tree | e155083a9870a0f69abb8ecb24bb8173c2a5a5c6 | |
| parent | 989b6eb5582fc0c90a8895a39845fa0f37d77657 (diff) | |
| download | openbsd-dd7cee845ba455372d9339ef09b4c365da4166ac.tar.gz openbsd-dd7cee845ba455372d9339ef09b4c365da4166ac.tar.bz2 openbsd-dd7cee845ba455372d9339ef09b4c365da4166ac.zip | |
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@
| -rw-r--r-- | src/lib/libssl/d1_srvr.c | 6 | ||||
| -rw-r--r-- | src/lib/libssl/s3_lib.c | 42 | ||||
| -rw-r--r-- | src/lib/libssl/ssl_both.c | 6 | ||||
| -rw-r--r-- | src/lib/libssl/ssl_clnt.c | 18 | ||||
| -rw-r--r-- | src/lib/libssl/ssl_locl.h | 8 | ||||
| -rw-r--r-- | src/lib/libssl/ssl_srvr.c | 34 |
6 files changed, 38 insertions, 76 deletions
diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c index 3de0a72f27..4217519783 100644 --- a/src/lib/libssl/d1_srvr.c +++ b/src/lib/libssl/d1_srvr.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: d1_srvr.c,v 1.92 2018/04/07 17:02:34 jsing Exp $ */ | 1 | /* $OpenBSD: d1_srvr.c,v 1.93 2018/08/24 17:30:32 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. |
| @@ -185,7 +185,7 @@ dtls1_send_hello_verify_request(SSL *s) | |||
| 185 | return 0; | 185 | return 0; |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &verify, | 188 | if (!ssl3_handshake_msg_start(s, &cbb, &verify, |
| 189 | DTLS1_MT_HELLO_VERIFY_REQUEST)) | 189 | DTLS1_MT_HELLO_VERIFY_REQUEST)) |
| 190 | goto err; | 190 | goto err; |
| 191 | if (!CBB_add_u16(&verify, s->version)) | 191 | if (!CBB_add_u16(&verify, s->version)) |
| @@ -194,7 +194,7 @@ dtls1_send_hello_verify_request(SSL *s) | |||
| 194 | goto err; | 194 | goto err; |
| 195 | if (!CBB_add_bytes(&cookie, D1I(s)->cookie, D1I(s)->cookie_len)) | 195 | if (!CBB_add_bytes(&cookie, D1I(s)->cookie, D1I(s)->cookie_len)) |
| 196 | goto err; | 196 | goto err; |
| 197 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 197 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 198 | goto err; | 198 | goto err; |
| 199 | 199 | ||
| 200 | S3I(s)->hs.state = DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B; | 200 | S3I(s)->hs.state = DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B; |
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; |
diff --git a/src/lib/libssl/ssl_both.c b/src/lib/libssl/ssl_both.c index 03f95977f7..788505e602 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.11 2017/10/08 16:24:02 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_both.c,v 1.12 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 | * |
| @@ -191,12 +191,12 @@ ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) | |||
| 191 | S3I(s)->previous_server_finished_len = md_len; | 191 | S3I(s)->previous_server_finished_len = md_len; |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &finished, | 194 | if (!ssl3_handshake_msg_start(s, &cbb, &finished, |
| 195 | SSL3_MT_FINISHED)) | 195 | SSL3_MT_FINISHED)) |
| 196 | goto err; | 196 | goto err; |
| 197 | if (!CBB_add_bytes(&finished, S3I(s)->tmp.finish_md, md_len)) | 197 | if (!CBB_add_bytes(&finished, S3I(s)->tmp.finish_md, md_len)) |
| 198 | goto err; | 198 | goto err; |
| 199 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 199 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 200 | goto err; | 200 | goto err; |
| 201 | 201 | ||
| 202 | S3I(s)->hs.state = b; | 202 | S3I(s)->hs.state = b; |
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c index b026aaaee2..cf055d3ee1 100644 --- a/src/lib/libssl/ssl_clnt.c +++ b/src/lib/libssl/ssl_clnt.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_clnt.c,v 1.32 2018/08/19 15:38:03 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_clnt.c,v 1.33 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 | * |
| @@ -683,7 +683,7 @@ ssl3_send_client_hello(SSL *s) | |||
| 683 | if (!SSL_IS_DTLS(s) || D1I(s)->send_cookie == 0) | 683 | if (!SSL_IS_DTLS(s) || D1I(s)->send_cookie == 0) |
| 684 | arc4random_buf(s->s3->client_random, SSL3_RANDOM_SIZE); | 684 | arc4random_buf(s->s3->client_random, SSL3_RANDOM_SIZE); |
| 685 | 685 | ||
| 686 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &client_hello, | 686 | if (!ssl3_handshake_msg_start(s, &cbb, &client_hello, |
| 687 | SSL3_MT_CLIENT_HELLO)) | 687 | SSL3_MT_CLIENT_HELLO)) |
| 688 | goto err; | 688 | goto err; |
| 689 | 689 | ||
| @@ -775,7 +775,7 @@ ssl3_send_client_hello(SSL *s) | |||
| 775 | goto err; | 775 | goto err; |
| 776 | } | 776 | } |
| 777 | 777 | ||
| 778 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 778 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 779 | goto err; | 779 | goto err; |
| 780 | 780 | ||
| 781 | S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_B; | 781 | S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_B; |
| @@ -2321,7 +2321,7 @@ ssl3_send_client_key_exchange(SSL *s) | |||
| 2321 | goto err; | 2321 | goto err; |
| 2322 | } | 2322 | } |
| 2323 | 2323 | ||
| 2324 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &kex, | 2324 | if (!ssl3_handshake_msg_start(s, &cbb, &kex, |
| 2325 | SSL3_MT_CLIENT_KEY_EXCHANGE)) | 2325 | SSL3_MT_CLIENT_KEY_EXCHANGE)) |
| 2326 | goto err; | 2326 | goto err; |
| 2327 | 2327 | ||
| @@ -2344,7 +2344,7 @@ ssl3_send_client_key_exchange(SSL *s) | |||
| 2344 | goto err; | 2344 | goto err; |
| 2345 | } | 2345 | } |
| 2346 | 2346 | ||
| 2347 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 2347 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 2348 | goto err; | 2348 | goto err; |
| 2349 | 2349 | ||
| 2350 | S3I(s)->hs.state = SSL3_ST_CW_KEY_EXCH_B; | 2350 | S3I(s)->hs.state = SSL3_ST_CW_KEY_EXCH_B; |
| @@ -2378,7 +2378,7 @@ ssl3_send_client_verify(SSL *s) | |||
| 2378 | memset(&cbb, 0, sizeof(cbb)); | 2378 | memset(&cbb, 0, sizeof(cbb)); |
| 2379 | 2379 | ||
| 2380 | if (S3I(s)->hs.state == SSL3_ST_CW_CERT_VRFY_A) { | 2380 | if (S3I(s)->hs.state == SSL3_ST_CW_CERT_VRFY_A) { |
| 2381 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &cert_verify, | 2381 | if (!ssl3_handshake_msg_start(s, &cbb, &cert_verify, |
| 2382 | SSL3_MT_CERTIFICATE_VERIFY)) | 2382 | SSL3_MT_CERTIFICATE_VERIFY)) |
| 2383 | goto err; | 2383 | goto err; |
| 2384 | 2384 | ||
| @@ -2489,7 +2489,7 @@ ssl3_send_client_verify(SSL *s) | |||
| 2489 | if (!CBB_add_bytes(&cbb_signature, signature, signature_len)) | 2489 | if (!CBB_add_bytes(&cbb_signature, signature, signature_len)) |
| 2490 | goto err; | 2490 | goto err; |
| 2491 | 2491 | ||
| 2492 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 2492 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 2493 | goto err; | 2493 | goto err; |
| 2494 | 2494 | ||
| 2495 | S3I(s)->hs.state = SSL3_ST_CW_CERT_VRFY_B; | 2495 | S3I(s)->hs.state = SSL3_ST_CW_CERT_VRFY_B; |
| @@ -2561,13 +2561,13 @@ ssl3_send_client_certificate(SSL *s) | |||
| 2561 | } | 2561 | } |
| 2562 | 2562 | ||
| 2563 | if (S3I(s)->hs.state == SSL3_ST_CW_CERT_C) { | 2563 | if (S3I(s)->hs.state == SSL3_ST_CW_CERT_C) { |
| 2564 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &client_cert, | 2564 | if (!ssl3_handshake_msg_start(s, &cbb, &client_cert, |
| 2565 | SSL3_MT_CERTIFICATE)) | 2565 | SSL3_MT_CERTIFICATE)) |
| 2566 | goto err; | 2566 | goto err; |
| 2567 | if (!ssl3_output_cert_chain(s, &client_cert, | 2567 | if (!ssl3_output_cert_chain(s, &client_cert, |
| 2568 | (S3I(s)->tmp.cert_req == 2) ? NULL : s->cert->key->x509)) | 2568 | (S3I(s)->tmp.cert_req == 2) ? NULL : s->cert->key->x509)) |
| 2569 | goto err; | 2569 | goto err; |
| 2570 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 2570 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 2571 | goto err; | 2571 | goto err; |
| 2572 | 2572 | ||
| 2573 | S3I(s)->hs.state = SSL3_ST_CW_CERT_D; | 2573 | S3I(s)->hs.state = SSL3_ST_CW_CERT_D; |
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index 8e85f100aa..e5423859af 100644 --- a/src/lib/libssl/ssl_locl.h +++ b/src/lib/libssl/ssl_locl.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_locl.h,v 1.207 2018/08/19 15:38:03 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_locl.h,v 1.208 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 | * |
| @@ -1137,11 +1137,9 @@ long ssl3_ctx_callback_ctrl(SSL_CTX *s, int cmd, void (*fp)(void)); | |||
| 1137 | int ssl3_pending(const SSL *s); | 1137 | int ssl3_pending(const SSL *s); |
| 1138 | 1138 | ||
| 1139 | int ssl3_handshake_msg_hdr_len(SSL *s); | 1139 | int ssl3_handshake_msg_hdr_len(SSL *s); |
| 1140 | unsigned char *ssl3_handshake_msg_start(SSL *s, uint8_t htype); | 1140 | int ssl3_handshake_msg_start(SSL *s, CBB *handshake, CBB *body, |
| 1141 | void ssl3_handshake_msg_finish(SSL *s, unsigned int len); | ||
| 1142 | int ssl3_handshake_msg_start_cbb(SSL *s, CBB *handshake, CBB *body, | ||
| 1143 | uint8_t msg_type); | 1141 | uint8_t msg_type); |
| 1144 | int ssl3_handshake_msg_finish_cbb(SSL *s, CBB *handshake); | 1142 | int ssl3_handshake_msg_finish(SSL *s, CBB *handshake); |
| 1145 | int ssl3_handshake_write(SSL *s); | 1143 | int ssl3_handshake_write(SSL *s); |
| 1146 | int ssl3_record_write(SSL *s, int type); | 1144 | int ssl3_record_write(SSL *s, int type); |
| 1147 | 1145 | ||
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c index 3cf6d9a3cb..745fd6d83a 100644 --- a/src/lib/libssl/ssl_srvr.c +++ b/src/lib/libssl/ssl_srvr.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_srvr.c,v 1.42 2018/08/22 17:46:29 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_srvr.c,v 1.43 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 | * |
| @@ -784,10 +784,10 @@ ssl3_send_hello_request(SSL *s) | |||
| 784 | memset(&cbb, 0, sizeof(cbb)); | 784 | memset(&cbb, 0, sizeof(cbb)); |
| 785 | 785 | ||
| 786 | if (S3I(s)->hs.state == SSL3_ST_SW_HELLO_REQ_A) { | 786 | if (S3I(s)->hs.state == SSL3_ST_SW_HELLO_REQ_A) { |
| 787 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &hello, | 787 | if (!ssl3_handshake_msg_start(s, &cbb, &hello, |
| 788 | SSL3_MT_HELLO_REQUEST)) | 788 | SSL3_MT_HELLO_REQUEST)) |
| 789 | goto err; | 789 | goto err; |
| 790 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 790 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 791 | goto err; | 791 | goto err; |
| 792 | 792 | ||
| 793 | S3I(s)->hs.state = SSL3_ST_SW_HELLO_REQ_B; | 793 | S3I(s)->hs.state = SSL3_ST_SW_HELLO_REQ_B; |
| @@ -1175,7 +1175,7 @@ ssl3_send_server_hello(SSL *s) | |||
| 1175 | memset(&cbb, 0, sizeof(cbb)); | 1175 | memset(&cbb, 0, sizeof(cbb)); |
| 1176 | 1176 | ||
| 1177 | if (S3I(s)->hs.state == SSL3_ST_SW_SRVR_HELLO_A) { | 1177 | if (S3I(s)->hs.state == SSL3_ST_SW_SRVR_HELLO_A) { |
| 1178 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &server_hello, | 1178 | if (!ssl3_handshake_msg_start(s, &cbb, &server_hello, |
| 1179 | SSL3_MT_SERVER_HELLO)) | 1179 | SSL3_MT_SERVER_HELLO)) |
| 1180 | goto err; | 1180 | goto err; |
| 1181 | 1181 | ||
| @@ -1232,7 +1232,7 @@ ssl3_send_server_hello(SSL *s) | |||
| 1232 | goto err; | 1232 | goto err; |
| 1233 | } | 1233 | } |
| 1234 | 1234 | ||
| 1235 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 1235 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 1236 | goto err; | 1236 | goto err; |
| 1237 | } | 1237 | } |
| 1238 | 1238 | ||
| @@ -1253,10 +1253,10 @@ ssl3_send_server_done(SSL *s) | |||
| 1253 | memset(&cbb, 0, sizeof(cbb)); | 1253 | memset(&cbb, 0, sizeof(cbb)); |
| 1254 | 1254 | ||
| 1255 | if (S3I(s)->hs.state == SSL3_ST_SW_SRVR_DONE_A) { | 1255 | if (S3I(s)->hs.state == SSL3_ST_SW_SRVR_DONE_A) { |
| 1256 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &done, | 1256 | if (!ssl3_handshake_msg_start(s, &cbb, &done, |
| 1257 | SSL3_MT_SERVER_DONE)) | 1257 | SSL3_MT_SERVER_DONE)) |
| 1258 | goto err; | 1258 | goto err; |
| 1259 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 1259 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 1260 | goto err; | 1260 | goto err; |
| 1261 | 1261 | ||
| 1262 | S3I(s)->hs.state = SSL3_ST_SW_SRVR_DONE_B; | 1262 | S3I(s)->hs.state = SSL3_ST_SW_SRVR_DONE_B; |
| @@ -1519,7 +1519,7 @@ ssl3_send_server_key_exchange(SSL *s) | |||
| 1519 | 1519 | ||
| 1520 | if (S3I(s)->hs.state == SSL3_ST_SW_KEY_EXCH_A) { | 1520 | if (S3I(s)->hs.state == SSL3_ST_SW_KEY_EXCH_A) { |
| 1521 | 1521 | ||
| 1522 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &server_kex, | 1522 | if (!ssl3_handshake_msg_start(s, &cbb, &server_kex, |
| 1523 | SSL3_MT_SERVER_KEY_EXCHANGE)) | 1523 | SSL3_MT_SERVER_KEY_EXCHANGE)) |
| 1524 | goto err; | 1524 | goto err; |
| 1525 | 1525 | ||
| @@ -1600,7 +1600,7 @@ ssl3_send_server_key_exchange(SSL *s) | |||
| 1600 | goto err; | 1600 | goto err; |
| 1601 | } | 1601 | } |
| 1602 | 1602 | ||
| 1603 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 1603 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 1604 | goto err; | 1604 | goto err; |
| 1605 | 1605 | ||
| 1606 | S3I(s)->hs.state = SSL3_ST_SW_KEY_EXCH_B; | 1606 | S3I(s)->hs.state = SSL3_ST_SW_KEY_EXCH_B; |
| @@ -1639,7 +1639,7 @@ ssl3_send_certificate_request(SSL *s) | |||
| 1639 | memset(&cbb, 0, sizeof(cbb)); | 1639 | memset(&cbb, 0, sizeof(cbb)); |
| 1640 | 1640 | ||
| 1641 | if (S3I(s)->hs.state == SSL3_ST_SW_CERT_REQ_A) { | 1641 | if (S3I(s)->hs.state == SSL3_ST_SW_CERT_REQ_A) { |
| 1642 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &cert_request, | 1642 | if (!ssl3_handshake_msg_start(s, &cbb, &cert_request, |
| 1643 | SSL3_MT_CERTIFICATE_REQUEST)) | 1643 | SSL3_MT_CERTIFICATE_REQUEST)) |
| 1644 | goto err; | 1644 | goto err; |
| 1645 | 1645 | ||
| @@ -1679,7 +1679,7 @@ ssl3_send_certificate_request(SSL *s) | |||
| 1679 | goto err; | 1679 | goto err; |
| 1680 | } | 1680 | } |
| 1681 | 1681 | ||
| 1682 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 1682 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 1683 | goto err; | 1683 | goto err; |
| 1684 | 1684 | ||
| 1685 | S3I(s)->hs.state = SSL3_ST_SW_CERT_REQ_B; | 1685 | S3I(s)->hs.state = SSL3_ST_SW_CERT_REQ_B; |
| @@ -2502,12 +2502,12 @@ ssl3_send_server_certificate(SSL *s) | |||
| 2502 | return (0); | 2502 | return (0); |
| 2503 | } | 2503 | } |
| 2504 | 2504 | ||
| 2505 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &server_cert, | 2505 | if (!ssl3_handshake_msg_start(s, &cbb, &server_cert, |
| 2506 | SSL3_MT_CERTIFICATE)) | 2506 | SSL3_MT_CERTIFICATE)) |
| 2507 | goto err; | 2507 | goto err; |
| 2508 | if (!ssl3_output_cert_chain(s, &server_cert, x)) | 2508 | if (!ssl3_output_cert_chain(s, &server_cert, x)) |
| 2509 | goto err; | 2509 | goto err; |
| 2510 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 2510 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 2511 | goto err; | 2511 | goto err; |
| 2512 | 2512 | ||
| 2513 | S3I(s)->hs.state = SSL3_ST_SW_CERT_B; | 2513 | S3I(s)->hs.state = SSL3_ST_SW_CERT_B; |
| @@ -2548,7 +2548,7 @@ ssl3_send_newsession_ticket(SSL *s) | |||
| 2548 | memset(&cbb, 0, sizeof(cbb)); | 2548 | memset(&cbb, 0, sizeof(cbb)); |
| 2549 | 2549 | ||
| 2550 | if (S3I(s)->hs.state == SSL3_ST_SW_SESSION_TICKET_A) { | 2550 | if (S3I(s)->hs.state == SSL3_ST_SW_SESSION_TICKET_A) { |
| 2551 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &session_ticket, | 2551 | if (!ssl3_handshake_msg_start(s, &cbb, &session_ticket, |
| 2552 | SSL3_MT_NEWSESSION_TICKET)) | 2552 | SSL3_MT_NEWSESSION_TICKET)) |
| 2553 | goto err; | 2553 | goto err; |
| 2554 | 2554 | ||
| @@ -2657,7 +2657,7 @@ ssl3_send_newsession_ticket(SSL *s) | |||
| 2657 | if (!HMAC_Final(&hctx, hmac, &hlen)) | 2657 | if (!HMAC_Final(&hctx, hmac, &hlen)) |
| 2658 | goto err; | 2658 | goto err; |
| 2659 | 2659 | ||
| 2660 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 2660 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 2661 | goto err; | 2661 | goto err; |
| 2662 | 2662 | ||
| 2663 | S3I(s)->hs.state = SSL3_ST_SW_SESSION_TICKET_B; | 2663 | S3I(s)->hs.state = SSL3_ST_SW_SESSION_TICKET_B; |
| @@ -2689,7 +2689,7 @@ ssl3_send_cert_status(SSL *s) | |||
| 2689 | memset(&cbb, 0, sizeof(cbb)); | 2689 | memset(&cbb, 0, sizeof(cbb)); |
| 2690 | 2690 | ||
| 2691 | if (S3I(s)->hs.state == SSL3_ST_SW_CERT_STATUS_A) { | 2691 | if (S3I(s)->hs.state == SSL3_ST_SW_CERT_STATUS_A) { |
| 2692 | if (!ssl3_handshake_msg_start_cbb(s, &cbb, &certstatus, | 2692 | if (!ssl3_handshake_msg_start(s, &cbb, &certstatus, |
| 2693 | SSL3_MT_CERTIFICATE_STATUS)) | 2693 | SSL3_MT_CERTIFICATE_STATUS)) |
| 2694 | goto err; | 2694 | goto err; |
| 2695 | if (!CBB_add_u8(&certstatus, s->tlsext_status_type)) | 2695 | if (!CBB_add_u8(&certstatus, s->tlsext_status_type)) |
| @@ -2699,7 +2699,7 @@ ssl3_send_cert_status(SSL *s) | |||
| 2699 | if (!CBB_add_bytes(&ocspresp, s->internal->tlsext_ocsp_resp, | 2699 | if (!CBB_add_bytes(&ocspresp, s->internal->tlsext_ocsp_resp, |
| 2700 | s->internal->tlsext_ocsp_resplen)) | 2700 | s->internal->tlsext_ocsp_resplen)) |
| 2701 | goto err; | 2701 | goto err; |
| 2702 | if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) | 2702 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
| 2703 | goto err; | 2703 | goto err; |
| 2704 | 2704 | ||
| 2705 | S3I(s)->hs.state = SSL3_ST_SW_CERT_STATUS_B; | 2705 | S3I(s)->hs.state = SSL3_ST_SW_CERT_STATUS_B; |
