systemd/cryptsetup-handle-plain.patch

72 lines
2.7 KiB
Diff
Raw Normal View History

Accepting request 149704 from Base:System - Add systemctl-options.patch: handle SYSTEMCTL_OPTIONS internaly (bnc#798620). - Update crypt-loop-file.patch to correctly detect crypto loop files (bnc#799514). - Add journalctl-remove-leftover-message.patch: remove debug message in systemctl. - Add job-avoid-recursion-when-cancelling.patch: prevent potential recursion when cancelling a service. - Add sysctl-parse-all-keys.patch: ensure sysctl file is fully parsed. - Add journal-fix-cutoff-max-date.patch: fix computation of cutoff max date for journal. - Add reword-rescue-mode-hints.patch: reword rescue prompt. - Add improve-overflow-checks.patch: improve time overflow checks. - Add fix-swap-behaviour-with-symlinks.patch: fix swap behaviour with symlinks. - Add hostnamectl-fix-set-hostname-with-no-argument.patch: ensure hostnamectl requires an argument when called with set-hostname option. - Add agetty-overrides-term.patch: pass correctly terminal type to agetty. - Add check-for-empty-strings-in-strto-conversions.patch: better check for empty strings in strto* conversions. - Add strv-cleanup-error-path-loops.patch: cleanup strv on error path. - Add cryptsetup-handle-plain.patch: correctly handle "plain" option in cryptsetup. - Add fstab-generator-improve-error-message.patch: improve error message in fstab-generator. - Add delta-accept-t-option.patch: accept -t option in (forwarded request 149703 from fcrozat) OBS-URL: https://build.opensuse.org/request/show/149704 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=122
2013-01-24 10:41:58 +01:00
From 65343c749441322d1e65e8bb5d433b6fee8c28bf Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Tue, 6 Nov 2012 09:49:27 -0500
Subject: [PATCH] cryptsetup: hash=plain means don't use a hash
"plain" is a semantic value that cryptsetup(8) uses to describe a plain
dm-crypt volume that does not use a hash. Catch this value earlier and
ensure that a NULL params.hash is passed to crypt_format to avoid
passing an invalid hash type to the libcryptsetup backend.
FDO bug #56593.
---
src/cryptsetup/cryptsetup.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 916509a..e8ba3f0 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -342,7 +342,12 @@ int main(int argc, char *argv[]) {
opt_tries = opt_tries > 0 ? opt_tries : 3;
opt_key_size = (opt_key_size > 0 ? opt_key_size : 256);
- hash = opt_hash ? opt_hash : "ripemd160";
+ if (opt_hash) {
+ /* plain isn't a real hash type. it just means "use no hash" */
+ if (!streq(opt_hash, "plain"))
+ hash = opt_hash;
+ } else
+ hash = "ripemd160";
if (opt_cipher) {
size_t l;
@@ -463,7 +468,7 @@ int main(int argc, char *argv[]) {
opt_keyfile_size,
&params);
- pass_volume_key = streq(hash, "plain");
+ pass_volume_key = !!hash;
}
if (k < 0) {
--
1.7.10.4
From 8db9d8c2a4ef9806c286e258f9932a0972dc2375 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Tue, 6 Nov 2012 10:17:18 -0500
Subject: [PATCH] cryptsetup: fix inverted comparison in pass_volume_key
---
src/cryptsetup/cryptsetup.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index e8ba3f0..56a3b50 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -468,7 +468,8 @@ int main(int argc, char *argv[]) {
opt_keyfile_size,
&params);
- pass_volume_key = !!hash;
+ /* hash == NULL implies the user passed "plain" */
+ pass_volume_key = (hash == NULL);
}
if (k < 0) {
--
1.7.10.4