MediaWiki REL1_33
Pbkdf2PasswordTest.php
Go to the documentation of this file.
1<?php
2
10 public function setUp() {
11 parent::setUp();
12 // Can't be done with annotations due to
13 // https://github.com/sebastianbergmann/phpunit/issues/3459
14 if ( !function_exists( 'hash_pbkdf2' ) ) {
15 $this->markTestSkipped( 'function hash_pbkdf2 is required' );
16 }
17 }
18
19 protected function getTypeConfigs() {
20 return [ 'pbkdf2' => [
21 'class' => Pbkdf2Password::class,
22 'algo' => 'sha256',
23 'cost' => '10000',
24 'length' => '128',
25 ] ];
26 }
27
28 public static function providePasswordTests() {
29 return [
30 [ true, ":pbkdf2:sha1:1:20:c2FsdA==:DGDID5YfDnHzqbUkr2ASBi/gN6Y=", 'password' ],
31 [ true, ":pbkdf2:sha1:2:20:c2FsdA==:6mwBTcctb4zNHtkqzh1B8NjeiVc=", 'password' ],
32 [ true, ":pbkdf2:sha1:4096:20:c2FsdA==:SwB5AbdlSJq+rUnZJvch0GWkKcE=", 'password' ],
33 [ true, ":pbkdf2:sha1:4096:16:c2EAbHQ=:Vvpqp1VICZ3MN9fwNCXgww==", "pass\x00word" ],
34 ];
35 }
36}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
large Pbkdf2Password Password ParameterizedPassword
static providePasswordTests()
An array of tests in the form of (bool, string, string), where the first element is whether the secon...
getTypeConfigs()
Return an array of configs to be used for this class's password type.