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 599617 - libcryptsetup activate_by* library calls should support NULL as device name
Summary: libcryptsetup activate_by* library calls should support NULL as device name
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cryptsetup-luks
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Milan Broz
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-03 15:52 UTC by Milan Broz
Modified: 2013-03-01 04:09 UTC (History)
8 users (show)

Fixed In Version: cryptsetup-luks-1.1.2-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-10 20:05:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
api-test log (15.46 KB, text/plain)
2010-07-06 10:26 UTC, Alexander Todorov
no flags Details

Description Milan Broz 2010-06-03 15:52:28 UTC
Description of problem:
Documented use of activation_by* (like activation_by_passphrase) is that with device name == NULL it should jusr run verification but not device activation.

These calls are currently wrongly implemented in this case, in some cases library can even crash.

Fixed upstream
http://code.google.com/p/cryptsetup/source/detail?r=262#

Version-Release number of selected component (if applicable):
cryptsetup-luks-1.1.1-1.el6

Comment 3 RHEL Program Management 2010-06-03 16:03:14 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 4 Huzaifa S. Sidhpurwala 2010-06-04 01:49:19 UTC
I agree,
Currently i have to activate and deactivate the device to verify its luks password which is wrong.
device == NULL should just verify the password without actually activating the device, which would save a lot of housekeeping in deactivating etc.

Comment 5 Milan Broz 2010-06-07 08:26:25 UTC
Fixed in cryptsetup-luks-1.1.2-1.el6.

Comment 7 Alexander Todorov 2010-07-06 10:25:25 UTC
Hi Milan,
I've executed the patched api-test binary from the cryptsetup-luks-1.1.2-1.el6.src.rpm against the binary package built from the same SRPM. 

Here is the test output for the test cases added by the patch:

 [(fail)   ,AddDevicePlain:553] crypt_activate_by_volume_key(cd, NULL, key, key_size, 0) [cannot verify key with plain]

 [(fail)   ,AddDevicePlain:566] crypt_activate_by_passphrase(cd, NULL, CRYPT_ANY_SLOT, passphrase, strlen(passphrase), 0) [cannot verify passphrase with plain]

 [(success),UseLuksDevice:624] crypt_activate_by_volume_key(cd, NULL, key, key_size, 0)

 [(equal)  ,AddDeviceLuks:700] 1 == crypt_keyslot_add_by_volume_key(cd, 1, key, key_size, KEY1, strlen(KEY1))
 [(success),AddDeviceLuks:701] _prepare_keyfile(KEYFILE1, KEY1)
 [(success),AddDeviceLuks:702] _prepare_keyfile(KEYFILE2, KEY2)
 [(equal)  ,AddDeviceLuks:703] 2 == crypt_keyslot_add_by_keyfile(cd, 2, KEYFILE1, 0, KEYFILE2, 0)
 [(fail)   ,AddDeviceLuks:704] crypt_activate_by_keyfile(cd, CDEVICE_2, CRYPT_ANY_SLOT, KEYFILE2, strlen(KEY2)-1, 0) [key mismatch]
   => errno -1, errmsg: No key available with this passphrase.
 [(equal)  ,AddDeviceLuks:705] 2 == crypt_activate_by_keyfile(cd, NULL, CRYPT_ANY_SLOT, KEYFILE2, 0, 0)
 [(equal)  ,AddDeviceLuks:706] 2 == crypt_activate_by_keyfile(cd, CDEVICE_2, CRYPT_ANY_SLOT, KEYFILE2, 0, 0)
 [(success),AddDeviceLuks:707] crypt_keyslot_destroy(cd, 1)
 [(success),AddDeviceLuks:708] crypt_keyslot_destroy(cd, 2)
 [(success),AddDeviceLuks:709] crypt_deactivate(cd, CDEVICE_2)


This looks correct as far as I can see. Will attach the full test log. 

Is this enough to call this bug VERIFIED?

Comment 8 Alexander Todorov 2010-07-06 10:26:54 UTC
Created attachment 429731 [details]
api-test log

Comment 9 Milan Broz 2010-07-07 07:57:36 UTC
(In reply to comment #7)

> Is this enough to call this bug VERIFIED?
yes.
(patch in spec included patch for internal api-test to cover this)

Comment 10 releng-rhel@redhat.com 2010-11-10 20:05:00 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.