summaryrefslogtreecommitdiff
path: root/thirdparty/openssl/ssl/s3_pkt.c
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/openssl/ssl/s3_pkt.c')
-rw-r--r--thirdparty/openssl/ssl/s3_pkt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/thirdparty/openssl/ssl/s3_pkt.c b/thirdparty/openssl/ssl/s3_pkt.c
index 0290c991d8..b914568430 100644
--- a/thirdparty/openssl/ssl/s3_pkt.c
+++ b/thirdparty/openssl/ssl/s3_pkt.c
@@ -1324,10 +1324,16 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
}
#ifndef OPENSSL_NO_HEARTBEATS
else if (rr->type == TLS1_RT_HEARTBEAT) {
- tls1_process_heartbeat(s);
+ i = tls1_process_heartbeat(s);
+
+ if (i < 0)
+ return i;
- /* Exit and notify application to read again */
rr->length = 0;
+ if (s->mode & SSL_MODE_AUTO_RETRY)
+ goto start;
+
+ /* Exit and notify application to read again */
s->rwstate = SSL_READING;
BIO_clear_retry_flags(SSL_get_rbio(s));
BIO_set_retry_read(SSL_get_rbio(s));
@@ -1427,7 +1433,7 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
(s->s3->handshake_fragment_len >= 4) &&
(s->s3->handshake_fragment[0] == SSL3_MT_CLIENT_HELLO) &&
(s->session != NULL) && (s->session->cipher != NULL) &&
- !(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) {
+ !(s->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) {
/*
* s->s3->handshake_fragment_len = 0;
*/