]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
schannel: Work around typo in classic mingw macro
authorJay Satiro <raysatiro@yahoo.com>
Tue, 17 Aug 2021 06:17:21 +0000 (02:17 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Sat, 21 Aug 2021 07:05:33 +0000 (03:05 -0400)
- 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

lib/vtls/schannel.c

index 1bdec7644634f3c2b3dba5f9a1d2554d5e577ee9..722a937c42a2542d62a85694f710d400f2dd5c75 100644 (file)
 #  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