! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
add support for LUKS-encrypted volume
Status:
RESOLVED: FIXED
Severity:
enhancement

Comments

Description Yves-Alexis Perez editbugs 2007-06-19 06:34:06 CEST
Hi,

I tried to use a LUKS-encrypted usb key, it's correctly detected by hal but nothing asks me a passphrase, and thunar-volman doesn't manage to mount the volume (because it can't see the encrypted part).

I suppose the LUKS-support should be integrated in volman (like it is in gnome-volume-manager) but I'm not sure, so feel free to mark it INVALID and point me to another direction (HAL or distro)

If you need more output, please ask.

Regards,

--
Yves-Alexis Perez
Comment 1 Yves-Alexis Perez editbugs 2007-09-15 09:28:33 CEST
Hmhm, in fact the wishlist bug should be against exo because it's exo-mount's job to do this. Reassigning
Comment 2 Yves-Alexis Perez editbugs 2008-01-17 11:10:57 CET
And it would be nice if one could use it with crypto-containers too.

Like having a file named crypto.luks, one could do: exo-mount crypto.luks (or double click on it in thunar), and it would automagically mount it.

Currently I guess the losetup part is hard to do without root access, but at one time it would be really nice. (see what mac osx users can do with crypto containers on their disk)

Cheers,
Comment 3 Colin Leroy 2008-06-07 17:28:53 CEST
Dupe of bug 2788?
Comment 4 Colin Leroy 2008-06-08 16:32:05 CEST
Created attachment 1665 
Patch to Thunar to avoid ejecting what should be unmounted

This patch lets Thunar Unmount instead of Eject, when hal says that eject isn't required. It's needed to avoid ejecting LUKS-encrypted devices.
Comment 5 Colin Leroy 2008-06-08 16:33:14 CEST
Created attachment 1666 
Patch to send crypto volumes to exo-mount

This patch lets thunar-volman send "crypto" volumes to exo-mount instead of doing nothing.
Comment 6 Colin Leroy 2008-06-08 16:34:12 CEST
Created attachment 1667 
Patch to handle crypto volumes in exo-mount

This patch lets exo-mount setup the crypto layer and mount crypto volumes.
Comment 7 Colin Leroy 2008-06-08 18:12:35 CEST
Created attachment 1668 
Patch v2 to handle crypto volumes in exo-mount

Updated patch: clear previous (password) error on success; forcibly unmount instead of eject even if asked.
Comment 8 Colin Leroy 2008-06-08 18:14:10 CEST
Also: in fact, the first patch (to Thunar) is not completely necessary; it's just that, given an USB key with two partitions (one clear, one crypted), if trying to eject the first one while the second one is mounted is impossible. 
Comment 9 Colin Leroy 2008-06-09 12:22:19 CEST
Created attachment 1669 
v3 of libexo patch

This patch to libexo adds (wrt attachment #1668 ):
- mounting of LUKS-crypted FS via device path (/dev/sdb1) in addition to hal-udis
- libexo updates to exo_hal_volume_compute_display_name() and exo_hal_volume_compute_icon_list() to be able to return a "gtk-dialog-authentication" icon for crypto containers, and prefix their name with "Encrypted".
Comment 10 Colin Leroy 2008-06-09 12:25:00 CEST
Created attachment 1670 
Patch to Thunar to handle crypto fs

This patch to Thunar supercedes attachment #1665  and adds handling of crypto containers:
- Display crypto containers in the list of devices
- Specific Setup/Teardown in these devices to avoid having to hack around the mounting/unmounting logics

It makes it possible to handle crypted filesystems without thunar-volman (previously Thunar didn't show these filesystems, and if thunar-volman didn't fire an automount for these, they were invisible).
Comment 11 Colin Leroy 2008-06-09 12:31:32 CEST
Created attachment 1671 
Patch to xfdesktop

This patch to xfdesktop (untested due to "Please upgrade libxfce4util-1.0 to atleast version 4.5.0svn-r26490") handles crypto setup/teardown.
Comment 12 Yves-Alexis Perez editbugs 2008-06-09 14:03:58 CEST
At first sight, the patches work fine. I have to do more testing. Benny, it'd be really nice if you could comment on them (and maybe see if it's possible to included it in a not so future point release).

Oh and btw the patch includes a soname bump because of struct changes, afaict.

Thanks Colin for the work!

Cheers,
Comment 13 Yves-Alexis Perez editbugs 2008-06-09 14:27:25 CEST
hmhm, and I'd like to integrate the functionality in Lenny, but the lib-freeze is approaching, and I wont integrate a soname-bump patch if it diverts from upstream.

Thus it'd be really nice if those (or equivalent) patches could be integrated (and released!) soon :)

Thanks for the work benny, hope to see you soon :)

