From a278b11a27039f6c1918a0e8336c212b1b714060 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Thu, 20 Sep 2001 18:44:14 +0000
Subject: [PATCH] - added a password hash

---
 modules/user.module      | 8 +++++++-
 modules/user/user.module | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/modules/user.module b/modules/user.module
index 18ff15b82266..2e7cefb4fa24 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -362,7 +362,13 @@ function jabber_auth($username, $password, $server, $port = 5222) {
       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);
 
diff --git a/modules/user/user.module b/modules/user/user.module
index 18ff15b82266..2e7cefb4fa24 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -362,7 +362,13 @@ function jabber_auth($username, $password, $server, $port = 5222) {
       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);
 
-- 
GitLab