chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cryptsetup: hash=plain means don't use a hash
[elogind.git]
/
src
/
cryptsetup
/
cryptsetup.c
diff --git
a/src/cryptsetup/cryptsetup.c
b/src/cryptsetup/cryptsetup.c
index 916509ab93481b17b3ddd30077f89e759f12c113..e8ba3f02a3060e5fe60b36cb049e89fdfe130033 100644
(file)
--- 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);
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;
if (opt_cipher) {
size_t l;
@@
-463,7
+468,7
@@
int main(int argc, char *argv[]) {
opt_keyfile_size,
¶ms);
opt_keyfile_size,
¶ms);
- pass_volume_key =
streq(hash, "plain")
;
+ pass_volume_key =
!!hash
;
}
if (k < 0) {
}
if (k < 0) {