Commit 8071d074 authored by Olivier Crête's avatar Olivier Crête

stun: Use a specific variable to enable Win32 crypto

This should make it possible to use OpenSSL or GnuTLS also on Windows if
required.
parent 87bfb302
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "rand.h" #include "rand.h"
#if defined(_WIN32) #if defined(USE_WIN32_CRYPTO)
#include <windows.h> #include <windows.h>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#if defined(_WIN32) #if defined(USE_WIN32_CRYPTO)
#include <malloc.h> #include <malloc.h>
typedef struct _StunKeyBlob { typedef struct _StunKeyBlob {
BLOBHEADER header; BLOBHEADER header;
...@@ -71,7 +71,7 @@ void stun_sha1 (const uint8_t *msg, size_t len, size_t msg_len, uint8_t *sha, ...@@ -71,7 +71,7 @@ void stun_sha1 (const uint8_t *msg, size_t len, size_t msg_len, uint8_t *sha,
assert (len >= 44u); assert (len >= 44u);
#if defined(_WIN32) #if defined(USE_WIN32_CRYPTO)
{ {
HCRYPTPROV prov; HCRYPTPROV prov;
size_t blob_size; size_t blob_size;
...@@ -238,7 +238,7 @@ void stun_hash_creds (const uint8_t *realm, size_t realm_len, ...@@ -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 *realm_trimmed = priv_trim_var (realm, &realm_len);
const uint8_t *colon = (uint8_t *)":"; const uint8_t *colon = (uint8_t *)":";
#if defined(_WIN32) #if defined(USE_WIN32_CRYPTO)
HCRYPTPROV prov; HCRYPTPROV prov;
HCRYPTHASH hash; HCRYPTHASH hash;
DWORD md5_digest_len; DWORD md5_digest_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment