summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2021-08-17 02:17:21 -0400
committerJay Satiro <raysatiro@yahoo.com>2021-08-21 03:05:33 -0400
commit7d76be33d44a11337c06d703430dd50b3125d2d9 (patch)
treea83938ce546374afb6c6efd2b7820a1132dab18b
parentc78762d48a14ef3c9cf2439534768ce8ea7750f7 (diff)
downloadcurl-7d76be33d44a11337c06d703430dd50b3125d2d9.tar.gz
schannel: Work around typo in classic mingw macro
- Define ALG_CLASS_DHASH (the typo from the include) to ALG_CLASS_HASH. Prior to this change there was an incomplete fix to ignore the CALG_TLS1PRF macro on those versions of MinGW where it uses the ALG_CLASS_DHASH typoed macro. Ref: 48cf45c Ref: https://osdn.net/projects/mingw/ticket/38391 Ref: https://github.com/curl/curl/issues/2924 Closes https://github.com/curl/curl/pull/7580
-rw-r--r--lib/vtls/schannel.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
index 1bdec7644..722a937c4 100644
--- a/lib/vtls/schannel.c
+++ b/lib/vtls/schannel.c
@@ -141,6 +141,12 @@
# define CALG_SHA_256 0x0000800c
#endif
+/* Work around typo in classic MinGW's w32api up to version 5.0,
+ see https://osdn.net/projects/mingw/ticket/38391 */
+#if !defined(ALG_CLASS_DHASH) && defined(ALG_CLASS_HASH)
+#define ALG_CLASS_DHASH ALG_CLASS_HASH
+#endif
+
#define BACKEND connssl->backend
static Curl_recv schannel_recv;
@@ -279,13 +285,7 @@ get_alg_id_by_name(char *name)
#ifdef CALG_HMAC
CIPHEROPTION(CALG_HMAC);
#endif
-#if !defined(__W32API_MAJOR_VERSION) || \
- !defined(__W32API_MINOR_VERSION) || \
- defined(__MINGW64_VERSION_MAJOR) || \
- (__W32API_MAJOR_VERSION > 5) || \
- ((__W32API_MAJOR_VERSION == 5) && (__W32API_MINOR_VERSION > 0))
- /* CALG_TLS1PRF has a syntax error in MinGW's w32api up to version 5.0,
- see https://osdn.net/projects/mingw/ticket/38391 */
+#ifdef CALG_TLS1PRF
CIPHEROPTION(CALG_TLS1PRF);
#endif
#ifdef CALG_HASH_REPLACE_OWF