Skip to content

Commit

Permalink
Fixes #35946 - windows pass-crypt modifies input
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bucher authored and ekohl committed Jan 17, 2023
1 parent 80c89d7 commit 22a9408
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/password_crypt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.passw_crypt(passwd, hash_alg = 'SHA256')
when 'Base64'
result = Base64.strict_encode64(passwd)
when 'Base64-Windows'
result = Base64.strict_encode64(passwd.concat("AdministratorPassword").encode('utf-16le'))
result = Base64.strict_encode64("#{passwd}AdministratorPassword".encode('utf-16le'))
else
result = passwd.crypt("#{ALGORITHMS[hash_alg]}#{generate_linux_salt}")
end
Expand Down

0 comments on commit 22a9408

Please sign in to comment.