aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2018-12-29 01:41:39 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2018-12-29 01:41:39 +0000
commita45e2ee8f04e0b8424ad185dcf81ec8fa884cc91 (patch)
treefb4a69955addadc27a896f21999459b0273cf29a
parent06b4555a0ec1faa55dea504da77551876e8ce285 (diff)
downloadlynx-snapshots-a45e2ee8f04e0b8424ad185dcf81ec8fa884cc91.tar.gz
snapshot of project "lynx", label v2-9-0dev_0h
-rw-r--r--CHANGES4
-rw-r--r--src/tidy_tls.c28
2 files changed, 25 insertions, 7 deletions
diff --git a/CHANGES b/CHANGES
index da7678f0..1465de98 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,11 @@
--- $LynxId: CHANGES,v 1.1003 2018/12/29 00:36:37 tom Exp $
+-- $LynxId: CHANGES,v 1.1004 2018/12/29 01:32:29 tom Exp $
===============================================================================
Changes since Lynx 2.8 release
===============================================================================
2018-12-28 (2.9.0dev.1)
+* modify tidy_tls.c to work with TLS 1.3 when built with gnutls 3.6.5 or later
+ (patch by Andreas Metzler).
* add to experimental Japanese UTF-8 feature -KH
+ fix JIS X 0201 Katakana conversion from Shift_JIS/EUC-JP to UTF-8.
http://www1.interq.or.jp/~deton/lynx-sjisjisx0201/
diff --git a/src/tidy_tls.c b/src/tidy_tls.c
index aa8be758..cda9a407 100644
--- a/src/tidy_tls.c
+++ b/src/tidy_tls.c
@@ -1,6 +1,6 @@
/*
- * $LynxId: tidy_tls.c,v 1.35 2016/11/24 18:48:02 tom Exp $
- * Copyright 2008-2015,2016 Thomas E. Dickey
+ * $LynxId: tidy_tls.c,v 1.37 2018/12/29 01:41:39 tom Exp $
+ * Copyright 2008-2016,2018 Thomas E. Dickey
* with fix Copyright 2008 by Thomas Viehmann
*
* Required libraries:
@@ -462,13 +462,26 @@ int SSL_read(SSL * ssl, void *buffer, int length)
{
int rc;
- rc = (int) gnutls_record_recv(ssl->gnutls_state, buffer, (size_t) length);
+ do {
+ rc = (int) gnutls_record_recv(ssl->gnutls_state, buffer, (size_t) length);
+ }
+ while ((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED));
if (rc < 0 && gnutls_error_is_fatal(rc) == 0) {
if (rc == GNUTLS_E_REHANDSHAKE) {
(void) gnutls_handshake(ssl->gnutls_state);
- gnutls_record_send(ssl->gnutls_state, ssl->sendbuffer, (size_t) ssl->bytes_sent);
- rc = (int) gnutls_record_recv(ssl->gnutls_state, buffer, (size_t) length);
+ do {
+ rc = (int) gnutls_record_send(ssl->gnutls_state,
+ ssl->sendbuffer,
+ (size_t) ssl->bytes_sent);
+ }
+ while ((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED));
+ do {
+ rc = (int) gnutls_record_recv(ssl->gnutls_state,
+ buffer,
+ (size_t) length);
+ }
+ while ((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED));
}
}
@@ -500,7 +513,10 @@ int SSL_write(SSL * ssl, const void *buffer, int length)
{
int rc;
- rc = (int) gnutls_record_send(ssl->gnutls_state, buffer, (size_t) length);
+ do {
+ rc = (int) gnutls_record_send(ssl->gnutls_state, buffer, (size_t) length);
+ }
+ while ((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED));
ssl->last_error = rc;
if (rc < 0) {