summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-08-04 09:27:36 +0000
committertb <>2022-08-04 09:27:36 +0000
commita65f4608fab82ca1a01fdae059ee762cb1626d69 (patch)
tree49cf56f0876a731f8625f44fad25bc2952a561ae /src
parent28e3b1222b3ca2332b57eabdb44e9133d6907f97 (diff)
downloadopenbsd-a65f4608fab82ca1a01fdae059ee762cb1626d69.tar.gz
openbsd-a65f4608fab82ca1a01fdae059ee762cb1626d69.tar.bz2
openbsd-a65f4608fab82ca1a01fdae059ee762cb1626d69.zip
Make tlsext_*_{build,needs,parse}() functions static
None of these functions are used outside of ssl_tlsext.c. The only reason they are prototyped in the header is for the use of tlsexttest.c. Rather than having a big pile of useless copy-paste in the header, we can adapt the test to avoid using these functions directly. ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/ssl_tlsext.c185
-rw-r--r--src/lib/libssl/ssl_tlsext.h126
2 files changed, 94 insertions, 217 deletions
diff --git a/src/lib/libssl/ssl_tlsext.c b/src/lib/libssl/ssl_tlsext.c
index 033608e03e..f417f59b8e 100644
--- a/src/lib/libssl/ssl_tlsext.c
+++ b/src/lib/libssl/ssl_tlsext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_tlsext.c,v 1.127 2022/07/24 10:52:51 tb Exp $ */ 1/* $OpenBSD: ssl_tlsext.c,v 1.128 2022/08/04 09:27:36 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> 4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
@@ -36,7 +36,7 @@
36 * Supported Application-Layer Protocol Negotiation - RFC 7301 36 * Supported Application-Layer Protocol Negotiation - RFC 7301
37 */ 37 */
38 38
39int 39static int
40tlsext_alpn_client_needs(SSL *s, uint16_t msg_type) 40tlsext_alpn_client_needs(SSL *s, uint16_t msg_type)
41{ 41{
42 /* ALPN protos have been specified and this is the initial handshake */ 42 /* ALPN protos have been specified and this is the initial handshake */
@@ -44,7 +44,7 @@ tlsext_alpn_client_needs(SSL *s, uint16_t msg_type)
44 s->s3->hs.finished_len == 0; 44 s->s3->hs.finished_len == 0;
45} 45}
46 46
47int 47static int
48tlsext_alpn_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 48tlsext_alpn_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
49{ 49{
50 CBB protolist; 50 CBB protolist;
@@ -83,7 +83,7 @@ tlsext_alpn_check_format(CBS *cbs)
83 return 1; 83 return 1;
84} 84}
85 85
86int 86static int
87tlsext_alpn_server_parse(SSL *s, uint16_t msg_types, CBS *cbs, int *alert) 87tlsext_alpn_server_parse(SSL *s, uint16_t msg_types, CBS *cbs, int *alert)
88{ 88{
89 CBS alpn; 89 CBS alpn;
@@ -134,13 +134,13 @@ tlsext_alpn_server_parse(SSL *s, uint16_t msg_types, CBS *cbs, int *alert)
134 return 0; 134 return 0;
135} 135}
136 136
137int 137static int
138tlsext_alpn_server_needs(SSL *s, uint16_t msg_type) 138tlsext_alpn_server_needs(SSL *s, uint16_t msg_type)
139{ 139{
140 return s->s3->alpn_selected != NULL; 140 return s->s3->alpn_selected != NULL;
141} 141}
142 142
143int 143static int
144tlsext_alpn_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 144tlsext_alpn_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
145{ 145{
146 CBB list, selected; 146 CBB list, selected;
@@ -161,7 +161,7 @@ tlsext_alpn_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
161 return 1; 161 return 1;
162} 162}
163 163
164int 164static int
165tlsext_alpn_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 165tlsext_alpn_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
166{ 166{
167 CBS list, proto; 167 CBS list, proto;
@@ -191,14 +191,14 @@ tlsext_alpn_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
191/* 191/*
192 * Supported Groups - RFC 7919 section 2 192 * Supported Groups - RFC 7919 section 2
193 */ 193 */
194int 194static int
195tlsext_supportedgroups_client_needs(SSL *s, uint16_t msg_type) 195tlsext_supportedgroups_client_needs(SSL *s, uint16_t msg_type)
196{ 196{
197 return ssl_has_ecc_ciphers(s) || 197 return ssl_has_ecc_ciphers(s) ||
198 (s->s3->hs.our_max_tls_version >= TLS1_3_VERSION); 198 (s->s3->hs.our_max_tls_version >= TLS1_3_VERSION);
199} 199}
200 200
201int 201static int
202tlsext_supportedgroups_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 202tlsext_supportedgroups_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
203{ 203{
204 const uint16_t *groups; 204 const uint16_t *groups;
@@ -228,7 +228,7 @@ tlsext_supportedgroups_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
228 return 1; 228 return 1;
229} 229}
230 230
231int 231static int
232tlsext_supportedgroups_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, 232tlsext_supportedgroups_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
233 int *alert) 233 int *alert)
234{ 234{
@@ -289,19 +289,19 @@ tlsext_supportedgroups_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
289} 289}
290 290
291/* This extension is never used by the server. */ 291/* This extension is never used by the server. */
292int 292static int
293tlsext_supportedgroups_server_needs(SSL *s, uint16_t msg_type) 293tlsext_supportedgroups_server_needs(SSL *s, uint16_t msg_type)
294{ 294{
295 return 0; 295 return 0;
296} 296}
297 297
298int 298static int
299tlsext_supportedgroups_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 299tlsext_supportedgroups_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
300{ 300{
301 return 0; 301 return 0;
302} 302}
303 303
304int 304static int
305tlsext_supportedgroups_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, 305tlsext_supportedgroups_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
306 int *alert) 306 int *alert)
307{ 307{
@@ -378,37 +378,37 @@ tlsext_ecpf_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
378 return 1; 378 return 1;
379} 379}
380 380
381int 381static int
382tlsext_ecpf_client_needs(SSL *s, uint16_t msg_type) 382tlsext_ecpf_client_needs(SSL *s, uint16_t msg_type)
383{ 383{
384 return ssl_has_ecc_ciphers(s); 384 return ssl_has_ecc_ciphers(s);
385} 385}
386 386
387int 387static int
388tlsext_ecpf_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 388tlsext_ecpf_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
389{ 389{
390 return tlsext_ecpf_build(s, msg_type, cbb); 390 return tlsext_ecpf_build(s, msg_type, cbb);
391} 391}
392 392
393int 393static int
394tlsext_ecpf_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 394tlsext_ecpf_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
395{ 395{
396 return tlsext_ecpf_parse(s, msg_type, cbs, alert); 396 return tlsext_ecpf_parse(s, msg_type, cbs, alert);
397} 397}
398 398
399int 399static int
400tlsext_ecpf_server_needs(SSL *s, uint16_t msg_type) 400tlsext_ecpf_server_needs(SSL *s, uint16_t msg_type)
401{ 401{
402 return ssl_using_ecc_cipher(s); 402 return ssl_using_ecc_cipher(s);
403} 403}
404 404
405int 405static int
406tlsext_ecpf_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 406tlsext_ecpf_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
407{ 407{
408 return tlsext_ecpf_build(s, msg_type, cbb); 408 return tlsext_ecpf_build(s, msg_type, cbb);
409} 409}
410 410
411int 411static int
412tlsext_ecpf_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 412tlsext_ecpf_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
413{ 413{
414 return tlsext_ecpf_parse(s, msg_type, cbs, alert); 414 return tlsext_ecpf_parse(s, msg_type, cbs, alert);
@@ -417,13 +417,13 @@ tlsext_ecpf_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
417/* 417/*
418 * Renegotiation Indication - RFC 5746. 418 * Renegotiation Indication - RFC 5746.
419 */ 419 */
420int 420static int
421tlsext_ri_client_needs(SSL *s, uint16_t msg_type) 421tlsext_ri_client_needs(SSL *s, uint16_t msg_type)
422{ 422{
423 return (s->internal->renegotiate); 423 return (s->internal->renegotiate);
424} 424}
425 425
426int 426static int
427tlsext_ri_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 427tlsext_ri_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
428{ 428{
429 CBB reneg; 429 CBB reneg;
@@ -439,7 +439,7 @@ tlsext_ri_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
439 return 1; 439 return 1;
440} 440}
441 441
442int 442static int
443tlsext_ri_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 443tlsext_ri_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
444{ 444{
445 CBS reneg; 445 CBS reneg;
@@ -462,14 +462,14 @@ tlsext_ri_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
462 return 1; 462 return 1;
463} 463}
464 464
465int 465static int
466tlsext_ri_server_needs(SSL *s, uint16_t msg_type) 466tlsext_ri_server_needs(SSL *s, uint16_t msg_type)
467{ 467{
468 return (s->s3->hs.negotiated_tls_version < TLS1_3_VERSION && 468 return (s->s3->hs.negotiated_tls_version < TLS1_3_VERSION &&
469 s->s3->send_connection_binding); 469 s->s3->send_connection_binding);
470} 470}
471 471
472int 472static int
473tlsext_ri_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 473tlsext_ri_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
474{ 474{
475 CBB reneg; 475 CBB reneg;
@@ -488,7 +488,7 @@ tlsext_ri_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
488 return 1; 488 return 1;
489} 489}
490 490
491int 491static int
492tlsext_ri_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 492tlsext_ri_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
493{ 493{
494 CBS reneg, prev_client, prev_server; 494 CBS reneg, prev_client, prev_server;
@@ -546,13 +546,13 @@ tlsext_ri_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
546/* 546/*
547 * Signature Algorithms - RFC 5246 section 7.4.1.4.1. 547 * Signature Algorithms - RFC 5246 section 7.4.1.4.1.
548 */ 548 */
549int 549static int
550tlsext_sigalgs_client_needs(SSL *s, uint16_t msg_type) 550tlsext_sigalgs_client_needs(SSL *s, uint16_t msg_type)
551{ 551{
552 return (s->s3->hs.our_max_tls_version >= TLS1_2_VERSION); 552 return (s->s3->hs.our_max_tls_version >= TLS1_2_VERSION);
553} 553}
554 554
555int 555static int
556tlsext_sigalgs_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 556tlsext_sigalgs_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
557{ 557{
558 uint16_t tls_version = s->s3->hs.negotiated_tls_version; 558 uint16_t tls_version = s->s3->hs.negotiated_tls_version;
@@ -571,7 +571,7 @@ tlsext_sigalgs_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
571 return 1; 571 return 1;
572} 572}
573 573
574int 574static int
575tlsext_sigalgs_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 575tlsext_sigalgs_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
576{ 576{
577 CBS sigalgs; 577 CBS sigalgs;
@@ -586,13 +586,13 @@ tlsext_sigalgs_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
586 return 1; 586 return 1;
587} 587}
588 588
589int 589static int
590tlsext_sigalgs_server_needs(SSL *s, uint16_t msg_type) 590tlsext_sigalgs_server_needs(SSL *s, uint16_t msg_type)
591{ 591{
592 return (s->s3->hs.negotiated_tls_version >= TLS1_3_VERSION); 592 return (s->s3->hs.negotiated_tls_version >= TLS1_3_VERSION);
593} 593}
594 594
595int 595static int
596tlsext_sigalgs_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 596tlsext_sigalgs_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
597{ 597{
598 CBB sigalgs; 598 CBB sigalgs;
@@ -608,7 +608,7 @@ tlsext_sigalgs_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
608 return 1; 608 return 1;
609} 609}
610 610
611int 611static int
612tlsext_sigalgs_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 612tlsext_sigalgs_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
613{ 613{
614 CBS sigalgs; 614 CBS sigalgs;
@@ -629,13 +629,13 @@ tlsext_sigalgs_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
629/* 629/*
630 * Server Name Indication - RFC 6066, section 3. 630 * Server Name Indication - RFC 6066, section 3.
631 */ 631 */
632int 632static int
633tlsext_sni_client_needs(SSL *s, uint16_t msg_type) 633tlsext_sni_client_needs(SSL *s, uint16_t msg_type)
634{ 634{
635 return (s->tlsext_hostname != NULL); 635 return (s->tlsext_hostname != NULL);
636} 636}
637 637
638int 638static int
639tlsext_sni_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 639tlsext_sni_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
640{ 640{
641 CBB server_name_list, host_name; 641 CBB server_name_list, host_name;
@@ -735,7 +735,7 @@ tlsext_sni_is_valid_hostname(CBS *cbs, int *is_ip)
735 return 1; 735 return 1;
736} 736}
737 737
738int 738static int
739tlsext_sni_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 739tlsext_sni_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
740{ 740{
741 CBS server_name_list, host_name; 741 CBS server_name_list, host_name;
@@ -816,7 +816,7 @@ tlsext_sni_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
816 return 0; 816 return 0;
817} 817}
818 818
819int 819static int
820tlsext_sni_server_needs(SSL *s, uint16_t msg_type) 820tlsext_sni_server_needs(SSL *s, uint16_t msg_type)
821{ 821{
822 if (s->internal->hit) 822 if (s->internal->hit)
@@ -825,13 +825,13 @@ tlsext_sni_server_needs(SSL *s, uint16_t msg_type)
825 return (s->session->tlsext_hostname != NULL); 825 return (s->session->tlsext_hostname != NULL);
826} 826}
827 827
828int 828static int
829tlsext_sni_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 829tlsext_sni_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
830{ 830{
831 return 1; 831 return 1;
832} 832}
833 833
834int 834static int
835tlsext_sni_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 835tlsext_sni_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
836{ 836{
837 if (s->tlsext_hostname == NULL || CBS_len(cbs) != 0) { 837 if (s->tlsext_hostname == NULL || CBS_len(cbs) != 0) {
@@ -862,12 +862,11 @@ tlsext_sni_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
862 return 1; 862 return 1;
863} 863}
864 864
865
866/* 865/*
867 * Certificate Status Request - RFC 6066 section 8. 866 * Certificate Status Request - RFC 6066 section 8.
868 */ 867 */
869 868
870int 869static int
871tlsext_ocsp_client_needs(SSL *s, uint16_t msg_type) 870tlsext_ocsp_client_needs(SSL *s, uint16_t msg_type)
872{ 871{
873 if (msg_type != SSL_TLSEXT_MSG_CH) 872 if (msg_type != SSL_TLSEXT_MSG_CH)
@@ -876,7 +875,7 @@ tlsext_ocsp_client_needs(SSL *s, uint16_t msg_type)
876 return (s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp); 875 return (s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp);
877} 876}
878 877
879int 878static int
880tlsext_ocsp_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 879tlsext_ocsp_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
881{ 880{
882 CBB respid_list, respid, exts; 881 CBB respid_list, respid, exts;
@@ -920,7 +919,7 @@ tlsext_ocsp_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
920 return 1; 919 return 1;
921} 920}
922 921
923int 922static int
924tlsext_ocsp_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 923tlsext_ocsp_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
925{ 924{
926 int alert_desc = SSL_AD_DECODE_ERROR; 925 int alert_desc = SSL_AD_DECODE_ERROR;
@@ -993,7 +992,7 @@ tlsext_ocsp_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
993 return ret; 992 return ret;
994} 993}
995 994
996int 995static int
997tlsext_ocsp_server_needs(SSL *s, uint16_t msg_type) 996tlsext_ocsp_server_needs(SSL *s, uint16_t msg_type)
998{ 997{
999 if (s->s3->hs.negotiated_tls_version >= TLS1_3_VERSION && 998 if (s->s3->hs.negotiated_tls_version >= TLS1_3_VERSION &&
@@ -1008,7 +1007,7 @@ tlsext_ocsp_server_needs(SSL *s, uint16_t msg_type)
1008 return s->internal->tlsext_status_expected; 1007 return s->internal->tlsext_status_expected;
1009} 1008}
1010 1009
1011int 1010static int
1012tlsext_ocsp_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 1011tlsext_ocsp_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1013{ 1012{
1014 CBB ocsp_response; 1013 CBB ocsp_response;
@@ -1028,7 +1027,7 @@ tlsext_ocsp_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1028 return 1; 1027 return 1;
1029} 1028}
1030 1029
1031int 1030static int
1032tlsext_ocsp_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1031tlsext_ocsp_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1033{ 1032{
1034 uint8_t status_type; 1033 uint8_t status_type;
@@ -1081,7 +1080,7 @@ tlsext_ocsp_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1081/* 1080/*
1082 * SessionTicket extension - RFC 5077 section 3.2 1081 * SessionTicket extension - RFC 5077 section 3.2
1083 */ 1082 */
1084int 1083static int
1085tlsext_sessionticket_client_needs(SSL *s, uint16_t msg_type) 1084tlsext_sessionticket_client_needs(SSL *s, uint16_t msg_type)
1086{ 1085{
1087 /* 1086 /*
@@ -1105,7 +1104,7 @@ tlsext_sessionticket_client_needs(SSL *s, uint16_t msg_type)
1105 return 1; 1104 return 1;
1106} 1105}
1107 1106
1108int 1107static int
1109tlsext_sessionticket_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 1108tlsext_sessionticket_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1110{ 1109{
1111 /* 1110 /*
@@ -1148,7 +1147,7 @@ tlsext_sessionticket_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1148 return 1; 1147 return 1;
1149} 1148}
1150 1149
1151int 1150static int
1152tlsext_sessionticket_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, 1151tlsext_sessionticket_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
1153 int *alert) 1152 int *alert)
1154{ 1153{
@@ -1170,7 +1169,7 @@ tlsext_sessionticket_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
1170 return 1; 1169 return 1;
1171} 1170}
1172 1171
1173int 1172static int
1174tlsext_sessionticket_server_needs(SSL *s, uint16_t msg_type) 1173tlsext_sessionticket_server_needs(SSL *s, uint16_t msg_type)
1175{ 1174{
1176 return (s->internal->tlsext_ticket_expected && 1175 return (s->internal->tlsext_ticket_expected &&
@@ -1178,14 +1177,14 @@ tlsext_sessionticket_server_needs(SSL *s, uint16_t msg_type)
1178 ssl_security_tickets(s)); 1177 ssl_security_tickets(s));
1179} 1178}
1180 1179
1181int 1180static int
1182tlsext_sessionticket_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 1181tlsext_sessionticket_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1183{ 1182{
1184 /* Empty ticket */ 1183 /* Empty ticket */
1185 return 1; 1184 return 1;
1186} 1185}
1187 1186
1188int 1187static int
1189tlsext_sessionticket_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, 1188tlsext_sessionticket_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
1190 int *alert) 1189 int *alert)
1191{ 1190{
@@ -1214,13 +1213,13 @@ tlsext_sessionticket_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
1214 1213
1215#ifndef OPENSSL_NO_SRTP 1214#ifndef OPENSSL_NO_SRTP
1216 1215
1217int 1216static int
1218tlsext_srtp_client_needs(SSL *s, uint16_t msg_type) 1217tlsext_srtp_client_needs(SSL *s, uint16_t msg_type)
1219{ 1218{
1220 return SSL_is_dtls(s) && SSL_get_srtp_profiles(s) != NULL; 1219 return SSL_is_dtls(s) && SSL_get_srtp_profiles(s) != NULL;
1221} 1220}
1222 1221
1223int 1222static int
1224tlsext_srtp_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 1223tlsext_srtp_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1225{ 1224{
1226 CBB profiles, mki; 1225 CBB profiles, mki;
@@ -1257,7 +1256,7 @@ tlsext_srtp_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1257 return 1; 1256 return 1;
1258} 1257}
1259 1258
1260int 1259static int
1261tlsext_srtp_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1260tlsext_srtp_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1262{ 1261{
1263 const SRTP_PROTECTION_PROFILE *cprof, *sprof; 1262 const SRTP_PROTECTION_PROFILE *cprof, *sprof;
@@ -1332,13 +1331,13 @@ tlsext_srtp_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1332 return ret; 1331 return ret;
1333} 1332}
1334 1333
1335int 1334static int
1336tlsext_srtp_server_needs(SSL *s, uint16_t msg_type) 1335tlsext_srtp_server_needs(SSL *s, uint16_t msg_type)
1337{ 1336{
1338 return SSL_is_dtls(s) && SSL_get_selected_srtp_profile(s) != NULL; 1337 return SSL_is_dtls(s) && SSL_get_selected_srtp_profile(s) != NULL;
1339} 1338}
1340 1339
1341int 1340static int
1342tlsext_srtp_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 1341tlsext_srtp_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1343{ 1342{
1344 SRTP_PROTECTION_PROFILE *profile; 1343 SRTP_PROTECTION_PROFILE *profile;
@@ -1362,7 +1361,7 @@ tlsext_srtp_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1362 return 1; 1361 return 1;
1363} 1362}
1364 1363
1365int 1364static int
1366tlsext_srtp_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1365tlsext_srtp_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1367{ 1366{
1368 STACK_OF(SRTP_PROTECTION_PROFILE) *clnt; 1367 STACK_OF(SRTP_PROTECTION_PROFILE) *clnt;
@@ -1415,13 +1414,13 @@ tlsext_srtp_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1415/* 1414/*
1416 * TLSv1.3 Key Share - RFC 8446 section 4.2.8. 1415 * TLSv1.3 Key Share - RFC 8446 section 4.2.8.
1417 */ 1416 */
1418int 1417static int
1419tlsext_keyshare_client_needs(SSL *s, uint16_t msg_type) 1418tlsext_keyshare_client_needs(SSL *s, uint16_t msg_type)
1420{ 1419{
1421 return (s->s3->hs.our_max_tls_version >= TLS1_3_VERSION); 1420 return (s->s3->hs.our_max_tls_version >= TLS1_3_VERSION);
1422} 1421}
1423 1422
1424int 1423static int
1425tlsext_keyshare_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 1424tlsext_keyshare_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1426{ 1425{
1427 CBB client_shares, key_exchange; 1426 CBB client_shares, key_exchange;
@@ -1443,7 +1442,7 @@ tlsext_keyshare_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1443 return 1; 1442 return 1;
1444} 1443}
1445 1444
1446int 1445static int
1447tlsext_keyshare_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1446tlsext_keyshare_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1448{ 1447{
1449 CBS client_shares, key_exchange; 1448 CBS client_shares, key_exchange;
@@ -1495,14 +1494,14 @@ tlsext_keyshare_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1495 return 1; 1494 return 1;
1496} 1495}
1497 1496
1498int 1497static int
1499tlsext_keyshare_server_needs(SSL *s, uint16_t msg_type) 1498tlsext_keyshare_server_needs(SSL *s, uint16_t msg_type)
1500{ 1499{
1501 return (s->s3->hs.negotiated_tls_version >= TLS1_3_VERSION && 1500 return (s->s3->hs.negotiated_tls_version >= TLS1_3_VERSION &&
1502 tlsext_extension_seen(s, TLSEXT_TYPE_key_share)); 1501 tlsext_extension_seen(s, TLSEXT_TYPE_key_share));
1503} 1502}
1504 1503
1505int 1504static int
1506tlsext_keyshare_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 1505tlsext_keyshare_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1507{ 1506{
1508 CBB key_exchange; 1507 CBB key_exchange;
@@ -1530,7 +1529,7 @@ tlsext_keyshare_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1530 return 1; 1529 return 1;
1531} 1530}
1532 1531
1533int 1532static int
1534tlsext_keyshare_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1533tlsext_keyshare_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1535{ 1534{
1536 CBS key_exchange; 1535 CBS key_exchange;
@@ -1574,13 +1573,13 @@ tlsext_keyshare_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1574/* 1573/*
1575 * Supported Versions - RFC 8446 section 4.2.1. 1574 * Supported Versions - RFC 8446 section 4.2.1.
1576 */ 1575 */
1577int 1576static int
1578tlsext_versions_client_needs(SSL *s, uint16_t msg_type) 1577tlsext_versions_client_needs(SSL *s, uint16_t msg_type)
1579{ 1578{
1580 return (s->s3->hs.our_max_tls_version >= TLS1_3_VERSION); 1579 return (s->s3->hs.our_max_tls_version >= TLS1_3_VERSION);
1581} 1580}
1582 1581
1583int 1582static int
1584tlsext_versions_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 1583tlsext_versions_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1585{ 1584{
1586 uint16_t max, min; 1585 uint16_t max, min;
@@ -1605,7 +1604,7 @@ tlsext_versions_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1605 return 1; 1604 return 1;
1606} 1605}
1607 1606
1608int 1607static int
1609tlsext_versions_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1608tlsext_versions_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1610{ 1609{
1611 CBS versions; 1610 CBS versions;
@@ -1640,19 +1639,19 @@ tlsext_versions_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1640 return 0; 1639 return 0;
1641} 1640}
1642 1641
1643int 1642static int
1644tlsext_versions_server_needs(SSL *s, uint16_t msg_type) 1643tlsext_versions_server_needs(SSL *s, uint16_t msg_type)
1645{ 1644{
1646 return (s->s3->hs.negotiated_tls_version >= TLS1_3_VERSION); 1645 return (s->s3->hs.negotiated_tls_version >= TLS1_3_VERSION);
1647} 1646}
1648 1647
1649int 1648static int
1650tlsext_versions_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 1649tlsext_versions_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1651{ 1650{
1652 return CBB_add_u16(cbb, TLS1_3_VERSION); 1651 return CBB_add_u16(cbb, TLS1_3_VERSION);
1653} 1652}
1654 1653
1655int 1654static int
1656tlsext_versions_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1655tlsext_versions_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1657{ 1656{
1658 uint16_t selected_version; 1657 uint16_t selected_version;
@@ -1677,14 +1676,14 @@ tlsext_versions_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1677 * Cookie - RFC 8446 section 4.2.2. 1676 * Cookie - RFC 8446 section 4.2.2.
1678 */ 1677 */
1679 1678
1680int 1679static int
1681tlsext_cookie_client_needs(SSL *s, uint16_t msg_type) 1680tlsext_cookie_client_needs(SSL *s, uint16_t msg_type)
1682{ 1681{
1683 return (s->s3->hs.our_max_tls_version >= TLS1_3_VERSION && 1682 return (s->s3->hs.our_max_tls_version >= TLS1_3_VERSION &&
1684 s->s3->hs.tls13.cookie_len > 0 && s->s3->hs.tls13.cookie != NULL); 1683 s->s3->hs.tls13.cookie_len > 0 && s->s3->hs.tls13.cookie != NULL);
1685} 1684}
1686 1685
1687int 1686static int
1688tlsext_cookie_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 1687tlsext_cookie_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1689{ 1688{
1690 CBB cookie; 1689 CBB cookie;
@@ -1702,7 +1701,7 @@ tlsext_cookie_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1702 return 1; 1701 return 1;
1703} 1702}
1704 1703
1705int 1704static int
1706tlsext_cookie_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1705tlsext_cookie_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1707{ 1706{
1708 CBS cookie; 1707 CBS cookie;
@@ -1728,7 +1727,7 @@ tlsext_cookie_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1728 return 1; 1727 return 1;
1729} 1728}
1730 1729
1731int 1730static int
1732tlsext_cookie_server_needs(SSL *s, uint16_t msg_type) 1731tlsext_cookie_server_needs(SSL *s, uint16_t msg_type)
1733{ 1732{
1734 /* 1733 /*
@@ -1739,7 +1738,7 @@ tlsext_cookie_server_needs(SSL *s, uint16_t msg_type)
1739 s->s3->hs.tls13.cookie_len > 0 && s->s3->hs.tls13.cookie != NULL); 1738 s->s3->hs.tls13.cookie_len > 0 && s->s3->hs.tls13.cookie != NULL);
1740} 1739}
1741 1740
1742int 1741static int
1743tlsext_cookie_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 1742tlsext_cookie_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1744{ 1743{
1745 CBB cookie; 1744 CBB cookie;
@@ -1759,7 +1758,7 @@ tlsext_cookie_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1759 return 1; 1758 return 1;
1760} 1759}
1761 1760
1762int 1761static int
1763tlsext_cookie_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1762tlsext_cookie_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1764{ 1763{
1765 CBS cookie; 1764 CBS cookie;
@@ -1789,14 +1788,14 @@ tlsext_cookie_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1789 * Pre-Shared Key Exchange Modes - RFC 8446, 4.2.9. 1788 * Pre-Shared Key Exchange Modes - RFC 8446, 4.2.9.
1790 */ 1789 */
1791 1790
1792int 1791static int
1793tlsext_psk_kex_modes_client_needs(SSL *s, uint16_t msg_type) 1792tlsext_psk_kex_modes_client_needs(SSL *s, uint16_t msg_type)
1794{ 1793{
1795 return (s->s3->hs.tls13.use_psk_dhe_ke && 1794 return (s->s3->hs.tls13.use_psk_dhe_ke &&
1796 s->s3->hs.our_max_tls_version >= TLS1_3_VERSION); 1795 s->s3->hs.our_max_tls_version >= TLS1_3_VERSION);
1797} 1796}
1798 1797
1799int 1798static int
1800tlsext_psk_kex_modes_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 1799tlsext_psk_kex_modes_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1801{ 1800{
1802 CBB ke_modes; 1801 CBB ke_modes;
@@ -1814,7 +1813,7 @@ tlsext_psk_kex_modes_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1814 return 1; 1813 return 1;
1815} 1814}
1816 1815
1817int 1816static int
1818tlsext_psk_kex_modes_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, 1817tlsext_psk_kex_modes_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
1819 int *alert) 1818 int *alert)
1820{ 1819{
@@ -1835,20 +1834,20 @@ tlsext_psk_kex_modes_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
1835 return 1; 1834 return 1;
1836} 1835}
1837 1836
1838int 1837static int
1839tlsext_psk_kex_modes_server_needs(SSL *s, uint16_t msg_type) 1838tlsext_psk_kex_modes_server_needs(SSL *s, uint16_t msg_type)
1840{ 1839{
1841 /* Servers MUST NOT send this extension. */ 1840 /* Servers MUST NOT send this extension. */
1842 return 0; 1841 return 0;
1843} 1842}
1844 1843
1845int 1844static int
1846tlsext_psk_kex_modes_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 1845tlsext_psk_kex_modes_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1847{ 1846{
1848 return 0; 1847 return 0;
1849} 1848}
1850 1849
1851int 1850static int
1852tlsext_psk_kex_modes_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, 1851tlsext_psk_kex_modes_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
1853 int *alert) 1852 int *alert)
1854{ 1853{
@@ -1859,37 +1858,37 @@ tlsext_psk_kex_modes_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
1859 * Pre-Shared Key Extension - RFC 8446, 4.2.11 1858 * Pre-Shared Key Extension - RFC 8446, 4.2.11
1860 */ 1859 */
1861 1860
1862int 1861static int
1863tlsext_psk_client_needs(SSL *s, uint16_t msg_type) 1862tlsext_psk_client_needs(SSL *s, uint16_t msg_type)
1864{ 1863{
1865 return 0; 1864 return 0;
1866} 1865}
1867 1866
1868int 1867static int
1869tlsext_psk_client_build(SSL *s, uint16_t msg_type, CBB *cbb) 1868tlsext_psk_client_build(SSL *s, uint16_t msg_type, CBB *cbb)
1870{ 1869{
1871 return 0; 1870 return 0;
1872} 1871}
1873 1872
1874int 1873static int
1875tlsext_psk_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1874tlsext_psk_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1876{ 1875{
1877 return CBS_skip(cbs, CBS_len(cbs)); 1876 return CBS_skip(cbs, CBS_len(cbs));
1878} 1877}
1879 1878
1880int 1879static int
1881tlsext_psk_server_needs(SSL *s, uint16_t msg_type) 1880tlsext_psk_server_needs(SSL *s, uint16_t msg_type)
1882{ 1881{
1883 return 0; 1882 return 0;
1884} 1883}
1885 1884
1886int 1885static int
1887tlsext_psk_server_build(SSL *s, uint16_t msg_type, CBB *cbb) 1886tlsext_psk_server_build(SSL *s, uint16_t msg_type, CBB *cbb)
1888{ 1887{
1889 return 0; 1888 return 0;
1890} 1889}
1891 1890
1892int 1891static int
1893tlsext_psk_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) 1892tlsext_psk_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1894{ 1893{
1895 return CBS_skip(cbs, CBS_len(cbs)); 1894 return CBS_skip(cbs, CBS_len(cbs));
@@ -1899,13 +1898,13 @@ tlsext_psk_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1899 * QUIC transport parameters extension - RFC 9001 section 8.2. 1898 * QUIC transport parameters extension - RFC 9001 section 8.2.
1900 */ 1899 */
1901 1900
1902int 1901static int
1903tlsext_quic_transport_parameters_client_needs(SSL *s, uint16_t msg_type) 1902tlsext_quic_transport_parameters_client_needs(SSL *s, uint16_t msg_type)
1904{ 1903{
1905 return SSL_is_quic(s) && s->internal->quic_transport_params_len > 0; 1904 return SSL_is_quic(s) && s->internal->quic_transport_params_len > 0;
1906} 1905}
1907 1906
1908int 1907static int
1909tlsext_quic_transport_parameters_client_build(SSL *s, uint16_t msg_type, 1908tlsext_quic_transport_parameters_client_build(SSL *s, uint16_t msg_type,
1910 CBB *cbb) 1909 CBB *cbb)
1911{ 1910{
@@ -1916,7 +1915,7 @@ tlsext_quic_transport_parameters_client_build(SSL *s, uint16_t msg_type,
1916 return 1; 1915 return 1;
1917} 1916}
1918 1917
1919int 1918static int
1920tlsext_quic_transport_parameters_client_parse(SSL *s, uint16_t msg_type, 1919tlsext_quic_transport_parameters_client_parse(SSL *s, uint16_t msg_type,
1921 CBS *cbs, int *alert) 1920 CBS *cbs, int *alert)
1922{ 1921{
@@ -1934,13 +1933,13 @@ tlsext_quic_transport_parameters_client_parse(SSL *s, uint16_t msg_type,
1934 return 1; 1933 return 1;
1935} 1934}
1936 1935
1937int 1936static int
1938tlsext_quic_transport_parameters_server_needs(SSL *s, uint16_t msg_type) 1937tlsext_quic_transport_parameters_server_needs(SSL *s, uint16_t msg_type)
1939{ 1938{
1940 return SSL_is_quic(s) && s->internal->quic_transport_params_len > 0; 1939 return SSL_is_quic(s) && s->internal->quic_transport_params_len > 0;
1941} 1940}
1942 1941
1943int 1942static int
1944tlsext_quic_transport_parameters_server_build(SSL *s, uint16_t msg_type, 1943tlsext_quic_transport_parameters_server_build(SSL *s, uint16_t msg_type,
1945 CBB *cbb) 1944 CBB *cbb)
1946{ 1945{
@@ -1951,7 +1950,7 @@ tlsext_quic_transport_parameters_server_build(SSL *s, uint16_t msg_type,
1951 return 1; 1950 return 1;
1952} 1951}
1953 1952
1954int 1953static int
1955tlsext_quic_transport_parameters_server_parse(SSL *s, uint16_t msg_type, 1954tlsext_quic_transport_parameters_server_parse(SSL *s, uint16_t msg_type,
1956 CBS *cbs, int *alert) 1955 CBS *cbs, int *alert)
1957{ 1956{
@@ -2233,7 +2232,7 @@ tlsext_extension_seen(SSL *s, uint16_t type)
2233 return ((s->s3->hs.extensions_seen & (1 << idx)) != 0); 2232 return ((s->s3->hs.extensions_seen & (1 << idx)) != 0);
2234} 2233}
2235 2234
2236static const struct tls_extension_funcs * 2235const struct tls_extension_funcs *
2237tlsext_funcs(const struct tls_extension *tlsext, int is_server) 2236tlsext_funcs(const struct tls_extension *tlsext, int is_server)
2238{ 2237{
2239 if (is_server) 2238 if (is_server)
diff --git a/src/lib/libssl/ssl_tlsext.h b/src/lib/libssl/ssl_tlsext.h
index 393ee5d90d..7a41c8095d 100644
--- a/src/lib/libssl/ssl_tlsext.h
+++ b/src/lib/libssl/ssl_tlsext.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_tlsext.h,v 1.31 2022/07/20 13:35:05 tb Exp $ */ 1/* $OpenBSD: ssl_tlsext.h,v 1.32 2022/08/04 09:27:36 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> 4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
@@ -32,138 +32,16 @@
32__BEGIN_HIDDEN_DECLS 32__BEGIN_HIDDEN_DECLS
33 33
34int tlsext_alpn_check_format(CBS *cbs); 34int tlsext_alpn_check_format(CBS *cbs);
35int tlsext_alpn_client_needs(SSL *s, uint16_t msg_type);
36int tlsext_alpn_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
37int tlsext_alpn_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
38int tlsext_alpn_server_needs(SSL *s, uint16_t msg_type);
39int tlsext_alpn_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
40int tlsext_alpn_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
41
42int tlsext_ri_client_needs(SSL *s, uint16_t msg_type);
43int tlsext_ri_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
44int tlsext_ri_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
45int tlsext_ri_server_needs(SSL *s, uint16_t msg_type);
46int tlsext_ri_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
47int tlsext_ri_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
48
49int tlsext_sigalgs_client_needs(SSL *s, uint16_t msg_type);
50int tlsext_sigalgs_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
51int tlsext_sigalgs_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
52 int *alert);
53int tlsext_sigalgs_server_needs(SSL *s, uint16_t msg_type);
54int tlsext_sigalgs_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
55int tlsext_sigalgs_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
56 int *alert);
57
58int tlsext_sni_client_needs(SSL *s, uint16_t msg_type);
59int tlsext_sni_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
60int tlsext_sni_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
61int tlsext_sni_server_needs(SSL *s, uint16_t msg_type);
62int tlsext_sni_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
63int tlsext_sni_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
64int tlsext_sni_is_valid_hostname(CBS *cbs, int *is_ip); 35int tlsext_sni_is_valid_hostname(CBS *cbs, int *is_ip);
65 36
66int tlsext_supportedgroups_client_needs(SSL *s, uint16_t msg_type);
67int tlsext_supportedgroups_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
68int tlsext_supportedgroups_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
69 int *alert);
70int tlsext_supportedgroups_server_needs(SSL *s, uint16_t msg_type);
71int tlsext_supportedgroups_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
72int tlsext_supportedgroups_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
73 int *alert);
74
75int tlsext_ecpf_client_needs(SSL *s, uint16_t msg_type);
76int tlsext_ecpf_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
77int tlsext_ecpf_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
78int tlsext_ecpf_server_needs(SSL *s, uint16_t msg_type);
79int tlsext_ecpf_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
80int tlsext_ecpf_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
81
82int tlsext_ocsp_client_needs(SSL *s, uint16_t msg_type);
83int tlsext_ocsp_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
84int tlsext_ocsp_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
85int tlsext_ocsp_server_needs(SSL *s, uint16_t msg_type);
86int tlsext_ocsp_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
87int tlsext_ocsp_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
88
89int tlsext_sessionticket_client_needs(SSL *s, uint16_t msg_type);
90int tlsext_sessionticket_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
91int tlsext_sessionticket_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
92 int *alert);
93int tlsext_sessionticket_server_needs(SSL *s, uint16_t msg_type);
94int tlsext_sessionticket_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
95int tlsext_sessionticket_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
96 int *alert);
97
98int tlsext_versions_client_needs(SSL *s, uint16_t msg_type);
99int tlsext_versions_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
100int tlsext_versions_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
101 int *alert);
102int tlsext_versions_server_needs(SSL *s, uint16_t msg_type);
103int tlsext_versions_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
104int tlsext_versions_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
105 int *alert);
106
107int tlsext_keyshare_client_needs(SSL *s, uint16_t msg_type);
108int tlsext_keyshare_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
109int tlsext_keyshare_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
110 int *alert);
111int tlsext_keyshare_server_needs(SSL *s, uint16_t msg_type);
112int tlsext_keyshare_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
113int tlsext_keyshare_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
114 int *alert);
115
116int tlsext_cookie_client_needs(SSL *s, uint16_t msg_type);
117int tlsext_cookie_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
118int tlsext_cookie_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
119int tlsext_cookie_server_needs(SSL *s, uint16_t msg_type);
120int tlsext_cookie_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
121int tlsext_cookie_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
122
123int tlsext_psk_kex_modes_client_needs(SSL *s, uint16_t msg_type);
124int tlsext_psk_kex_modes_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
125int tlsext_psk_kex_modes_client_parse(SSL *s, uint16_t msg_type, CBS *cbs,
126 int *alert);
127int tlsext_psk_kex_modes_server_needs(SSL *s, uint16_t msg_type);
128int tlsext_psk_kex_modes_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
129int tlsext_psk_kex_modes_server_parse(SSL *s, uint16_t msg_type, CBS *cbs,
130 int *alert);
131
132int tlsext_psk_client_needs(SSL *s, uint16_t msg_type);
133int tlsext_psk_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
134int tlsext_psk_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
135int tlsext_psk_server_needs(SSL *s, uint16_t msg_type);
136int tlsext_psk_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
137int tlsext_psk_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
138
139#ifndef OPENSSL_NO_SRTP
140int tlsext_srtp_client_needs(SSL *s, uint16_t msg_type);
141int tlsext_srtp_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
142int tlsext_srtp_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
143int tlsext_srtp_server_needs(SSL *s, uint16_t msg_type);
144int tlsext_srtp_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
145int tlsext_srtp_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
146#endif
147
148int tlsext_quic_transport_parameters_client_needs(SSL *s, uint16_t msg_type);
149int tlsext_quic_transport_parameters_client_build(SSL *s, uint16_t msg_type,
150 CBB *cbb);
151int tlsext_quic_transport_parameters_client_parse(SSL *s, uint16_t msg_type,
152 CBS *cbs, int *alert);
153int tlsext_quic_transport_parameters_server_needs(SSL *s, uint16_t msg_type);
154int tlsext_quic_transport_parameters_server_build(SSL *s, uint16_t msg_type,
155 CBB *cbb);
156int tlsext_quic_transport_parameters_server_parse(SSL *s, uint16_t msg_type,
157 CBS *cbs, int *alert);
158
159int tlsext_client_build(SSL *s, uint16_t msg_type, CBB *cbb); 37int tlsext_client_build(SSL *s, uint16_t msg_type, CBB *cbb);
160int tlsext_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert); 38int tlsext_client_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
161 39
162int tlsext_server_build(SSL *s, uint16_t msg_type, CBB *cbb); 40int tlsext_server_build(SSL *s, uint16_t msg_type, CBB *cbb);
163int tlsext_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert); 41int tlsext_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert);
164 42
165const struct tls_extension *tls_extension_find(uint16_t, size_t *);
166int tlsext_extension_seen(SSL *s, uint16_t); 43int tlsext_extension_seen(SSL *s, uint16_t);
44
167__END_HIDDEN_DECLS 45__END_HIDDEN_DECLS
168 46
169#endif 47#endif