mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
- 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
This commit is contained in:
parent
9313494e68
commit
2c7f177b1d
3 changed files with 8 additions and 12 deletions
|
@ -185,12 +185,12 @@ class jabber
|
||||||
// was a result returned?
|
// was a result returned?
|
||||||
if ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id)
|
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
|
// auth_0k
|
||||||
return $this->_sendauth_ok($packet['iq']['#']['query'][0]['#']['token'][0]['#'], $packet['iq']['#']['query'][0]['#']['sequence'][0]['#']);
|
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
|
// digest
|
||||||
return $this->_sendauth_digest();
|
return $this->_sendauth_digest();
|
||||||
|
@ -577,18 +577,15 @@ class jabber
|
||||||
function _sendauth_ok($zerok_token, $zerok_sequence)
|
function _sendauth_ok($zerok_token, $zerok_sequence)
|
||||||
{
|
{
|
||||||
// initial hash of password
|
// initial hash of password
|
||||||
$zerok_hash = @mhash(MHASH_SHA1, $this->password);
|
$zerok_hash = sha1($this->password);
|
||||||
$zerok_hash = bin2hex($zerok_hash);
|
|
||||||
|
|
||||||
// sequence 0: hash of hashed-password and token
|
// sequence 0: hash of hashed-password and token
|
||||||
$zerok_hash = @mhash(MHASH_SHA1, $zerok_hash . $zerok_token);
|
$zerok_hash = sha1($zerok_hash . $zerok_token);
|
||||||
$zerok_hash = bin2hex($zerok_hash);
|
|
||||||
|
|
||||||
// repeat as often as needed
|
// repeat as often as needed
|
||||||
for ($a = 0; $a < $zerok_sequence; $a++)
|
for ($a = 0; $a < $zerok_sequence; $a++)
|
||||||
{
|
{
|
||||||
$zerok_hash = @mhash(MHASH_SHA1, $zerok_hash);
|
$zerok_hash = sha1($zerok_hash);
|
||||||
$zerok_hash = bin2hex($zerok_hash);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$payload = "<username>{$this->username}</username>
|
$payload = "<username>{$this->username}</username>
|
||||||
|
@ -605,7 +602,7 @@ class jabber
|
||||||
{
|
{
|
||||||
$payload = "<username>{$this->username}</username>
|
$payload = "<username>{$this->username}</username>
|
||||||
<resource>{$this->resource}</resource>
|
<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);
|
$packet = $this->send_iq(NULL, 'set', $this->auth_id, 'jabber:iq:auth', $payload);
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ $error = array();
|
||||||
|
|
||||||
// Other PHP modules we may find useful
|
// Other PHP modules we may find useful
|
||||||
//$php_dlls_other = array('zlib', 'mbstring', 'ftp');
|
//$php_dlls_other = array('zlib', 'mbstring', 'ftp');
|
||||||
$php_dlls_other = array('zlib', 'ftp', 'xml', 'mhash');
|
$php_dlls_other = array('zlib', 'ftp', 'xml');
|
||||||
|
|
||||||
// Supported DB layers including relevant details
|
// Supported DB layers including relevant details
|
||||||
$available_dbms = array(
|
$available_dbms = array(
|
||||||
|
|
|
@ -57,7 +57,6 @@ $lang = array_merge($lang, array(
|
||||||
'DLL_FIREBIRD' => 'Firebird 1.5+',
|
'DLL_FIREBIRD' => 'Firebird 1.5+',
|
||||||
'DLL_FTP' => 'Remote FTP support [ Installation ]',
|
'DLL_FTP' => 'Remote FTP support [ Installation ]',
|
||||||
'DLL_MBSTRING' => 'Multi-byte character support',
|
'DLL_MBSTRING' => 'Multi-byte character support',
|
||||||
'DLL_MHASH' => 'Mhash hashing support [ Jabber ]',
|
|
||||||
'DLL_MSSQL' => 'MSSQL Server 2000',
|
'DLL_MSSQL' => 'MSSQL Server 2000',
|
||||||
'DLL_MSSQL_ODBC' => 'MSSQL Server 2000 via ODBC',
|
'DLL_MSSQL_ODBC' => 'MSSQL Server 2000 via ODBC',
|
||||||
'DLL_MYSQL' => 'MySQL 3.23.x/4.x',
|
'DLL_MYSQL' => 'MySQL 3.23.x/4.x',
|
||||||
|
@ -67,7 +66,7 @@ $lang = array_merge($lang, array(
|
||||||
'DLL_POSTGRES' => 'PostgreSQL 7.x',
|
'DLL_POSTGRES' => 'PostgreSQL 7.x',
|
||||||
'DLL_SQLITE' => 'SQLite',
|
'DLL_SQLITE' => 'SQLite',
|
||||||
'DLL_XML' => 'XML support [ Jabber ]',
|
'DLL_XML' => 'XML support [ Jabber ]',
|
||||||
'DLL_ZLIB' => 'zlib Compression support [ Visual confirmation, gz, .tar.gz, .zip ]',
|
'DLL_ZLIB' => 'zlib Compression support [ gz, .tar.gz, .zip ]',
|
||||||
'DL_CONFIG' => 'Download config',
|
'DL_CONFIG' => 'Download config',
|
||||||
'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.0 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click "Done" to move to the next stage.',
|
'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.0 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click "Done" to move to the next stage.',
|
||||||
'DL_DOWNLOAD' => 'Download',
|
'DL_DOWNLOAD' => 'Download',
|
||||||
|
|
Loading…
Add table
Reference in a new issue