From 8071d074c14a54562d9b06797bb6ca16ab23898a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Tue, 2 Nov 2021 12:18:57 -0600 Subject: stun: Use a specific variable to enable Win32 crypto This should make it possible to use OpenSSL or GnuTLS also on Windows if required. --- stun/rand.c | 2 +- stun/stunhmac.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stun/rand.c b/stun/rand.c index 43d9149..59f307a 100644 --- a/stun/rand.c +++ b/stun/rand.c @@ -39,7 +39,7 @@ #include "rand.h" -#if defined(_WIN32) +#if defined(USE_WIN32_CRYPTO) #include diff --git a/stun/stunhmac.c b/stun/stunhmac.c index b42fc2e..d929340 100644 --- a/stun/stunhmac.c +++ b/stun/stunhmac.c @@ -48,7 +48,7 @@ #include #include -#if defined(_WIN32) +#if defined(USE_WIN32_CRYPTO) #include typedef struct _StunKeyBlob { BLOBHEADER header; @@ -71,7 +71,7 @@ void stun_sha1 (const uint8_t *msg, size_t len, size_t msg_len, uint8_t *sha, assert (len >= 44u); -#if defined(_WIN32) +#if defined(USE_WIN32_CRYPTO) { HCRYPTPROV prov; size_t blob_size; @@ -238,7 +238,7 @@ void stun_hash_creds (const uint8_t *realm, size_t realm_len, const uint8_t *realm_trimmed = priv_trim_var (realm, &realm_len); const uint8_t *colon = (uint8_t *)":"; -#if defined(_WIN32) +#if defined(USE_WIN32_CRYPTO) HCRYPTPROV prov; HCRYPTHASH hash; DWORD md5_digest_len; -- cgit v1.2.1