X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcryptsetup%2Fcryptsetup.c;h=f33284370c0d7c3d588116198abe30ac67cb7d77;hb=9bdbc2e2ec523dbefe1c1c7e164b5544aff0b185;hp=916509ab93481b17b3ddd30077f89e759f12c113;hpb=4271d8235f1186ddad54f432eaca10f8e3bd255f;p=elogind.git diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index 916509ab9..f33284370 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -62,7 +62,7 @@ static int parse_one_option(const char *option) { assert(option); /* Handled outside of this tool */ - if (streq(option, "noauto")) + if (streq(option, "noauto") || streq(option, "nofail")) return 0; if (startswith(option, "cipher=")) { @@ -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,8 @@ int main(int argc, char *argv[]) { opt_keyfile_size, ¶ms); - pass_volume_key = streq(hash, "plain"); + /* hash == NULL implies the user passed "plain" */ + pass_volume_key = (hash == NULL); } if (k < 0) {