diff options
author | Youness Alaoui <youness.alaoui@collabora.co.uk> | 2009-03-30 16:50:05 -0400 |
---|---|---|
committer | Youness Alaoui <youness.alaoui@collabora.co.uk> | 2009-03-30 16:50:05 -0400 |
commit | 7d019fb9f514eb991ce96d4f9eead4ffd426e497 (patch) | |
tree | 301c40f7db62752b3772c2c5f2357e67ce714865 | |
parent | 9d070373e628b2d1e3ee510f7482f07dd92213fc (diff) | |
download | libnice-7d019fb9f514eb991ce96d4f9eead4ffd426e497.tar.gz |
Don't answer to MSN if you don't know from which remote the request came
-rw-r--r-- | agent/conncheck.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c index 2f83d98..09fad07 100644 --- a/agent/conncheck.c +++ b/agent/conncheck.c @@ -2636,20 +2636,20 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream, if (stun_message_get_class (&req) == STUN_REQUEST) { - if (agent->compatibility == NICE_COMPATIBILITY_MSN) { + if (agent->compatibility == NICE_COMPATIBILITY_MSN && + local_candidate && remote_candidate2) { username = (uint8_t *) stun_message_find (&req, STUN_ATTRIBUTE_USERNAME, &username_len); uname_len = priv_create_username (agent, stream, component->id, remote_candidate2, local_candidate, uname, sizeof (uname), FALSE); memcpy (username, uname, username_len); - if (remote_candidate2) { - req.key = g_base64_decode ((gchar *) remote_candidate2->password, - &req.key_len); - } else { - req.key = NULL; - req.key_len = 0; - } + req.key = g_base64_decode ((gchar *) remote_candidate2->password, + &req.key_len); + } else { + nice_debug ("Agent %p : received MSN incoming check from unknown remote candidate. " + "Ignoring request", agent); + return TRUE; } rbuf_len = sizeof (rbuf); |