aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_jabber.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-03-02 01:09:55 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-03-02 01:09:55 +0000
commit2c7f177b1d8dd8e568adb3e09f2de2157f035dca (patch)
tree8866dc9fb6ac128dc5e380e461ee87287f1bdecc /phpBB/includes/functions_jabber.php
parent9313494e6864eba1067329b11d881a6f39875c9b (diff)
downloadforums-2c7f177b1d8dd8e568adb3e09f2de2157f035dca.tar
forums-2c7f177b1d8dd8e568adb3e09f2de2157f035dca.tar.gz
forums-2c7f177b1d8dd8e568adb3e09f2de2157f035dca.tar.bz2
forums-2c7f177b1d8dd8e568adb3e09f2de2157f035dca.tar.xz
forums-2c7f177b1d8dd8e568adb3e09f2de2157f035dca.zip
- The sha1 hash is a standard part of PHP, mhash is not needed for Jabber :D
git-svn-id: file:///svn/phpbb/trunk@5597 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_jabber.php')
-rw-r--r--phpBB/includes/functions_jabber.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php
index 3d74069946..00d7a6c5ab 100644
--- a/phpBB/includes/functions_jabber.php
+++ b/phpBB/includes/functions_jabber.php
@@ -185,12 +185,12 @@ class jabber
// was a result returned?
if ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id)
{
- if (@function_exists('mhash') && isset($packet['iq']['#']['query'][0]['#']['sequence'][0]['#']) && isset($packet['iq']['#']['query'][0]['#']['token'][0]['#']))
+ if (isset($packet['iq']['#']['query'][0]['#']['sequence'][0]['#']) && isset($packet['iq']['#']['query'][0]['#']['token'][0]['#']))
{
// auth_0k
return $this->_sendauth_ok($packet['iq']['#']['query'][0]['#']['token'][0]['#'], $packet['iq']['#']['query'][0]['#']['sequence'][0]['#']);
}
- else if (@function_exists('mhash') && isset($packet['iq']['#']['query'][0]['#']['digest']))
+ else if (isset($packet['iq']['#']['query'][0]['#']['digest']))
{
// digest
return $this->_sendauth_digest();
@@ -577,18 +577,15 @@ class jabber
function _sendauth_ok($zerok_token, $zerok_sequence)
{
// initial hash of password
- $zerok_hash = @mhash(MHASH_SHA1, $this->password);
- $zerok_hash = bin2hex($zerok_hash);
+ $zerok_hash = sha1($this->password);
// sequence 0: hash of hashed-password and token
- $zerok_hash = @mhash(MHASH_SHA1, $zerok_hash . $zerok_token);
- $zerok_hash = bin2hex($zerok_hash);
+ $zerok_hash = sha1($zerok_hash . $zerok_token);
// repeat as often as needed
for ($a = 0; $a < $zerok_sequence; $a++)
{
- $zerok_hash = @mhash(MHASH_SHA1, $zerok_hash);
- $zerok_hash = bin2hex($zerok_hash);
+ $zerok_hash = sha1($zerok_hash);
}
$payload = "<username>{$this->username}</username>
@@ -605,7 +602,7 @@ class jabber
{
$payload = "<username>{$this->username}</username>
<resource>{$this->resource}</resource>
- <digest>" . bin2hex(mhash(MHASH_SHA1, $this->stream_id . $this->password)) . "</digest>";
+ <digest>" . sha1($this->stream_id . $this->password) . "</digest>";
$packet = $this->send_iq(NULL, 'set', $this->auth_id, 'jabber:iq:auth', $payload);