diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-11-02 12:18:57 -0600 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-11-02 12:42:01 -0600 |
commit | 8071d074c14a54562d9b06797bb6ca16ab23898a (patch) | |
tree | bcc46981caedd98216de12ff76d42508825a8b00 | |
parent | 87bfb30280d738db6270646c76de47e973ffa890 (diff) | |
download | libnice-8071d074c14a54562d9b06797bb6ca16ab23898a.tar.gz |
stun: Use a specific variable to enable Win32 crypto
This should make it possible to use OpenSSL or GnuTLS also on Windows if
required.
-rw-r--r-- | stun/rand.c | 2 | ||||
-rw-r--r-- | 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 <windows.h> 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 <string.h> #include <assert.h> -#if defined(_WIN32) +#if defined(USE_WIN32_CRYPTO) #include <malloc.h> 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; |