|
From: <s-v...@us...> - 2014-01-15 20:28:12
|
Revision: 243
http://sourceforge.net/p/turnserver/code/243
Author: s-vincent
Date: 2014-01-15 20:28:10 +0000 (Wed, 15 Jan 2014)
Log Message:
-----------
Initializes crypto seed for systems that do not have /dev/urandom (which is done transparently by OpenSSL). Initialize list elements due to change of list.h.
Modified Paths:
--------------
trunk/src/account.c
trunk/src/conf.c
trunk/src/turnserver.c
Modified: trunk/src/account.c
===================================================================
--- trunk/src/account.c 2013-12-21 20:36:38 UTC (rev 242)
+++ trunk/src/account.c 2014-01-15 20:28:10 UTC (rev 243)
@@ -72,6 +72,7 @@
ret->state = state;
ret->allocations = 0;
ret->is_tmp = 0;
+ list_head_init(&ret->list);
turn_calculate_authentication_key(username, realm, password, ret->key,
sizeof(ret->key));
Modified: trunk/src/conf.c
===================================================================
--- trunk/src/conf.c 2013-12-21 20:36:38 UTC (rev 242)
+++ trunk/src/conf.c 2014-01-15 20:28:10 UTC (rev 243)
@@ -186,6 +186,7 @@
memset(denied, 0x00, sizeof(struct denied_address));
denied->mask = mask;
denied->port = port;
+ list_head_init(&denied->list);
if(inet_pton(AF_INET, addr, denied->addr) != 1)
{
Modified: trunk/src/turnserver.c
===================================================================
--- trunk/src/turnserver.c 2013-12-21 20:36:38 UTC (rev 242)
+++ trunk/src/turnserver.c 2014-01-15 20:28:10 UTC (rev 243)
@@ -3484,8 +3484,8 @@
debug(DBG_ATTR, "Hash mismatch\n");
#ifndef NDEBUG
/* print computed hash and the one from the message */
- digest_print(hash, 20);
- digest_print(message.message_integrity->turn_attr_hmac, 20);
+ crypto_digest_print(hash, 20);
+ crypto_digest_print(message.message_integrity->turn_attr_hmac, 20);
#endif
turn_generate_nonce(nonce, sizeof(nonce), (unsigned char*)nonce_key,
strlen(nonce_key));
@@ -5018,6 +5018,12 @@
char* listen_addr = NULL;
struct sigaction sa;
+ /* initialize cryptographic seed for systems which do not have /dev/urandom */
+ if(crypto_seed_prng_init() == -1)
+ {
+ debug(DBG_ATTR, "Warning cryptographic seed not strong\n");
+ }
+
/* initialize lists */
list_head_init(&allocation_list);
list_head_init(&account_list);
@@ -5657,6 +5663,8 @@
/* free the configuration parser */
turnserver_cfg_free();
+ crypto_seed_prng_cleanup();
+
return EXIT_SUCCESS;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|