Commit a278b11a authored by Dries's avatar Dries
Browse files

- added a password hash

parent dfa44f2f
...@@ -362,7 +362,13 @@ function jabber_auth($username, $password, $server, $port = 5222) { ...@@ -362,7 +362,13 @@ function jabber_auth($username, $password, $server, $port = 5222) {
return 0; return 0;
} }
jabber_send($session, "<iq type='set' id='". $jabber["jid"] ."'><query xmlns='jabber:iq:auth'><username>$username</username><password>$password</password><resource>drupal</resource></query></iq>"); /*
** Hash the password:
*/
$digest = mhash(MHASH_SHA1, $password);
jabber_send($session, "<iq type='set' id='". $jabber["jid"] ."'><query xmlns='jabber:iq:auth'><username>$username</username><digest>$digest</digest><resource>drupal</resource></query></iq>");
$data = jabber_recv($session); $data = jabber_recv($session);
......
...@@ -362,7 +362,13 @@ function jabber_auth($username, $password, $server, $port = 5222) { ...@@ -362,7 +362,13 @@ function jabber_auth($username, $password, $server, $port = 5222) {
return 0; return 0;
} }
jabber_send($session, "<iq type='set' id='". $jabber["jid"] ."'><query xmlns='jabber:iq:auth'><username>$username</username><password>$password</password><resource>drupal</resource></query></iq>"); /*
** Hash the password:
*/
$digest = mhash(MHASH_SHA1, $password);
jabber_send($session, "<iq type='set' id='". $jabber["jid"] ."'><query xmlns='jabber:iq:auth'><username>$username</username><digest>$digest</digest><resource>drupal</resource></query></iq>");
$data = jabber_recv($session); $data = jabber_recv($session);
......
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