--
Yves-Alexis
Comment 14 Colin Leroy 2008-06-09 15:13:20 CEST
Created attachment 1672 
Patch to Thunar to handle crypto fs - without eject logic rework

This patch is the same as attachment #1670 , apart that it doesn't change the eject/unmount logic, so that people can still use Eject. It may fail with non-obvious error (an application prevents to eject) if trying to eject a normal partition while an ecnrypted one is mounted.
Comment 15 Robby Workman editbugs 2008-06-09 17:09:27 CEST
Full Ack on the requests for this  :-)

I just tested the patches and results are here:
  http://slackware.com/~rworkman/crypt-dialog.jpg
  http://slackware.com/~rworkman/crypt-after.jpg
After typing correct passphrase in the dialog window, I am prompted for it *again*
(and once more if it's entered again), even though the device is successfully mounted after the first time the passphrase is entered correctly.  That's a minor issue at this point, as the important part is that the feature works - I'll try to look into the problem later...
Comment 16 Colin Leroy 2008-06-09 18:15:28 CEST
Created attachment 1674 
v4 of libexo patch

Patch against libexo - same as v3, added a fix (fixed overwriting of a GError in case of multiple password failure)
Comment 17 Colin Leroy 2008-06-10 08:15:38 CEST
To summarize the patches :)

- attachment #1674  against libexo is what makes exo-mount recognize, ask for 
  password, and mount LUKS-encrypted filesystems; it also adds a specific icon
  and label for crypto containers;
- attachment #1672  against Thunar makes it recognize crypto containers and act
  accordingly (Setup/Teardown crypto layer instead of Mount/Unmount), although 
  the callback is the same, and adds functions to thunar-vfs so that users of 
  this library can recognize crypto containers too;
- attachment #1666  against Thunar-Volman makes it pass crypto containers to 
  exo-mount instead of ignoring them, so that if Automount is set, everything's 
  automatic;
- attachment #1671  against Xfdesktop makes it recognize crypto containers and 
  act accordingly (Setup/Teardown crypto layer instead of Mount/Unmount).
Comment 18 Colin Leroy 2008-06-10 09:06:22 CEST
Created attachment 1676 
v5 of libexo.patch

This 5th revision implements (offline) comments from Benedikt: better handling of errors.
Comment 19 Colin Leroy 2008-06-15 18:52:55 CEST
Created attachment 1689 
libexo.patch

New batch of patches, following Benny's review. They fix:
- coding style
- leak on error in the libexo patch
- possible races in thunar patch
Comment 20 Colin Leroy 2008-06-15 18:53:12 CEST
Created attachment 1690 
thunar.patch
Comment 21 Colin Leroy 2008-06-15 18:53:29 CEST
Created attachment 1691 
thunar-volman.patch
Comment 22 Colin Leroy 2008-06-15 18:53:48 CEST
Created attachment 1692 
xfdesktop.patch
Comment 23 SiD 2008-07-09 05:42:15 CEST
The patches work for me. 
Options to use a keyfile instead of entering the passphrase manually, and to hide encrypted root and home partitions (or any other that are mounted during bootup) would be nice.
Comment 24 Yves-Alexis Perez editbugs 2008-07-09 05:51:38 CEST
(In reply to comment #23)
> The patches work for me. 
> Options to use a keyfile instead of entering the passphrase manually, and to
> hide encrypted root and home partitions (or any other that are mounted during
> bootup) would be nice.
>
Home and root partition doesn't appear here, but maybe that's because what is encrypted is the lvm volume group.

But yes, an option for loading a keyfile could be nice :)

