1 From 3c950e27a8d20603f100bf21d402f74355a495c1 Mon Sep 17 00:00:00 2001
2 From: Steve Lhomme <robux4@ycbcr.xyz>
3 Date: Mon, 8 Jun 2020 16:07:59 +0200
4 Subject: [PATCH] explicit_bzero: Do not call SecureZeroMemory on UWP builds
7 https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/aa366877(v=vs.85)
9 It's considered a legacy API and is implemented as an always inline function.
11 There is no good replacement API that is available in UWP.
13 Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
15 gnutls/gl/explicit_bzero.c | 5 ++++-
16 1 file changed, 4 insertions(+), 1 deletion(-)
18 diff --git gnutls/gl/explicit_bzero.c gnutls/gl/explicit_bzero.c
19 index b1df418e5..3b8cc4ea4 100644
20 --- gnutls/gl/explicit_bzero.c
21 +++ gnutls/gl/explicit_bzero.c
23 #if defined _WIN32 && !defined __CYGWIN__
24 # define WIN32_LEAN_AND_MEAN
26 +# if !defined WINAPI_FAMILY || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
27 +# define USE_SECURE_ZERO_MEMORY
34 explicit_bzero (void *s, size_t len)
36 -#if defined _WIN32 && !defined __CYGWIN__
37 +#if defined USE_SECURE_ZERO_MEMORY
38 (void) SecureZeroMemory (s, len);
39 #elif HAVE_EXPLICIT_MEMSET
40 explicit_memset (s, '\0', len);