Commit fe458632 authored by Youness Alaoui's avatar Youness Alaoui

check the username in case the IGNORE_CREDENTIALS flag was set on the agent

parent e168451b
......@@ -156,6 +156,15 @@ stun_conncheck_reply (StunAgent *agent, StunMessage *req,
username = (const char *)stun_message_find (req,
STUN_ATTRIBUTE_USERNAME, &username_len);
/* Check again the username in case the agent has IGNORE_CREDENTIALS flag.
We only need to check the username and not care about the password */
if (ufrag_len != username_len ||
memcmp (local_ufrag, username, username_len) != 0) {
stun_debug (" Username check failed.\n");
err (STUN_ERROR_UNAUTHORIZED);
return EPERM;
}
/* Role conflict handling */
assert (control != NULL);
if (!stun_message_find64 (req, *control ? STUN_ATTRIBUTE_ICE_CONTROLLING
......
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