summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSteve Lhomme <robux4@ycbcr.xyz>2020-04-29 10:32:08 +0200
committerSteve Lhomme <robux4@ycbcr.xyz>2020-05-28 07:44:47 +0200
commit2a94a7b12d3bfb8384e1ca4d55eea28ccc5b2fe5 (patch)
tree9a48bf952ffd17b89e7d2cbbcc991b8a0c481de2 /configure.ac
parent2f28cf6e7304a0f8b3c08823846752a2b55aabcf (diff)
downloadgnutls-2a94a7b12d3bfb8384e1ca4d55eea28ccc5b2fe5.tar.gz
win32: use bcrypt instead of CryptoAPI on Vista+ for random numbers
CryptoAPI is a deprecated API [1] that is forbidden in UWP builds. Rewrite the CryptoAPI calls in bcrypt. bcrypt is used instead of CryptoAPI when targeting Windows Vista and above. https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptdecrypt Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 7 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9ea53b7344..cda77c177e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -596,6 +596,13 @@ fi
AM_CONDITIONAL(HAVE_LIBIDN2, test "$with_libidn2" != "no")
+if test "x$have_vista_dynamic" = "xno"; then
+ AC_CHECK_TYPES([BCRYPT_ALG_HANDLE],[LIBBCRYPT="-lbcrypt"],[],[#include <windows.h>
+ #include <bcrypt.h>])
+fi
+AM_CONDITIONAL(HAVE_BCRYPT, test "$ac_cv_type_BCRYPT_ALG_HANDLE" = "yes")
+AC_SUBST([LIBBCRYPT])
+
AC_ARG_ENABLE(non-suiteb-curves,
AS_HELP_STRING([--disable-non-suiteb-curves], [disable curves not in SuiteB]),
enable_non_suiteb=$enableval, enable_non_suiteb=yes)