summaryrefslogtreecommitdiff
path: root/src/lib/libssl/d1_pkt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/d1_pkt.c')
-rw-r--r--src/lib/libssl/d1_pkt.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index ef9bcaa786..88c2fa9adf 100644
--- a/src/lib/libssl/d1_pkt.c
+++ b/src/lib/libssl/d1_pkt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_pkt.c,v 1.52 2017/01/23 04:15:28 jsing Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.53 2017/01/23 04:55:26 beck 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.
@@ -596,7 +596,7 @@ again:
596 * anything while listening. 596 * anything while listening.
597 */ 597 */
598 if (is_next_epoch) { 598 if (is_next_epoch) {
599 if ((SSL_in_init(s) || s->in_handshake) && !D1I(s)->listen) { 599 if ((SSL_in_init(s) || s->internal->in_handshake) && !D1I(s)->listen) {
600 if (dtls1_buffer_record(s, &(D1I(s)->unprocessed_rcds), 600 if (dtls1_buffer_record(s, &(D1I(s)->unprocessed_rcds),
601 rr->seq_num) < 0) 601 rr->seq_num) < 0)
602 return (-1); 602 return (-1);
@@ -667,10 +667,10 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
667 667
668 /* Now D1I(s)->handshake_fragment_len == 0 if type == SSL3_RT_HANDSHAKE. */ 668 /* Now D1I(s)->handshake_fragment_len == 0 if type == SSL3_RT_HANDSHAKE. */
669 669
670 if (!s->in_handshake && SSL_in_init(s)) 670 if (!s->internal->in_handshake && SSL_in_init(s))
671 { 671 {
672 /* type == SSL3_RT_APPLICATION_DATA */ 672 /* type == SSL3_RT_APPLICATION_DATA */
673 i = s->handshake_func(s); 673 i = s->internal->handshake_func(s);
674 if (i < 0) 674 if (i < 0)
675 return (i); 675 return (i);
676 if (i == 0) { 676 if (i == 0) {
@@ -875,9 +875,9 @@ start:
875 875
876 /* no need to check sequence number on HELLO REQUEST messages */ 876 /* no need to check sequence number on HELLO REQUEST messages */
877 877
878 if (s->msg_callback) 878 if (s->internal->msg_callback)
879 s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, 879 s->internal->msg_callback(0, s->version, SSL3_RT_HANDSHAKE,
880 D1I(s)->handshake_fragment, 4, s, s->msg_callback_arg); 880 D1I(s)->handshake_fragment, 4, s, s->internal->msg_callback_arg);
881 881
882 if (SSL_is_init_finished(s) && 882 if (SSL_is_init_finished(s) &&
883 !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && 883 !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) &&
@@ -886,7 +886,7 @@ start:
886 s->new_session = 1; 886 s->new_session = 1;
887 ssl3_renegotiate(s); 887 ssl3_renegotiate(s);
888 if (ssl3_renegotiate_check(s)) { 888 if (ssl3_renegotiate_check(s)) {
889 i = s->handshake_func(s); 889 i = s->internal->handshake_func(s);
890 if (i < 0) 890 if (i < 0)
891 return (i); 891 return (i);
892 if (i == 0) { 892 if (i == 0) {
@@ -922,12 +922,12 @@ start:
922 922
923 D1I(s)->alert_fragment_len = 0; 923 D1I(s)->alert_fragment_len = 0;
924 924
925 if (s->msg_callback) 925 if (s->internal->msg_callback)
926 s->msg_callback(0, s->version, SSL3_RT_ALERT, 926 s->internal->msg_callback(0, s->version, SSL3_RT_ALERT,
927 D1I(s)->alert_fragment, 2, s, s->msg_callback_arg); 927 D1I(s)->alert_fragment, 2, s, s->internal->msg_callback_arg);
928 928
929 if (s->info_callback != NULL) 929 if (s->internal->info_callback != NULL)
930 cb = s->info_callback; 930 cb = s->internal->info_callback;
931 else if (s->ctx->internal->info_callback != NULL) 931 else if (s->ctx->internal->info_callback != NULL)
932 cb = s->ctx->internal->info_callback; 932 cb = s->ctx->internal->info_callback;
933 933
@@ -987,9 +987,9 @@ start:
987 987
988 rr->length = 0; 988 rr->length = 0;
989 989
990 if (s->msg_callback) 990 if (s->internal->msg_callback)
991 s->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC, 991 s->internal->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC,
992 rr->data, 1, s, s->msg_callback_arg); 992 rr->data, 1, s, s->internal->msg_callback_arg);
993 993
994 /* We can't process a CCS now, because previous handshake 994 /* We can't process a CCS now, because previous handshake
995 * messages are still missing, so just drop it. 995 * messages are still missing, so just drop it.
@@ -1012,7 +1012,7 @@ start:
1012 1012
1013 /* Unexpected handshake message (Client Hello, or protocol violation) */ 1013 /* Unexpected handshake message (Client Hello, or protocol violation) */
1014 if ((D1I(s)->handshake_fragment_len >= DTLS1_HM_HEADER_LENGTH) && 1014 if ((D1I(s)->handshake_fragment_len >= DTLS1_HM_HEADER_LENGTH) &&
1015 !s->in_handshake) { 1015 !s->internal->in_handshake) {
1016 struct hm_header_st msg_hdr; 1016 struct hm_header_st msg_hdr;
1017 1017
1018 /* this may just be a stale retransmit */ 1018 /* this may just be a stale retransmit */
@@ -1041,7 +1041,7 @@ start:
1041 s->renegotiate = 1; 1041 s->renegotiate = 1;
1042 s->new_session = 1; 1042 s->new_session = 1;
1043 } 1043 }
1044 i = s->handshake_func(s); 1044 i = s->internal->handshake_func(s);
1045 if (i < 0) 1045 if (i < 0)
1046 return (i); 1046 return (i);
1047 if (i == 0) { 1047 if (i == 0) {
@@ -1081,7 +1081,7 @@ start:
1081 case SSL3_RT_ALERT: 1081 case SSL3_RT_ALERT:
1082 case SSL3_RT_HANDSHAKE: 1082 case SSL3_RT_HANDSHAKE:
1083 /* we already handled all of these, with the possible exception 1083 /* we already handled all of these, with the possible exception
1084 * of SSL3_RT_HANDSHAKE when s->in_handshake is set, but that 1084 * of SSL3_RT_HANDSHAKE when s->internal->in_handshake is set, but that
1085 * should not happen when type != rr->type */ 1085 * should not happen when type != rr->type */
1086 al = SSL_AD_UNEXPECTED_MESSAGE; 1086 al = SSL_AD_UNEXPECTED_MESSAGE;
1087 SSLerr(SSL_F_DTLS1_READ_BYTES, ERR_R_INTERNAL_ERROR); 1087 SSLerr(SSL_F_DTLS1_READ_BYTES, ERR_R_INTERNAL_ERROR);
@@ -1123,9 +1123,9 @@ dtls1_write_app_data_bytes(SSL *s, int type, const void *buf_, int len)
1123{ 1123{
1124 int i; 1124 int i;
1125 1125
1126 if (SSL_in_init(s) && !s->in_handshake) 1126 if (SSL_in_init(s) && !s->internal->in_handshake)
1127 { 1127 {
1128 i = s->handshake_func(s); 1128 i = s->internal->handshake_func(s);
1129 if (i < 0) 1129 if (i < 0)
1130 return (i); 1130 return (i);
1131 if (i == 0) { 1131 if (i == 0) {
@@ -1422,12 +1422,12 @@ dtls1_dispatch_alert(SSL *s)
1422 ) 1422 )
1423 (void)BIO_flush(s->wbio); 1423 (void)BIO_flush(s->wbio);
1424 1424
1425 if (s->msg_callback) 1425 if (s->internal->msg_callback)
1426 s->msg_callback(1, s->version, SSL3_RT_ALERT, 1426 s->internal->msg_callback(1, s->version, SSL3_RT_ALERT,
1427 s->s3->send_alert, 2, s, s->msg_callback_arg); 1427 s->s3->send_alert, 2, s, s->internal->msg_callback_arg);
1428 1428
1429 if (s->info_callback != NULL) 1429 if (s->internal->info_callback != NULL)
1430 cb = s->info_callback; 1430 cb = s->internal->info_callback;
1431 else if (s->ctx->internal->info_callback != NULL) 1431 else if (s->ctx->internal->info_callback != NULL)
1432 cb = s->ctx->internal->info_callback; 1432 cb = s->ctx->internal->info_callback;
1433 1433