Commit 43049e78 authored by Youness Alaoui's avatar Youness Alaoui

small change to allow an empty username even if it's not valid to have a...

small change to allow an empty username even if it's not valid to have a message integrity without username
parent eb32c8bb
...@@ -163,10 +163,10 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg, ...@@ -163,10 +163,10 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg,
} }
if ((agent->usage_flags & STUN_AGENT_USAGE_IGNORE_CREDENTIALS) == 0 && if ((agent->usage_flags & STUN_AGENT_USAGE_IGNORE_CREDENTIALS) == 0 &&
stun_message_has_attribute (msg, STUN_ATTRIBUTE_USERNAME)) { stun_message_has_attribute (msg, STUN_ATTRIBUTE_MESSAGE_INTEGRITY)) {
username_len = 0;
username = (uint8_t *) stun_message_find (msg, STUN_ATTRIBUTE_USERNAME, username = (uint8_t *) stun_message_find (msg, STUN_ATTRIBUTE_USERNAME,
&username_len); &username_len);
if (username) {
if (key == NULL) { if (key == NULL) {
if (validater == NULL || if (validater == NULL ||
validater (agent, msg, username, username_len, validater (agent, msg, username, username_len,
...@@ -175,7 +175,6 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg, ...@@ -175,7 +175,6 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg,
} }
} }
} }
}
if (key != NULL && key_len > 0) { if (key != NULL && key_len > 0) {
hash = (uint8_t *) stun_message_find (msg, hash = (uint8_t *) stun_message_find (msg,
......
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