mhogomchungu / zuluCrypt

zuluCrypt is a front end to cryptsetup and tcplay and it allows easy management of encrypted block devices
https://mhogomchungu.github.io/zuluCrypt
Other
504 stars 60 forks source link

gnome-keyring #156

Closed stef204 closed 3 years ago

stef204 commented 3 years ago

zuluCrypt 6.0.0

gnome-keyring does not seem to see or recognize the volume/file upon attempting to mount (both gui or cli). No prompt, and the usual zuluCrypt window needs password insertion in the regular field, despite having used Options|Manage Volume in Gnome Keyring and having added the entry to keyring, including the Key, etc.

Using Seahorse, I see a reference to zuluCrypt inside the keyring with a number of fields like lxqt.Wallet.zuluCrypt.zuluCrypt with a string lxqt_wallet_size and value of 0 and another entry with string lxqt_wallet_open with value lxqt_wallet_open.

When I add my own volume by using Ctrl-V, I then do see its password/key in the keyring but there seems to be no interaction between zuluCrypt and gnome-keyring.

Edit: I killed and restarted gnome-keyring-daemon and zuluCrypt-gui, then on Ctrl-V it did trigger a dialog to unlock the keyring but still, zuluZrypt-gui needs the password to the volume inserted manually in the password field in zuluCrypt dialog box.

What am I missing?

mhogomchungu commented 3 years ago

Please mention the name and version of the distribution you are using.

stef204 commented 3 years ago

Archlinux x86_64; up-to-date.

mhogomchungu commented 3 years ago

The process could be improved because its not done automatically and it now need three clicks.

Do the steps as they are seen below and see if it works if you have not done it this way.

Screenshot_20210203_083846

stef204 commented 3 years ago

Thanks for the screenshot. Very clear. it works. Slight improvement could be to have the dropdown menu (Step 1) "remember" the setting Plugin for next time, IOW remember whatever last state set by user for that dropdown menu. But I'm already happy to see that it works and can use it. Thanks.

mhogomchungu commented 3 years ago

The best solution is to use this window from my SiriKali[1] project. If a user select a backend to use as default, then zuluCrypt should first look if a volume to be unlock has an entry in the wallet and auto fill the password field if it does and i think this is the behavior you were expecting.

Will keep this bug report open for now until the new functionality is in.

[1] https://github.com/mhogomchungu/sirikali Screenshot_20210203_100759

stef204 commented 3 years ago

Sorry, I am not clear: you mean install Sirikali in parallel to zuluCrypt and use the above window? If so, I think I'll just use it as you explained here. Not fond of installing too many apps. Would welcome the enhancement or new feature for zuluCrypt itself at some point when you can get to it, though. Thanks.

mhogomchungu commented 3 years ago

No, i mean making zuluCrypt behaving the same way SiriKali does.

I made things work as you expect in SiriKali a while ago and i now i am doing the same in zuluCrypt and it is something i should have done months ago since it was in my to do list.

stef204 commented 3 years ago

That's great to hear, thanks. Let me know if you want me to test it, etc., whenever you are ready for it. I think it will be a nice improvement.

mhogomchungu commented 3 years ago

The functionality is now in git version, can you build from git and see that it works as expected?

FIrstm click menu->favorites->manage favorites and pictures below show the new UI and with steps to take to add a volume to the favorites list and then add the favorite to the secret wallet list.

When done with the above, try to unlock a favorite volume and zuluCrypt should now automatically take the volume password from a secret wallet and auto fill it.

Screenshot_20210204_014655

Screenshot_20210204_014731

stef204 commented 3 years ago

Thanks. I will build from git and post back.

stef204 commented 3 years ago

Works but was awkward to setup. At first, I clicked "Add" in the picture above and it crashed. Then I didn't quite follow the steps and it wasn't working. I focused more and it works now. Not sure how intuitive it is, TBH the "flow". Quick question: to add file system options like uid/gid, using GUI, only zuluMount-gui can be used? I don't see that option in the zuluCrypt-gui. Also, would be nice it zuluMount-cli would recognize the favorite setup and bring up whatever it needs to take the password from the keyring. Asking too much probably. Some users might not like that, not sure.

stef204 commented 3 years ago

We should have another ticket for the following issue: but I tried to use zuluMount-gui and it recognizes the favorite, however, it inserts the full path into the top field as Mount Name and then gives the error that / character cannot be in the mount point. So that requires fixing, I believe. Also, would be nice if the same behavior of fetching the password from the keyring would apply also to zuluMount-gui. Finally, it would be really desirable to be able to save the file system options along with the favorite otherwise it is really tedious to always have to manually insert uid=xxxx,gid=xxx, etc. Feel free to delete this comment if you want me to open separate issues/tickets. And thanks for being responsive, it's really appreciated,

mhogomchungu commented 3 years ago

We can continue here, i dont mind.

With the git version:-

  1. zuluCrypt-gui now no longer crashes when clicking "Add" with empty fields.
  2. zuluMount-gui now works with favorite entry.
  3. zuluMout-gui now automatically use favorite's password set up in zuluCrypt-gui.
  4. Will comment later on about the uid request and CLI using secret wallets
stef204 commented 3 years ago

Thanks. I will recompile and test it out.

stef204 commented 3 years ago
  1. confirmed -- just curious: were you able to find the reason for the crash or disabled the clicking if empty?
  2. confirmed
  3. confirmed
  4. would be very useful
mhogomchungu commented 3 years ago

The git version now allow setting mount options with favorite entries.

The crash was caused by this[1] line. Favorites files are saved at $HOME/.config/zuluCrypt/favorites. The favorite file name starts with the last component of the volume path and the component is obtained by using a split function that returns a QStringList object and a crash follows when trying to access any part of an empty QStringList object. The solution i went with is to prevent[2] trying to create a favorite entry that has an empty volume path.

[1] https://github.com/mhogomchungu/zuluCrypt/blob/dda56df59b3e3532eb5326949f587673e162c451/zuluCrypt-gui/favorites.cpp#L74 [2] https://github.com/mhogomchungu/zuluCrypt/blob/dda56df59b3e3532eb5326949f587673e162c451/zuluCrypt-gui/favorites2.cpp#L169

stef204 commented 3 years ago

Thanks for the info. Let me know if/when you're able to work on 4. above.

mhogomchungu commented 3 years ago

zuluCrypt-gui now has an option to set file system options and you can do so by clicking the "options" button on the password window.

You can also set file system options with a favorite entry.

stef204 commented 3 years ago

Just rebuilt from git. It works. Thank a lot. Nicely done!