-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7eb0a29
commit f8d79ac
Showing
2 changed files
with
102 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,94 @@ | ||
diff --git a/src/gnutls.c b/src/gnutls.c | ||
index 689c9e41..c069c114 100644 | ||
--- a/src/gnutls.c | ||
+++ b/src/gnutls.c | ||
@@ -802,7 +802,7 @@ set_prio_default (gnutls_session_t session) | ||
case secure_protocol_sslv2: | ||
case secure_protocol_sslv3: | ||
allowed_protocols[0] = GNUTLS_SSL3; | ||
- err = gnutls_protocol_set_priority (session, allowed_protocols); | ||
+ err = gnutls_priority_set_direct (session, allowed_protocols, NULL); | ||
break; | ||
|
||
case secure_protocol_tlsv1: | ||
@@ -812,7 +812,7 @@ set_prio_default (gnutls_session_t session) | ||
#if GNUTLS_VERSION_NUMBER >= 0x030603 | ||
allowed_protocols[3] = GNUTLS_TLS1_3; | ||
#endif | ||
- err = gnutls_protocol_set_priority (session, allowed_protocols); | ||
+ err = gnutls_priority_set_direct (session, allowed_protocols, NULL); | ||
break; | ||
|
||
case secure_protocol_tlsv1_1: | ||
@@ -821,7 +821,7 @@ set_prio_default (gnutls_session_t session) | ||
#if GNUTLS_VERSION_NUMBER >= 0x030603 | ||
allowed_protocols[2] = GNUTLS_TLS1_3; | ||
#endif | ||
- err = gnutls_protocol_set_priority (session, allowed_protocols); | ||
+ err = gnutls_priority_set_direct (session, allowed_protocols, NULL); | ||
break; | ||
|
||
case secure_protocol_tlsv1_2: | ||
@@ -829,13 +829,13 @@ set_prio_default (gnutls_session_t session) | ||
#if GNUTLS_VERSION_NUMBER >= 0x030603 | ||
allowed_protocols[1] = GNUTLS_TLS1_3; | ||
#endif | ||
- err = gnutls_protocol_set_priority (session, allowed_protocols); | ||
+ err = gnutls_priority_set_direct (session, allowed_protocols, NULL); | ||
break; | ||
|
||
case secure_protocol_tlsv1_3: | ||
#if GNUTLS_VERSION_NUMBER >= 0x030603 | ||
allowed_protocols[0] = GNUTLS_TLS1_3; | ||
- err = gnutls_protocol_set_priority (session, allowed_protocols); | ||
+ err = gnutls_priority_set_direct (session, allowed_protocols, NULL); | ||
break; | ||
#else | ||
logprintf (LOG_NOTQUIET, _("Your GnuTLS version is too old to support TLS 1.3\n")); | ||
diff --git a/src/init.c b/src/init.c | ||
index 69f91ad5..da74089b 100644 | ||
--- a/src/init.c | ||
+++ b/src/init.c | ||
@@ -40,7 +40,11 @@ as that of the covered work. */ | ||
#include <limits.h> | ||
/* not all systems provide PATH_MAX in limits.h */ | ||
#ifndef PATH_MAX | ||
+#ifndef _WIN32 | ||
# include <sys/param.h> | ||
+#else | ||
+# include <pathmax.h> | ||
+#endif | ||
# ifndef PATH_MAX | ||
# define PATH_MAX MAXPATHLEN | ||
# endif | ||
diff --git a/src/utils.c b/src/utils.c | ||
index 794d3a57..59d7de7b 100644 | ||
--- a/src/utils.c | ||
+++ b/src/utils.c | ||
@@ -36,6 +36,13 @@ as that of the covered work. */ | ||
#include <string.h> | ||
#include <time.h> | ||
#include <unistd.h> | ||
+#ifndef PATH_MAX | ||
+#ifndef _WIN32 | ||
+# include <sys/param.h> | ||
+#else | ||
+# include <pathmax.h> | ||
+#endif | ||
+#endif | ||
#ifdef HAVE_PROCESS_H | ||
# include <process.h> /* getpid() */ | ||
#endif | ||
diff --git a/src/gnutls.c b/src/gnutls.c | ||
index cfcdf671..4d648639 100644 | ||
--- a/src/gnutls.c | ||
+++ b/src/gnutls.c | ||
@@ -802,7 +802,7 @@ set_prio_default (gnutls_session_t session) | ||
case secure_protocol_sslv2: | ||
case secure_protocol_sslv3: | ||
allowed_protocols[0] = GNUTLS_SSL3; | ||
- err = gnutls_protocol_set_priority (session, allowed_protocols); | ||
+ err = gnutls_priority_set_direct (session, allowed_protocols, NULL); | ||
break; | ||
|
||
case secure_protocol_tlsv1: | ||
@@ -812,7 +812,7 @@ set_prio_default (gnutls_session_t session) | ||
#if GNUTLS_VERSION_NUMBER >= 0x030603 | ||
allowed_protocols[3] = GNUTLS_TLS1_3; | ||
#endif | ||
- err = gnutls_protocol_set_priority (session, allowed_protocols); | ||
+ err = gnutls_priority_set_direct (session, allowed_protocols, NULL); | ||
break; | ||
|
||
case secure_protocol_tlsv1_1: | ||
@@ -821,7 +821,7 @@ set_prio_default (gnutls_session_t session) | ||
#if GNUTLS_VERSION_NUMBER >= 0x030603 | ||
allowed_protocols[2] = GNUTLS_TLS1_3; | ||
#endif | ||
- err = gnutls_protocol_set_priority (session, allowed_protocols); | ||
+ err = gnutls_priority_set_direct (session, allowed_protocols, NULL); | ||
break; | ||
|
||
case secure_protocol_tlsv1_2: | ||
@@ -829,13 +829,13 @@ set_prio_default (gnutls_session_t session) | ||
#if GNUTLS_VERSION_NUMBER >= 0x030603 | ||
allowed_protocols[1] = GNUTLS_TLS1_3; | ||
#endif | ||
- err = gnutls_protocol_set_priority (session, allowed_protocols); | ||
+ err = gnutls_priority_set_direct (session, allowed_protocols, NULL); | ||
break; | ||
|
||
case secure_protocol_tlsv1_3: | ||
#if GNUTLS_VERSION_NUMBER >= 0x030603 | ||
allowed_protocols[0] = GNUTLS_TLS1_3; | ||
- err = gnutls_protocol_set_priority (session, allowed_protocols); | ||
+ err = gnutls_priority_set_direct (session, allowed_protocols, NULL); | ||
break; | ||
#else | ||
logprintf (LOG_NOTQUIET, _("Your GnuTLS version is too old to support TLS 1.3\n")); | ||
diff --git a/src/init.c b/src/init.c | ||
index 1c452836..a0d283db 100644 | ||
--- a/src/init.c | ||
+++ b/src/init.c | ||
@@ -40,7 +40,11 @@ as that of the covered work. */ | ||
#include <limits.h> | ||
/* not all systems provide PATH_MAX in limits.h */ | ||
#ifndef PATH_MAX | ||
+#ifndef _WIN32 | ||
# include <sys/param.h> | ||
+#else | ||
+# include <pathmax.h> | ||
+#endif | ||
# ifndef PATH_MAX | ||
# define PATH_MAX MAXPATHLEN | ||
# endif | ||
diff --git a/src/utils.c b/src/utils.c | ||
index 2511a25f..e5ea9064 100644 | ||
--- a/src/utils.c | ||
+++ b/src/utils.c | ||
@@ -36,6 +36,13 @@ as that of the covered work. */ | ||
#include <string.h> | ||
#include <time.h> | ||
#include <unistd.h> | ||
+#ifndef PATH_MAX | ||
+#ifndef _WIN32 | ||
+# include <sys/param.h> | ||
+#else | ||
+# include <pathmax.h> | ||
+#endif | ||
+#endif | ||
#ifdef HAVE_PROCESS_H | ||
# include <process.h> /* getpid() */ | ||
#endif | ||
diff --git a/src/wget.h b/src/wget.h | ||
index 47fcb6db..cc66e081 100644 | ||
--- a/src/wget.h | ||
+++ b/src/wget.h | ||
@@ -224,7 +224,7 @@ static inline unsigned char _unhex(unsigned char c) | ||
void *basevar_new = xrealloc (basevar, DR_newsize * sizeof (type)); \ | ||
assert(basevar_new); \ | ||
if (basevar_new != basevar) { \ | ||
- memset (basevar_new + sizevar_old * sizeof (type), 0, (DR_newsize - sizevar_old) * sizeof (type)); \ | ||
+ memset (((char*)basevar_new) + sizevar_old * sizeof (type), 0, (DR_newsize - sizevar_old) * sizeof (type)); \ | ||
basevar = basevar_new; \ | ||
} \ | ||
} \ |