Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1716674

Summary: Anaconda kickstart LUKS no option to set key size / incorrect documentation
Product: Red Hat Enterprise Linux 7 Reporter: jan
Component: python-blivetAssignee: Vojtech Trefny <vtrefny>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: jan, jkonecny, jstodola, rhandlin, zveleba
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-blivet-0.61.15.75-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1740210 (view as bug list) Environment:
Last Closed: 2020-03-31 19:45:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jan 2019-06-03 21:28:56 UTC
Description of problem:
There is no option with kickstart to set the key size for a LUKS volume. Only when no "--cipher" option is set the key size defaults to 512 bits, otherwise the default LUKS option is used. Making it impossible to use 512 bits with any cipher other than aes-xts-plain64.

Furthermore the documentation about this is incomplete/incorrect.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-encryption#sec-Using_LUKS_Disk_Encryption
Says: "The default key size for LUKS is 256 bits. The default key size for LUKS with Anaconda (XTS mode) is 512 bits."
However, when the "--cipher" option is set the key size fals back to the LUKS default. So for example when using serpent (XTS mode) the key size is 256 bits.

How reproducible:
Use a kickstart file to install RHEL and check the partition afterwards with cryptsetup luksDump

Steps to Reproduce:
part ... --encrypted --passphrase=temppass
part ... --encrypted --passphrase=temppass --cipher=aes-xts-plain64
part ... --encrypted --passphrase=temppass --cipher=serpent-xts-plain64
part ... --encrypted --passphrase=temppass --key-size=512
part ... --encrypted --passphrase=temppass --key-size=512 --cipher=serpent-xts-plain64

Expected results:
master key size: 512
master key size: 512
master key size: 512
master key size: 512
master key size: 512

Actual results:
master key size: 512
master key size: 256
master key size: 256
master key size: N/A
master key size: N/A

Additional info:
To make the documentation sound:
https://github.com/storaged-project/blivet/blob/rhel7-branch/blivet/formats/luks.py
This:
        if not self.exists and not self.cipher:
            self.cipher = "aes-xts-plain64"
            if not self.key_size:
                # default to the max (512 bits) for aes-xts
                self.key_size = 512
Should be changed to something like this:
        if not self.exists
            if not self.cipher:
                self.cipher = "aes-xts-plain64"
            if not self.key_size and "xts" in self.cipher:
                # default to the max (512 bits) fot xts
                self.key_size = 512

Comment 2 Jiri Konecny 2019-06-05 09:01:25 UTC
The code you are talking about is in our storage library. Switching components.

Comment 3 jan 2019-06-05 14:53:51 UTC
Well the code is the only code I found that touches the key-size during installation (apart from the LUKS defaults). However this is only part of the problem. To support setting the key-size in anaconda/kickstart configurations code needs to be added to anaconda/pykickstart. Furthermore the docs needs to be corrected.

Comment 5 Zdenek Veleba 2020-01-31 11:06:14 UTC
Verified, the default key size is now 512.

Comment 7 errata-xmlrpc 2020-03-31 19:45:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1060