Summary: | systemd-cryptsetup handles keyfile differently from cryptsetup on plain mode | ||
---|---|---|---|
Product: | systemd | Reporter: | Marcos <lenharo> |
Component: | general | Assignee: | systemd-bugs |
Status: | RESOLVED FIXED | QA Contact: | systemd-bugs |
Severity: | normal | ||
Priority: | medium | CC: | intrigeri, leho, qlefebvre_pro, seschwar |
Version: | unspecified | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Proposed patch |
Description
Marcos
2012-07-29 02:18:05 UTC
I am also seeing strange behavior with a plain encryption device. Commandline cryptsetup works fine, but systemctl start causes device contents to be garbled which means some input is incorrect. Looking at this bug, it's indeed very likely the keyfile. Hi, I just proposed a patch for this bug. I hope it will be soon taken into account. Waiting for this, you can make both cryptsetup and systemd-cryptsetup work by changing the 'hash' option in /etc/crypttab to 'hash=plain'. Best regards, Quentin Created attachment 109722 [details] [review] Proposed patch Please find the proposed patch attached above. Also additional information can be found here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=768577 Best regards, Quentin Hi, thank you for the report and the patch. It seems wrong to ignore the hash parameter if it is explicitly specified. Even if cryptsetup did that, it seems to be a bug in cryptsetup, and not something to be blindly followed. I changed the code to default to no hash if key file is specified though in http://cgit.freedesktop.org/systemd/systemd/commit/?id=8a52210c93. Hi, I agree with you. Thanks for pushing this patch and making it a bit more elegant. Best, Quentin Hi again, Sorry for that, but your patch doesn't solve the issue, as I mentionned in the mailing list: http://lists.freedesktop.org/archives/systemd-devel/2014-November/025490.html So I reopen the bug and kindly suggest you to apply my original patch, or find an equivalent way to make it work. Best regards, Quentin Sorry, but this is wrong place to fix the issue. Hi, I reopened (again) this bug report. Please read the following before getting angry... Actually, cryptsetup(8) makes it quite clear that hash processing is only used on *passphrases*. See the "NOTES ON PASSPHRASE PROCESSING FOR PLAIN MODE" section. So, IMHO that's not a bug in cryptsetup, but rather the intended and documented way it works. So, this means that, when a key file is provided, any provided hash algorithm should definitely be ignored (in plain mode). Thanks in advance to take that into account. Cheers, Quentin (In reply to Quentin Lefebvre from comment #9) > Hi, > > I reopened (again) this bug report. Please read the following before getting > angry... Hi, sorry for my ternseness. I'm not angry, I'm trying to solve the problem in the best way, same as you. But I think we reached a point where the situation is clear, everything has been articulated clearly, and the differences stem only from different priorities, not misunderstanding. I understand that for you keeping current cryptsetup-compatible setups functional is more important, but for me sensible and consistent systemd behaviour is more important. More words will not help the issue. > Actually, cryptsetup(8) makes it quite clear that hash processing is only > used on *passphrases*. See the "NOTES ON PASSPHRASE PROCESSING FOR > PLAIN MODE" section. So, IMHO that's not a bug in cryptsetup, but > rather the intended and documented way it works. I read the man page (on Fedora, I'm not sure if it is the same) and while it's true that it talks about "passphrase processing", it also does not explictly say that hash will be ignored for a file. That section even talks about hashing input read from stdin, and also about reading stuff from a file. So even if cryptsetup ignores --hash when reading from a key file, it seems to be more by mistake then by design, at least when judging by the man page. As discussed on the ml, we'll keep current behaviour. I would still consider this a WASABUG, rather than NOTABUG, since 8a52210c93 fixed my issue of /etc/crypttab simply not working with plain,cipher=aes-cbc-plain configuration at all. systemd-218 everything is smooth. tyvm sir. +1 for WASABUG from me. This broke my system when moving from debian wheezy to jessie and I spend half a day finding this bug report and applying hash=plain. I am OK with not reimplementing what systemd-cryptsetup considers a bug in cryptsetup. But there should have been a big fat warning about an incosistency in crypttab instead. OK, changing resoulution based on popular vote. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.