summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCurieux Tres <trescurieux@yahoo.fr>2014-10-27 11:32:17 +0000
committerPhilip Withnall <philip.withnall@collabora.co.uk>2014-10-27 11:32:17 +0000
commit3bc28d43a5189e561087f9340467ef2bd314c7fb (patch)
treefe725cb5f10758ed311be40e8587765a99a2f9d0
parent705ad1df7bf2faac29db9cd49a3248f871d9e149 (diff)
stun: Rename a symbol to avoid a naming clash with OpenSSL
The symbol is not exported, but nevertheless leaks in the static version of libnice, due to limitations on symbol visibilities with static libraries. OpenSSL has a symbol named RAND_bytes(), which ours clashes with if the two are linked together statically. Avoid this by prefixing ours with ‘nice_’.
-rw-r--r--stun/rand.c4
-rw-r--r--stun/rand.h2
-rw-r--r--stun/stunhmac.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/stun/rand.c b/stun/rand.c
index 0de7f6e..fd08283 100644
--- a/stun/rand.c
+++ b/stun/rand.c
@@ -45,7 +45,7 @@
#include <windows.h>
#include <wincrypt.h>
-void RAND_bytes (uint8_t *dst, int len)
+void nice_RAND_bytes (uint8_t *dst, int len)
{
HCRYPTPROV hCryptProv;
LPCSTR container = "Libnice key container";
@@ -215,7 +215,7 @@ static unsigned long genrand_int32(void)
static int initialized = 0;
-void RAND_bytes (uint8_t *dst, int len)
+void nice_RAND_bytes (uint8_t *dst, int len)
{
int i;
diff --git a/stun/rand.h b/stun/rand.h
index 07c5fb5..0ed0263 100644
--- a/stun/rand.h
+++ b/stun/rand.h
@@ -45,6 +45,6 @@
#include <stdint.h>
#endif
-void RAND_bytes (uint8_t *dst, int len);
+void nice_RAND_bytes (uint8_t *dst, int len);
#endif /* RAND_H */
diff --git a/stun/stunhmac.c b/stun/stunhmac.c
index db6fb16..df5deb6 100644
--- a/stun/stunhmac.c
+++ b/stun/stunhmac.c
@@ -122,5 +122,5 @@ void stun_hash_creds (const uint8_t *realm, size_t realm_len,
void stun_make_transid (StunTransactionId id)
{
- RAND_bytes (id, 16);
+ nice_RAND_bytes (id, 16);
}