Skip to content

Commit

Permalink
Merge pull request #1410 from TuningYourCode/main
Browse files Browse the repository at this point in the history
(#1389) - pw_hash with bcrypt not working on puppet master
  • Loading branch information
bastelfreak committed Mar 11, 2024
2 parents ed474d2 + 37de718 commit d6ae444
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet/parser/functions/pw_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

# handle weak implementations of String#crypt
# dup the string to get rid of frozen status for testing
if RUBY_PLATFORM == 'java'
if RUBY_PLATFORM == 'java' && !args[1].downcase.start_with?('bcrypt')
# puppetserver bundles Apache Commons Codec
org.apache.commons.codec.digest.Crypt.crypt(password.to_java_bytes, salt)
elsif (+'test').crypt('$1$1') == '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
Expand Down

0 comments on commit d6ae444

Please sign in to comment.