summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_pkt.c
diff options
context:
space:
mode:
authorbeck <>2000-12-15 02:58:47 +0000
committerbeck <>2000-12-15 02:58:47 +0000
commit9200bb13d15da4b2a23e6bc92c20e95b74aa2113 (patch)
tree5c52d628ec1e34be76e7ef2a4235d248b7c44d24 /src/lib/libssl/s3_pkt.c
parente131d25072e3d4197ba4b9bcc0d1b27d34d6488d (diff)
downloadopenbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.tar.gz
openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.tar.bz2
openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.zip
openssl-engine-0.9.6 merge
Diffstat (limited to 'src/lib/libssl/s3_pkt.c')
-rw-r--r--src/lib/libssl/s3_pkt.c54
1 files changed, 29 insertions, 25 deletions
diff --git a/src/lib/libssl/s3_pkt.c b/src/lib/libssl/s3_pkt.c
index eb965310d9..1414079853 100644
--- a/src/lib/libssl/s3_pkt.c
+++ b/src/lib/libssl/s3_pkt.c
@@ -899,19 +899,21 @@ start:
899 return(-1); 899 return(-1);
900 } 900 }
901 901
902 if (s->s3->rbuf.left == 0) /* no read-ahead left? */ 902 if (!(s->mode & SSL_MODE_AUTO_RETRY))
903 { 903 {
904 BIO *bio; 904 if (s->s3->rbuf.left == 0) /* no read-ahead left? */
905 /* In the case where we try to read application data 905 {
906 * the first time, but we trigger an SSL handshake, we 906 BIO *bio;
907 * return -1 with the retry option set. I do this 907 /* In the case where we try to read application data,
908 * otherwise renegotiation can cause nasty problems 908 * but we trigger an SSL handshake, we return -1 with
909 * in the blocking world */ /* ? */ 909 * the retry option set. Otherwise renegotiation may
910 s->rwstate=SSL_READING; 910 * cause nasty problems in the blocking world */
911 bio=SSL_get_rbio(s); 911 s->rwstate=SSL_READING;
912 BIO_clear_retry_flags(bio); 912 bio=SSL_get_rbio(s);
913 BIO_set_retry_read(bio); 913 BIO_clear_retry_flags(bio);
914 return(-1); 914 BIO_set_retry_read(bio);
915 return(-1);
916 }
915 } 917 }
916 } 918 }
917 } 919 }
@@ -954,7 +956,7 @@ start:
954 s->rwstate=SSL_NOTHING; 956 s->rwstate=SSL_NOTHING;
955 s->s3->fatal_alert = alert_descr; 957 s->s3->fatal_alert = alert_descr;
956 SSLerr(SSL_F_SSL3_READ_BYTES, SSL_AD_REASON_OFFSET + alert_descr); 958 SSLerr(SSL_F_SSL3_READ_BYTES, SSL_AD_REASON_OFFSET + alert_descr);
957 sprintf(tmp,"%d",alert_descr); 959 BIO_snprintf(tmp,sizeof tmp,"%d",alert_descr);
958 ERR_add_error_data(2,"SSL alert number ",tmp); 960 ERR_add_error_data(2,"SSL alert number ",tmp);
959 s->shutdown|=SSL_RECEIVED_SHUTDOWN; 961 s->shutdown|=SSL_RECEIVED_SHUTDOWN;
960 SSL_CTX_remove_session(s->ctx,s->session); 962 SSL_CTX_remove_session(s->ctx,s->session);
@@ -1022,19 +1024,21 @@ start:
1022 return(-1); 1024 return(-1);
1023 } 1025 }
1024 1026
1025 if (s->s3->rbuf.left == 0) /* no read-ahead left? */ 1027 if (!(s->mode & SSL_MODE_AUTO_RETRY))
1026 { 1028 {
1027 BIO *bio; 1029 if (s->s3->rbuf.left == 0) /* no read-ahead left? */
1028 /* In the case where we try to read application data 1030 {
1029 * the first time, but we trigger an SSL handshake, we 1031 BIO *bio;
1030 * return -1 with the retry option set. I do this 1032 /* In the case where we try to read application data,
1031 * otherwise renegotiation can cause nasty problems 1033 * but we trigger an SSL handshake, we return -1 with
1032 * in the blocking world */ /* ? */ 1034 * the retry option set. Otherwise renegotiation may
1033 s->rwstate=SSL_READING; 1035 * cause nasty problems in the blocking world */
1034 bio=SSL_get_rbio(s); 1036 s->rwstate=SSL_READING;
1035 BIO_clear_retry_flags(bio); 1037 bio=SSL_get_rbio(s);
1036 BIO_set_retry_read(bio); 1038 BIO_clear_retry_flags(bio);
1037 return(-1); 1039 BIO_set_retry_read(bio);
1040 return(-1);
1041 }
1038 } 1042 }
1039 goto start; 1043 goto start;
1040 } 1044 }