summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <jmccrae@chf.io>2022-05-26 15:42:45 +0600
committerJohn McCrae <jmccrae@chf.io>2022-05-26 15:42:45 +0600
commitc7568843610daae0128b3bd50e9e1095724fc271 (patch)
treecd00f3b32106542ce5755a010f8e1f1baccf6a7d
parent59168b16a85df0921852795bd61b28fd10185dad (diff)
downloadchef-c7568843610daae0128b3bd50e9e1095724fc271.tar.gz
refactored authenticator.rb to make the password length consistent
Signed-off-by: John McCrae <jmccrae@chf.io>
-rw-r--r--lib/chef/http/authenticator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/http/authenticator.rb b/lib/chef/http/authenticator.rb
index b29cb5d039..b6d6476b78 100644
--- a/lib/chef/http/authenticator.rb
+++ b/lib/chef/http/authenticator.rb
@@ -191,7 +191,7 @@ class Chef
@win32registry.create_key(new_path, true)
end
size = 14
- password = (0...size).map { SOME_CHARS.sample(1) }.join
+ password = (0...size).map{ SOME_CHARS[rand(SOME_CHARS.size)] }.join
encrypted_pass = encrypt_pfx_pass(password)
values = { name: "PfxPass", type: :string, data: encrypted_pass }
@win32registry.set_value(new_path, values)