X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d6af4450d1ea3599cdce6921138155f73e154816..2312dd902e96786649ad9289c425a22ec73fbd80:/lib/password_hash.rb diff --git a/lib/password_hash.rb b/lib/password_hash.rb index 9f77fdc0d..afea82c11 100644 --- a/lib/password_hash.rb +++ b/lib/password_hash.rb @@ -18,7 +18,7 @@ module PasswordHash def self.check(hash, salt, candidate) if salt.nil? candidate = Digest::MD5.hexdigest(candidate) - elsif salt.match?(/!/) + elsif salt.include?("!") algorithm, iterations, salt = salt.split("!") size = Base64.strict_decode64(hash).length candidate = self.hash(candidate, salt, iterations.to_i, size, algorithm) @@ -32,7 +32,7 @@ module PasswordHash def self.upgrade?(hash, salt) if salt.nil? return true - elsif salt.match?(/!/) + elsif salt.include?("!") algorithm, iterations, salt = salt.split("!") return true if Base64.strict_decode64(salt).length != SALT_BYTE_SIZE return true if Base64.strict_decode64(hash).length != HASH_BYTE_SIZE