diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-10-04 15:10:22 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-10-04 15:42:49 +0200 |
commit | f719067a917538a5811927ec9dd5c760782492f8 (patch) | |
tree | 8fd7be4e2d9cc70e12967e0f9116ae84d020dbb0 /lib | |
parent | 1fb4cee4c60bdefd8c0e95d518f541a760fed70d (diff) | |
download | gnutls-f719067a917538a5811927ec9dd5c760782492f8.tar.gz |
Fix build of system/keys-win.c with older mingw
Patch by Eli Zaretskii <eliz@gnu>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system/keys-win.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/system/keys-win.c b/lib/system/keys-win.c index 0df8540aa5..eac511b975 100644 --- a/lib/system/keys-win.c +++ b/lib/system/keys-win.c @@ -46,7 +46,34 @@ #define DYN_NCRYPT -#include <ncrypt.h> +#ifdef __MINGW32__ +# include <_mingw.h> +# ifdef __MINGW64_VERSION_MAJOR +/* MinGW64 */ +# include <ncrypt.h> +# else +/* mingw.org's MinGW */ +# include <security.h> +# define BCRYPT_PAD_PKCS1 0x00000002 +# define BCRYPT_RSA_ALGORITHM L"RSA" +# define BCRYPT_DSA_ALGORITHM L"DSA" +# define BCRYPT_SHA1_ALGORITHM L"SHA1" +# define BCRYPT_SHA256_ALGORITHM L"SHA256" +# define BCRYPT_SHA384_ALGORITHM L"SHA384" +# define BCRYPT_SHA512_ALGORITHM L"SHA512" +# define BCRYPT_ECDSA_P256_ALGORITHM L"ECDSA_P256" +# define BCRYPT_ECDSA_P384_ALGORITHM L"ECDSA_P384" +# define BCRYPT_ECDSA_P521_ALGORITHM L"ECDSA_P521" +typedef ULONG_PTR NCRYPT_HANDLE; +typedef ULONG_PTR NCRYPT_PROV_HANDLE; +typedef ULONG_PTR NCRYPT_KEY_HANDLE; +typedef struct _BCRYPT_PKCS1_PADDING_INFO { + LPCWSTR pszAlgId; +} BCRYPT_PKCS1_PADDING_INFO; +# endif +#else /* non-mingw */ +# include <ncrypt.h> +#endif // MinGW headers may not have these defines #ifndef NCRYPT_SHA1_ALGORITHM |