From 37de718e65b101d5a66012eb6d023b8eb6f164c5 Mon Sep 17 00:00:00 2001 From: Stephan Eicher Date: Wed, 22 Nov 2023 14:36:10 +0000 Subject: [PATCH] Fix #1389 - pw_hash with bcrypt not working on puppet master --- lib/puppet/parser/functions/pw_hash.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/parser/functions/pw_hash.rb b/lib/puppet/parser/functions/pw_hash.rb index 6196e14ac..7bd8fd62a 100644 --- a/lib/puppet/parser/functions/pw_hash.rb +++ b/lib/puppet/parser/functions/pw_hash.rb @@ -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.'