Adding SALT from DB and new Algorithm to be connected with HumHub
https://github.com/nextcloud/user_sql/pull/42
This commit is contained in:
56
tests/Crypto/SHA512WhirlpoolTest.php
Normal file
56
tests/Crypto/SHA512WhirlpoolTest.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Nextcloud - user_sql
|
||||
*
|
||||
* @copyright 2018 Marcin Łojewski <dev@mlojewski.me>
|
||||
* @author Marcin Łojewski <dev@mlojewski.me>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Tests\UserSQL\Crypto;
|
||||
|
||||
use OCA\UserSQL\Crypto\SHA512Whirlpool;
|
||||
use OCA\UserSQL\Crypto\IPasswordAlgorithm;
|
||||
use OCP\IL10N;
|
||||
use Test\TestCase;
|
||||
|
||||
/**
|
||||
* Unit tests for class <code>SHA512Whirlpool</code>.
|
||||
*
|
||||
* @author Marcin Łojewski <dev@mlojewski.me>
|
||||
*/
|
||||
class SHA512WhirlpoolTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var IPasswordAlgorithm
|
||||
*/
|
||||
private $crypto;
|
||||
|
||||
public function testCheckPassword()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->crypto->checkPassword(
|
||||
"password",
|
||||
"a96b16ebb691dbe968b0d66d0d924cff5cf5de5e0885181d00761d87f295b2bf3d3c66187c050fc01c196ff3acaa48d3561ffd170413346e934a32280d632f2e"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->crypto = new SHA512Whirlpool($this->createMock(IL10N::class));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user