diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2019-01-22 18:17:39 -0500 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2019-01-22 18:48:24 -0500 |
commit | 4f3638478864a10a6aa19ec82e7253d03245a0d3 (patch) | |
tree | 92e7716fb08182908ce17dac8e59a93fb73fb9a3 /stun | |
parent | df5b9e64c224f61a53133d4aec34069f88d45068 (diff) | |
download | libnice-4f3638478864a10a6aa19ec82e7253d03245a0d3.tar.gz |
stunagent: Replace more magic numbers with defines
Diffstat (limited to 'stun')
-rw-r--r-- | stun/stunagent.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/stun/stunagent.c b/stun/stunagent.c index 52890b5..f754322 100644 --- a/stun/stunagent.c +++ b/stun/stunagent.c @@ -220,7 +220,9 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg, (stun_message_get_class (msg) == STUN_ERROR && stun_message_find_error (msg, &error_code) == STUN_MESSAGE_RETURN_SUCCESS && - (error_code == 400 || error_code == 401 || error_code == 438)) || + (error_code == STUN_ERROR_BAD_REQUEST || + error_code == STUN_ERROR_UNAUTHORIZED || + error_code == STUN_ERROR_STALE_NONCE)) || (stun_message_get_class (msg) == STUN_INDICATION && (agent->usage_flags & STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS || agent->usage_flags & STUN_AGENT_USAGE_NO_INDICATION_AUTH)); @@ -327,7 +329,8 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg, } else if (!(stun_message_get_class (msg) == STUN_ERROR && stun_message_find_error (msg, &error_code) == STUN_MESSAGE_RETURN_SUCCESS && - (error_code == 400 || error_code == 401))) { + (error_code == STUN_ERROR_BAD_REQUEST || + error_code == STUN_ERROR_UNAUTHORIZED))) { stun_debug ("STUN auth error: No message integrity attribute!"); return STUN_VALIDATION_UNAUTHORIZED; } |