Skip to content

Commit 5ca6b80

Browse files
feat: add explicit test for yescrypt
1 parent 271ba54 commit 5ca6b80

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/puppet/parser/functions/pw_hash.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@
8181
if RUBY_PLATFORM == 'java' && !['bcrypt', 'bcrypt-a', 'bcrypt-x', 'bcrypt-y', 'yescrypt'].include?(args[1].downcase)
8282
# puppetserver bundles Apache Commons Codec
8383
org.apache.commons.codec.digest.Crypt.crypt(password.to_java_bytes, salt)
84-
elsif (+'test').crypt('$1$1') == '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
84+
elsif args[1].downcase == 'yescrypt' && (+'test').crypt('$y$j9T$') == '$y$j9T$$6tN6tt5mmPHxQskcf5Oi7Sb.1nKYbi5cOZgTiMq7Qw4'
85+
password.crypt(salt)
86+
elsif args[1].downcase.start_with?('bcrypt') && (+'test').crypt('$1$1') == '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
8587
password.crypt(salt)
8688
else
8789
# JRuby < 1.7.17

0 commit comments

Comments
 (0)