MediaWiki REL1_33
MWOldPassword.php
Go to the documentation of this file.
1<?php
30 protected function getDefaultParams() {
31 return [];
32 }
33
34 protected function getDelimiter() {
35 return ':';
36 }
37
38 public function crypt( $plaintext ) {
39 if ( count( $this->args ) === 1 ) {
40 // Accept (but do not generate) salted passwords with :A: prefix.
41 // These are actually B-type passwords, but an error in a previous
42 // version of MediaWiki caused them to be written with an :A:
43 // prefix.
44 $this->hash = md5( $this->args[0] . '-' . md5( $plaintext ) );
45 } else {
46 $this->args = [];
47 $this->hash = md5( $plaintext );
48 }
49
50 if ( !is_string( $this->hash ) || strlen( $this->hash ) < 32 ) {
51 throw new PasswordError( 'Error when hashing password.' );
52 }
53 }
54}
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
The old style of MediaWiki password hashing.
getDelimiter()
Returns the delimiter for the parameters inside the hash.
crypt( $plaintext)
Hash a password and store the result in this object.
getDefaultParams()
Return an ordered array of default parameters for this password hash.
Helper class for password hash types that have a delimited set of parameters inside of the hash.
Show an error when any operation involving passwords fails to run.