From 21ff89ebbb4bdd4d2a5dee38cb8d4960c200234c Mon Sep 17 00:00:00 2001 From: jsing <> Date: Tue, 6 Dec 2016 13:17:52 +0000 Subject: Convert certificate handshake message generation to CBB, with some clean up and restructure. This also adds CBB based variants of the ssl3_handshake_msg_{start,finish} functions - for the time being these use a CBB to build the messages, then copy back into the init_buf. ok doug@ --- src/lib/libssl/ssl_locl.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/lib/libssl/ssl_locl.h') diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index c7ae289a3a..89fb83eb9a 100644 --- a/src/lib/libssl/ssl_locl.h +++ b/src/lib/libssl/ssl_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_locl.h,v 1.137 2016/12/04 14:32:30 jsing Exp $ */ +/* $OpenBSD: ssl_locl.h,v 1.138 2016/12/06 13:17:52 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -160,6 +160,8 @@ #include #include +#include "bytestring.h" + __BEGIN_HIDDEN_DECLS #define c2l(c,l) (l = ((unsigned long)(*((c)++))) , \ @@ -617,7 +619,7 @@ int ssl3_renegotiate_check(SSL *ssl); int ssl3_dispatch_alert(SSL *s); int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek); int ssl3_write_bytes(SSL *s, int type, const void *buf, int len); -unsigned long ssl3_output_cert_chain(SSL *s, X509 *x); +int ssl3_output_cert_chain(SSL *s, CBB *cbb, X509 *x); SSL_CIPHER *ssl3_choose_cipher(SSL *ssl, STACK_OF(SSL_CIPHER) *clnt, STACK_OF(SSL_CIPHER) *srvr); int ssl3_setup_buffers(SSL *s); @@ -644,6 +646,9 @@ int ssl3_pending(const SSL *s); int ssl3_handshake_msg_hdr_len(SSL *s); unsigned char *ssl3_handshake_msg_start(SSL *s, uint8_t htype); void ssl3_handshake_msg_finish(SSL *s, unsigned int len); +int ssl3_handshake_msg_start_cbb(SSL *s, CBB *handshake, CBB *body, + uint8_t msg_type); +int ssl3_handshake_msg_finish_cbb(SSL *s, CBB *handshake); int ssl3_handshake_write(SSL *s); void tls1_record_sequence_increment(unsigned char *seq); -- cgit v1.2.3-55-g6feb