summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_lib.c
diff options
context:
space:
mode:
authorjsing <>2017-10-11 17:35:00 +0000
committerjsing <>2017-10-11 17:35:00 +0000
commit4b096d9251fbf4f46e597bb2ac44a0829138544f (patch)
treeca9185a9b7de54d8df3855321c5771328e85f30b /src/lib/libssl/t1_lib.c
parente64dc34242390cd4a16eb683e606c5beccbb9aa7 (diff)
downloadopenbsd-4b096d9251fbf4f46e597bb2ac44a0829138544f.tar.gz
openbsd-4b096d9251fbf4f46e597bb2ac44a0829138544f.tar.bz2
openbsd-4b096d9251fbf4f46e597bb2ac44a0829138544f.zip
Convert ssl3_client_hello() to CBB.
As part of this, change ssl_cipher_list_to_bytes() to take a CBB argument, rather than a pointer/length. Some additional clean up/renames while here. Based on a diff from doug@
Diffstat (limited to 'src/lib/libssl/t1_lib.c')
-rw-r--r--src/lib/libssl/t1_lib.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c
index 8526ca167b..1cef08d094 100644
--- a/src/lib/libssl/t1_lib.c
+++ b/src/lib/libssl/t1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t1_lib.c,v 1.138 2017/10/11 16:51:39 jsing Exp $ */ 1/* $OpenBSD: t1_lib.c,v 1.139 2017/10/11 17:35:00 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 *
@@ -661,29 +661,6 @@ tls12_get_req_sig_algs(SSL *s, unsigned char **sigalgs, size_t *sigalgs_len)
661 *sigalgs_len = sizeof(tls12_sigalgs); 661 *sigalgs_len = sizeof(tls12_sigalgs);
662} 662}
663 663
664unsigned char *
665ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned char *limit)
666{
667 size_t len;
668 CBB cbb;
669
670 if (p >= limit)
671 return NULL;
672
673 if (!CBB_init_fixed(&cbb, p, limit - p))
674 return NULL;
675 if (!tlsext_clienthello_build(s, &cbb)) {
676 CBB_cleanup(&cbb);
677 return NULL;
678 }
679 if (!CBB_finish(&cbb, NULL, &len)) {
680 CBB_cleanup(&cbb);
681 return NULL;
682 }
683
684 return (p + len);
685}
686
687int 664int
688ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, 665ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
689 int n, int *al) 666 int n, int *al)