Skip to content

Commit

Permalink
Fixes #37610 - pass the unencrypted root_pass to crypt for grub_pass
Browse files Browse the repository at this point in the history
self.root_pass can be already encrypted, and in the case of
Base64(-Windows) we do not reliably detect that. And even if, using B64
for GRUB wouldn't work anyway.

Fixes: 60d53c2
  • Loading branch information
evgeni committed Jun 28, 2024
1 parent f2e6bca commit 89ce379
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/concerns/host_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ def image_file
end

def crypt_passwords
self.root_pass = crypt_pass(self[:root_pass], :root)
self.grub_pass = crypt_pass(self[:grub_pass] || self[:root_pass], :grub)
root_pass = self[:root_pass]
self.root_pass = crypt_pass(root_pass, :root)
self.grub_pass = crypt_pass(self[:grub_pass] || root_pass, :grub)
end

def crypt_pass(unencrypted_pass, pass_kind)
Expand Down

0 comments on commit 89ce379

Please sign in to comment.