Skip to content

Commit

Permalink
Partitioner: new defaults for encrypting
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed May 3, 2024
1 parent 06979a7 commit 92aa6d5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/lib/y2partitioner/actions/controllers/encryption.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def initialize(fs_controller)
@fs_controller = fs_controller
@action = actions.first
@password = encryption&.password || ""
@pbkdf = encryption&.pbkdf
@method = initial_method
@pbkdf = initial_pbkdf
@apqns = initial_apqns
@label = initial_label
end
Expand Down Expand Up @@ -215,10 +215,22 @@ def initial_method
if methods.include?(encryption&.method)
encryption.method
else
Y2Storage::EncryptionMethod::LUKS1
Y2Storage::EncryptionMethod::LUKS2
end
end

# Initial password-based key derivation function, if relevant
#
# @return [Y2Storage::PbkdFunction, nil]
def initial_pbkdf
function = encryption&.pbkdf
return function unless function.nil? && method.is?(:luks2)

# Hardcoded conservative default, we can either change it or make it configurable
# (see Y2Storage::Configuration) in the future if needed.
Y2Storage::PbkdFunction::PBKDF2
end

# Currently used APQNs when the device is encrypted with pervasive encryption
#
# @return [Array<Y2Storage::EncryptionProcesses::Apqn>]
Expand Down

0 comments on commit 92aa6d5

Please sign in to comment.