mirror of
https://github.com/coturn/coturn.git
synced 2025-05-14 09:36:49 +08:00
inter-realm boundaries relaxed
This commit is contained in:
parent
8ed6f9bd67
commit
6bd1a8a449
@ -1652,8 +1652,6 @@ ioa_socket_handle detach_ioa_socket(ioa_socket_handle s)
|
||||
|
||||
ret->magic = SOCKET_MAGIC;
|
||||
|
||||
ret->realm_hash = s->realm_hash;
|
||||
|
||||
SSL* ssl = s->ssl;
|
||||
set_socket_ssl(s,NULL);
|
||||
set_socket_ssl(ret,ssl);
|
||||
@ -3417,38 +3415,6 @@ void set_ioa_socket_tobeclosed(ioa_socket_handle s)
|
||||
s->tobeclosed = 1;
|
||||
}
|
||||
|
||||
static u32bits string_hash(const u08bits *str) {
|
||||
|
||||
u32bits hash = 0;
|
||||
int c = 0;
|
||||
|
||||
while ((c = *str++))
|
||||
hash = c + (hash << 6) + (hash << 16) - hash;
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
int check_realm_hash(ioa_socket_handle s, u08bits *realm)
|
||||
{
|
||||
if(s) {
|
||||
if(realm && realm[0]) {
|
||||
if(s->realm_hash != string_hash(realm)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void set_realm_hash(ioa_socket_handle s, u08bits *realm)
|
||||
{
|
||||
if(s) {
|
||||
if(realm && realm[0]) {
|
||||
s->realm_hash = string_hash(realm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Network buffer functions
|
||||
*/
|
||||
|
@ -221,8 +221,6 @@ struct _ioa_socket
|
||||
struct bufferevent *conn_bev;
|
||||
connect_cb conn_cb;
|
||||
void *conn_arg;
|
||||
//Transferable sockets user data
|
||||
u32bits realm_hash;
|
||||
//Accept:
|
||||
struct evconnlistener *list_ev;
|
||||
accept_cb acb;
|
||||
|
@ -260,8 +260,6 @@ void set_do_not_use_df(ioa_socket_handle s);
|
||||
int ioa_socket_tobeclosed(ioa_socket_handle s);
|
||||
void set_ioa_socket_tobeclosed(ioa_socket_handle s);
|
||||
void close_ioa_socket_after_processing_if_necessary(ioa_socket_handle s);
|
||||
int check_realm_hash(ioa_socket_handle s, u08bits *realm);
|
||||
void set_realm_hash(ioa_socket_handle s, u08bits *realm);
|
||||
|
||||
////////////////// Base64 /////////////////////////////
|
||||
|
||||
|
@ -3373,7 +3373,6 @@ static int check_stun_auth(turn_turnserver *server,
|
||||
}
|
||||
} else {
|
||||
STRCPY(ss->username,usname);
|
||||
set_realm_hash(ss->client_socket,(u08bits*)ss->realm_options.name);
|
||||
}
|
||||
|
||||
{
|
||||
@ -4324,11 +4323,8 @@ static int create_relay_connection(turn_turnserver* server,
|
||||
return -1;
|
||||
}
|
||||
|
||||
set_realm_hash(newelem->s,(u08bits*)ss->realm_options.name);
|
||||
|
||||
if (rtcp_s) {
|
||||
if (out_reservation_token && *out_reservation_token) {
|
||||
set_realm_hash(rtcp_s,(u08bits*)ss->realm_options.name);
|
||||
/* OK */
|
||||
} else {
|
||||
IOA_CLOSE_SOCKET(newelem->s);
|
||||
|
Loading…
x
Reference in New Issue
Block a user