代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gnutls 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 93a6a9a753c541e04875648cf5671e422e4621df Mon Sep 17 00:00:00 2001
From: lvying <lvying6@huawei.com>
Date: Sat, 8 Jun 2019 22:36:10 -0400
Subject: [PATCH] fix ipv6 handshake failed
reason: fix ipv6 handshake failed
Signed-off-by: lvying <lvying6@huawei.com>
---
lib/ext/server_name.c | 4 +++-
lib/str.h | 10 ++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/lib/ext/server_name.c b/lib/ext/server_name.c
index 259dc99..f61c1f2 100644
--- a/lib/ext/server_name.c
+++ b/lib/ext/server_name.c
@@ -105,7 +105,9 @@ _gnutls_server_name_recv_params(gnutls_session_t session,
DECR_LEN(data_size, len);
if (type == 0) { /* NAME_DNS */
- if (!_gnutls_dnsname_is_valid((char*)p, len)) {
+ _gnutls_debug_log("HSK[%p]: recieve server name: '%.*s'\n", session, len, p);
+ /* fix ipv6 format server name invaild problem */
+ if (!_gnutls_dnsname_is_valid((char*)p, len) && !_gnutls_ipv6_is_valid((char*)p, len)) {
_gnutls_handshake_log
("HSK[%p]: Server name is not acceptable: '%.*s'\n",
session, (int) len, p);
diff --git a/lib/str.h b/lib/str.h
index 9f0e7d6..e0bca4b 100644
--- a/lib/str.h
+++ b/lib/str.h
@@ -60,6 +60,16 @@ inline static unsigned _gnutls_str_is_print(const char *str, unsigned size)
return 1;
}
+inline static unsigned _gnutls_ipv6_is_valid(const char *str, unsigned size)
+{
+ unsigned i;
+ for (i=0;i<size;i++) {
+ if (!(c_isalnum(str[i]) || str[i] == ':' || str[i] == '%' || str[i] == '.'))
+ return 0;
+ }
+ return 1;
+}
+
inline static unsigned _gnutls_dnsname_is_valid(const char *str, unsigned size)
{
unsigned i;
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。