mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 08:20:07 +01:00
Revert cipher requirement in parse cipher.
There is several specification that violate this (chacha20 etc). Just use the old way...
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
#include "utils_crypt.h"
|
||||
|
||||
int crypt_parse_name_and_mode(const char *s, char *cipher, int *key_nums,
|
||||
char *cipher_mode, int require_iv)
|
||||
char *cipher_mode)
|
||||
{
|
||||
if (!s || !cipher || !cipher_mode)
|
||||
return -EINVAL;
|
||||
@@ -45,16 +45,6 @@ int crypt_parse_name_and_mode(const char *s, char *cipher, int *key_nums,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!strcmp(cipher_mode, "ecb"))
|
||||
return 0;
|
||||
|
||||
/* Enforce IV */
|
||||
if (require_iv) {
|
||||
char *tmp = strchr(cipher_mode, '-');
|
||||
if (!tmp || tmp[1] == '\0')
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user