summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/t1_lib.c')
-rw-r--r--src/lib/libssl/t1_lib.c71
1 files changed, 1 insertions, 70 deletions
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c
index 1cef08d094..fbd79431db 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.139 2017/10/11 17:35:00 jsing Exp $ */ 1/* $OpenBSD: t1_lib.c,v 1.140 2018/01/27 15:30:05 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 *
@@ -662,75 +662,6 @@ tls12_get_req_sig_algs(SSL *s, unsigned char **sigalgs, size_t *sigalgs_len)
662} 662}
663 663
664int 664int
665ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
666 int n, int *al)
667{
668 unsigned short type;
669 unsigned short size;
670 unsigned short len;
671 unsigned char *data = *p;
672 unsigned char *end = d + n;
673 CBS cbs;
674
675 s->internal->servername_done = 0;
676 s->tlsext_status_type = -1;
677 S3I(s)->renegotiate_seen = 0;
678 free(S3I(s)->alpn_selected);
679 S3I(s)->alpn_selected = NULL;
680 s->internal->srtp_profile = NULL;
681
682 if (data == end)
683 goto ri_check;
684
685 if (end - data < 2)
686 goto err;
687 n2s(data, len);
688
689 if (end - data != len)
690 goto err;
691
692 while (end - data >= 4) {
693 n2s(data, type);
694 n2s(data, size);
695
696 if (end - data < size)
697 goto err;
698
699 if (s->internal->tlsext_debug_cb)
700 s->internal->tlsext_debug_cb(s, 0, type, data, size,
701 s->internal->tlsext_debug_arg);
702
703 CBS_init(&cbs, data, size);
704 if (!tlsext_clienthello_parse_one(s, &cbs, type, al))
705 return 0;
706
707 data += size;
708 }
709
710 /* Spurious data on the end */
711 if (data != end)
712 goto err;
713
714 *p = data;
715
716ri_check:
717
718 /* Need RI if renegotiating */
719
720 if (!S3I(s)->renegotiate_seen && s->internal->renegotiate) {
721 *al = SSL_AD_HANDSHAKE_FAILURE;
722 SSLerror(s, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED);
723 return 0;
724 }
725
726 return 1;
727
728err:
729 *al = SSL_AD_DECODE_ERROR;
730 return 0;
731}
732
733int
734ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, size_t n, int *al) 665ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, size_t n, int *al)
735{ 666{
736 unsigned short type; 667 unsigned short type;