mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-05 19:35:48 +03:00
Don't call wincrypt on builds older than Windows XP
On runtime it will attempt to get CryptAcquireContext() from advapi32.dll but it's not there and the DLL/program containing mbedtls will not load. Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
This commit is contained in:
@@ -52,6 +52,7 @@
|
|||||||
#define _WIN32_WINNT 0x0400
|
#define _WIN32_WINNT 0x0400
|
||||||
#endif
|
#endif
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#if _WIN32_WINNT >= 0x0501 /* _WIN32_WINNT_WINXP */
|
||||||
#include <wincrypt.h>
|
#include <wincrypt.h>
|
||||||
|
|
||||||
int mbedtls_platform_entropy_poll(void *data, unsigned char *output, size_t len,
|
int mbedtls_platform_entropy_poll(void *data, unsigned char *output, size_t len,
|
||||||
@@ -76,6 +77,9 @@ int mbedtls_platform_entropy_poll(void *data, unsigned char *output, size_t len,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#else /* !_WIN32_WINNT_WINXP */
|
||||||
|
#error Entropy not available before Windows XP, use MBEDTLS_NO_PLATFORM_ENTROPY
|
||||||
|
#endif /* !_WIN32_WINNT_WINXP */
|
||||||
#else /* _WIN32 && !EFIX64 && !EFI32 */
|
#else /* _WIN32 && !EFIX64 && !EFI32 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user