Move cipher_null check in internal function crypt_is_cipher_null.

Also removes tools helper so that we keep check in one place.
This commit is contained in:
Ondrej Kozina
2021-02-10 17:48:56 +01:00
parent 7d912c7d3e
commit a4d7c46d80
5 changed files with 14 additions and 13 deletions

View File

@@ -175,3 +175,10 @@ ssize_t crypt_hex_to_bytes(const char *hex, char **result, int safe_alloc)
*result = bytes;
return i;
}
bool crypt_is_cipher_null(const char *cipher_spec)
{
if (!cipher_spec)
return false;
return (strstr(cipher_spec, "cipher_null") || !strcmp(cipher_spec, "null"));
}