# HG changeset patch # User Matthew Wild # Date 1344600186 -3600 # Node ID 872dc69f6039f5d362a042345ba407fd65fad84b # Parent 1b59ba3e95084fe8c2de30a1bba0d8a2201fb3d5 Add Facebook fingerprints (and move test for FBv1 from the ejabberd fingerprint) diff -r 1b59ba3e9508 -r 872dc69f6039 servers/ejabberd.lua --- a/servers/ejabberd.lua Fri Aug 10 13:02:10 2012 +0100 +++ b/servers/ejabberd.lua Fri Aug 10 13:03:06 2012 +0100 @@ -1,14 +1,10 @@ function testers.ejabberd() if (test(q_invalid_xml, [=[ id=["']none['"]]=]) or test(q_invalid_xml, " id='%d+'")) - and (not test(q_invalid_xml, literal " xml:lang=")) then + and (not test(q_invalid_xml, literal " xml:lang=")) + and not test(q_invalid_xml, " id=(.)") == '"' then server_name = "ejabberd"; - -- Facebook curiosity - if test(q_invalid_xml, " id=(.)") == '"' then - server_comment "Appears to be Facebook's variant of ejabberd"; - end - local hostname = test(q_invalid_xml, [=[from=["']([^"']+)]=]); if not hostname then server_comment "The server did not return a hostname, odd."; diff -r 1b59ba3e9508 -r 872dc69f6039 servers/facebook.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/servers/facebook.lua Fri Aug 10 13:03:06 2012 +0100 @@ -0,0 +1,14 @@ +function testers.facebook() + if test(q_invalid_xml, false) and test(q_invalid_host, " id='1' ") + and test(q_invalid_host, literal"X-FACEBOOK-PLATFORM") then + + server_name = "Facebook"; + server_version = "2.0"; + + elseif (test(q_invalid_xml, [=[ id=["']none['"]]=]) or test(q_invalid_xml, " id='%d+'")) + and (not test(q_invalid_xml, literal " xml:lang=")) and test(q_invalid_xml, " id=(.)") == '"' then + server_name = "Facebook"; + server_version = "1.0"; + end +end + diff -r 1b59ba3e9508 -r 872dc69f6039 xmpp-fingerprint.lua --- a/xmpp-fingerprint.lua Fri Aug 10 13:02:10 2012 +0100 +++ b/xmpp-fingerprint.lua Fri Aug 10 13:03:06 2012 +0100 @@ -139,6 +139,7 @@ dofile "servers/openfire.lua" dofile "servers/jabber_xcp.lua" dofile "servers/soapbox.lua" +dofile "servers/facebook.lua" function test_fingerprint(server) local tester = testers[server];