Comment 25 Colin Leroy 2008-07-09 06:34:19 CEST
(In reply to comment #24)

> But yes, an option for loading a keyfile could be nice :)
 
I'll probably do it once these will be in svn :)
Comment 26 Colin Leroy 2008-08-12 07:48:02 CEST
Created attachment 1762 
Thunar-volman patch to setup crypto
Comment 27 Colin Leroy 2008-08-12 07:49:03 CEST
Created attachment 1763 
Exo-mount patch to teardown crypto on unmount

these two last patches are the result of an offline conversation with Benny. He says they're OK to commit :)
Comment 28 Colin Leroy 2008-08-12 08:16:28 CEST
Created attachment 1764 
Thunar-volman patch to setup crypto (with new files)

Patch was missing new files
Comment 29 Colin Leroy 2008-08-12 08:16:52 CEST
Created attachment 1765 
Exo-mount patch to teardown crypto on unmount (typos fixed)
Comment 30 Robby Workman editbugs 2008-11-25 08:05:54 CET
*** Bug 2788 has been marked as a duplicate of this bug. ***
Comment 31 Robby Workman editbugs 2008-11-25 08:09:07 CET
This is implemented in the 4.6 codebase.
Thanks, Colin!

Bug #3349

Reported by:
Yves-Alexis Perez
Reported on: 2007-06-19
Last modified on: 2009-10-09
Duplicates (1):
  • 2788 Add support for encrypted volumes

People

Assignee:
Nick Schermer
CC List:
5 users

Version

Attachments

Patch to Thunar to avoid ejecting what should be unmounted (692 bytes, patch)
2008-06-08 16:32 CEST , Colin Leroy
no flags
Patch to send crypto volumes to exo-mount (657 bytes, patch)
2008-06-08 16:33 CEST , Colin Leroy
no flags
Patch to handle crypto volumes in exo-mount (14.13 KB, patch)
2008-06-08 16:34 CEST , Colin Leroy
no flags
Patch v2 to handle crypto volumes in exo-mount (14.95 KB, patch)
2008-06-08 18:12 CEST , Colin Leroy
no flags
v3 of libexo patch (17.01 KB, patch)
2008-06-09 12:22 CEST , Colin Leroy
no flags
Patch to Thunar to handle crypto fs (16.11 KB, patch)
2008-06-09 12:25 CEST , Colin Leroy
no flags
Patch to xfdesktop (2.29 KB, patch)
2008-06-09 12:31 CEST , Colin Leroy
no flags
Patch to Thunar to handle crypto fs - without eject logic rework (15.68 KB, patch)
2008-06-09 15:13 CEST , Colin Leroy
no flags
v4 of libexo patch (15.31 KB, patch)
2008-06-09 18:15 CEST , Colin Leroy
no flags
v5 of libexo.patch (18.60 KB, patch)
2008-06-10 09:06 CEST , Colin Leroy
no flags
libexo.patch (17.27 KB, patch)
2008-06-15 18:52 CEST , Colin Leroy
no flags
thunar.patch (15.51 KB, patch)
2008-06-15 18:53 CEST , Colin Leroy
no flags
thunar-volman.patch (668 bytes, patch)
2008-06-15 18:53 CEST , Colin Leroy
no flags
xfdesktop.patch (2.35 KB, patch)
2008-06-15 18:53 CEST , Colin Leroy
no flags
Thunar-volman patch to setup crypto (11.48 KB, patch)
2008-08-12 07:48 CEST , Colin Leroy
no flags
Exo-mount patch to teardown crypto on unmount (4.26 KB, patch)
2008-08-12 07:49 CEST , Colin Leroy
no flags
Thunar-volman patch to setup crypto (with new files) (29.43 KB, patch)
2008-08-12 08:16 CEST , Colin Leroy
no flags
Exo-mount patch to teardown crypto on unmount (typos fixed) (4.26 KB, patch)
2008-08-12 08:16 CEST , Colin Leroy
no flags

Additional information