Fix authentication method detection for MD5 - warvox - Unnamed repository; edit… | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit c665d028582bf3581604fb143e691b732b551d78 | |
parent cc89c6fc198944c9312ce5febc95493986cf75e6 | |
Author: HD Moore <[email protected]> | |
Date: Mon, 2 Feb 2015 21:46:27 -0600 | |
Fix authentication method detection for MD5 | |
Diffstat: | |
M lib/warvox/proto/iax2/call.rb | 9 ++++++++- | |
1 file changed, 8 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/lib/warvox/proto/iax2/call.rb b/lib/warvox/proto/iax2/call.rb | |
@@ -72,7 +72,14 @@ class Call | |
end | |
chall = nil | |
- if res[2][14] == "\x00\x03" and res[2][IAX_IE_CHALLENGE_DATA] | |
+ | |
+ # Look for IAX_AUTH_MD5 (2) as an available auth method | |
+ if res[2][14].unpack("n")[0] & 2 <= 0 | |
+ dprint("REGAUTH: MD5 authentication is not enabled on the server") | |
+ return | |
+ end | |
+ | |
+ if res[2][IAX_IE_CHALLENGE_DATA] | |
self.dcall = res[0][0] | |
chall = res[2][IAX_IE_CHALLENGE_DATA] | |
end |