mirror of
https://github.com/moparisthebest/discourse-migratepassword
synced 2024-11-21 08:25:08 -05:00
SMF actually concatenates the lowercase username and password...
This commit is contained in:
parent
d42a2a32fd
commit
55bec5e5ea
@ -42,13 +42,13 @@ after_initialize do
|
|||||||
|
|
||||||
def self.check_smf(password, user, hash)
|
def self.check_smf(password, user, hash)
|
||||||
sha1 = Digest::SHA1.new
|
sha1 = Digest::SHA1.new
|
||||||
sha1.update user + password
|
sha1.update user.downcase + password
|
||||||
hash == sha1.hexdigest
|
hash == sha1.hexdigest
|
||||||
end
|
end
|
||||||
|
|
||||||
#def self.check_smf_scrypt(password, user, hash)
|
#def self.check_smf_scrypt(password, user, hash)
|
||||||
# sha1 = Digest::SHA1.new
|
# sha1 = Digest::SHA1.new
|
||||||
# sha1.update user + password
|
# sha1.update user.downcase + password
|
||||||
# begin
|
# begin
|
||||||
# SCrypt::Password.new(hash) == sha1.hexdigest
|
# SCrypt::Password.new(hash) == sha1.hexdigest
|
||||||
# rescue
|
# rescue
|
||||||
|
Loading…
Reference in New Issue
Block a user