aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/aes256cbc_decrypt_block.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-06-15 21:32:42 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-06-15 21:32:42 +0300
commit3f5df3abf1386ce9071046bb00e5eae27a10e2ef (patch)
treec37bdb612d3c0e0175d5092c9d6be8a7b90335f5 /test/aes256cbc_decrypt_block.c
parentcode style (diff)
downloadaes-tools-3f5df3abf1386ce9071046bb00e5eae27a10e2ef.tar.gz
aes-tools-3f5df3abf1386ce9071046bb00e5eae27a10e2ef.zip
handle block parsing errors the standard way
Diffstat (limited to '')
-rw-r--r--test/aes256cbc_decrypt_block.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/aes256cbc_decrypt_block.c b/test/aes256cbc_decrypt_block.c
index 1066b7f..89ead21 100644
--- a/test/aes256cbc_decrypt_block.c
+++ b/test/aes256cbc_decrypt_block.c
@@ -29,13 +29,13 @@ int main(int argc, char** argv)
if (argc < 2)
exit_with_usage();
- if (aesni_parse_block256(&key, *argv) != 0)
+ if (aesni_is_error(aesni_parse_block256(&key, *argv, NULL)))
{
fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv);
exit_with_usage();
}
- if (aesni_parse_block128(&iv, argv[1]) != 0)
+ if (aesni_is_error(aesni_parse_block128(&iv, argv[1], NULL)))
{
fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]);
exit_with_usage();
@@ -49,7 +49,7 @@ int main(int argc, char** argv)
if (strcmp("--", *argv) == 0)
break;
- if (aesni_parse_block128(&cipher, *argv) != 0)
+ if (aesni_is_error(aesni_parse_block128(&cipher, *argv, NULL)))
{
fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv);
continue;