diff options
Diffstat (limited to 'src/lib/libssl/d1_pkt.c')
-rw-r--r-- | src/lib/libssl/d1_pkt.c | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index 7aea85a4c4..9601a39e3a 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.113 2021/10/23 13:36:03 jsing Exp $ */ | 1 | /* $OpenBSD: d1_pkt.c,v 1.114 2021/10/25 10:09:28 jsing 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. |
@@ -654,14 +654,9 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) | |||
654 | * Application data while renegotiating is allowed. | 654 | * Application data while renegotiating is allowed. |
655 | * Try reading again. | 655 | * Try reading again. |
656 | */ | 656 | */ |
657 | BIO *bio; | ||
658 | |||
659 | S3I(s)->in_read_app_data = 2; | 657 | S3I(s)->in_read_app_data = 2; |
660 | bio = SSL_get_rbio(s); | 658 | ssl_force_want_read(s); |
661 | s->internal->rwstate = SSL_READING; | 659 | return -1; |
662 | BIO_clear_retry_flags(bio); | ||
663 | BIO_set_retry_read(bio); | ||
664 | return (-1); | ||
665 | } else { | 660 | } else { |
666 | /* Not certain if this is the right error handling */ | 661 | /* Not certain if this is the right error handling */ |
667 | al = SSL_AD_UNEXPECTED_MESSAGE; | 662 | al = SSL_AD_UNEXPECTED_MESSAGE; |
@@ -714,17 +709,8 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) | |||
714 | } | 709 | } |
715 | 710 | ||
716 | if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { | 711 | if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { |
717 | if (S3I(s)->rbuf.left == 0) /* no read-ahead left? */ | 712 | if (S3I(s)->rbuf.left == 0) { |
718 | { | 713 | ssl_force_want_read(s); |
719 | BIO *bio; | ||
720 | /* In the case where we try to read application data, | ||
721 | * but we trigger an SSL handshake, we return -1 with | ||
722 | * the retry option set. Otherwise renegotiation may | ||
723 | * cause nasty problems in the blocking world */ | ||
724 | s->internal->rwstate = SSL_READING; | ||
725 | bio = SSL_get_rbio(s); | ||
726 | BIO_clear_retry_flags(bio); | ||
727 | BIO_set_retry_read(bio); | ||
728 | return (-1); | 714 | return (-1); |
729 | } | 715 | } |
730 | } | 716 | } |
@@ -851,17 +837,8 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) | |||
851 | } | 837 | } |
852 | 838 | ||
853 | if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { | 839 | if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { |
854 | if (S3I(s)->rbuf.left == 0) /* no read-ahead left? */ | 840 | if (S3I(s)->rbuf.left == 0) { |
855 | { | 841 | ssl_force_want_read(s); |
856 | BIO *bio; | ||
857 | /* In the case where we try to read application data, | ||
858 | * but we trigger an SSL handshake, we return -1 with | ||
859 | * the retry option set. Otherwise renegotiation may | ||
860 | * cause nasty problems in the blocking world */ | ||
861 | s->internal->rwstate = SSL_READING; | ||
862 | bio = SSL_get_rbio(s); | ||
863 | BIO_clear_retry_flags(bio); | ||
864 | BIO_set_retry_read(bio); | ||
865 | return (-1); | 842 | return (-1); |
866 | } | 843 | } |
867 | } | 844 | } |