mirror of
https://github.com/moparisthebest/discourse-migratepassword
synced 2024-11-21 08:25:08 -05:00
Support IPB algorithm
This commit is contained in:
parent
1e6bd8f9bc
commit
e6a1708881
@ -103,6 +103,7 @@ after_initialize do
|
||||
|
||||
def self.check_all(password, crypted_pass)
|
||||
AlternativePassword::check_vbulletin(password, crypted_pass) ||
|
||||
AlternativePassword::check_ipb(password, crypted_pass) ||
|
||||
AlternativePassword::check_md5(password, crypted_pass) ||
|
||||
AlternativePassword::check_wordpress(password, crypted_pass) ||
|
||||
AlternativePassword::check_bcrypt(password, crypted_pass) ||
|
||||
@ -126,6 +127,11 @@ after_initialize do
|
||||
crypted_pass == Digest::MD5.hexdigest(password)
|
||||
end
|
||||
|
||||
def self.check_ipb(password, crypted_pass)
|
||||
salt, hash = crypted_pass.split(':', 2)
|
||||
!salt.nil? && hash == Digest::MD5.hexdigest(Digest::MD5.hexdigest(salt) + Digest::MD5.hexdigest(password))
|
||||
end
|
||||
|
||||
def self.check_wordpress(password, crypted_pass)
|
||||
hasher = WordpressHash.new(8)
|
||||
hasher.check(password, crypted_pass)
|
||||
|
Loading…
Reference in New Issue
Block a user