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:
Milan Broz
2018-01-18 22:33:16 +01:00
parent c6a8b6471a
commit f6e613a76f
7 changed files with 18 additions and 28 deletions

View File

@@ -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;
}