Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schannel: Work around typo in macro from classic MinGW include #7580

Closed
wants to merge 1 commit into from

Conversation

jay
Copy link
Member

@jay jay commented Aug 17, 2021

  • Define ALG_CLASS_DHASH (the typo from the include) to ALG_CLASS_HASH.

Prior to this change the build error was noted but it was expected the
user would update to the latest classic MinGW headers to fix it.

Ref: https://osdn.net/projects/mingw/ticket/38391
Ref: #2924

Closes #xxxx


/cc @MarcelRaad

@jay jay added the build label Aug 17, 2021
lib/vtls/schannel.c Outdated Show resolved Hide resolved
@jay jay force-pushed the fix_classic_mingw_build_error branch from 5940b7e to 1aece8b Compare August 17, 2021 07:39
@@ -284,8 +290,6 @@ get_alg_id_by_name(char *name)
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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand. What was the build error? The preprocessor condition here was meant to avoid build errors. Or was the problem the lack of this CIPHEROPTION? Then this preprocessor condition should be deleted.

Copy link
Member Author

@jay jay Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same build error as described in the bug. The current fix in schannel does not work here because __W32API_MAJOR_VERSION is undefined. It is defined in w32api.h but that is not included by any other mingw include. I could get it working with:

#ifdef __MINGW32__
#include <w32api.h>
#endif

However rather than do that to fix the version check the latest iteration of my patch removes it and compensates for the typo instead.

- 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: curl#2924

Closes #xxxx
@jay jay force-pushed the fix_classic_mingw_build_error branch from 1aece8b to daf41dd Compare August 17, 2021 20:23
@jay jay closed this in 7d76be3 Aug 21, 2021
@jay jay deleted the fix_classic_mingw_build_error branch August 21, 2021 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants