From 3f5df3abf1386ce9071046bb00e5eae27a10e2ef Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 15 Jun 2015 21:32:42 +0300 Subject: handle block parsing errors the standard way --- test/aes128cfb_encrypt_block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/aes128cfb_encrypt_block.c') diff --git a/test/aes128cfb_encrypt_block.c b/test/aes128cfb_encrypt_block.c index d322fce..9ef1df4 100644 --- a/test/aes128cfb_encrypt_block.c +++ b/test/aes128cfb_encrypt_block.c @@ -28,13 +28,13 @@ int main(int argc, char** argv) if (argc < 2) exit_with_usage(); - if (aesni_parse_block128(&key, *argv) != 0) + if (aesni_is_error(aesni_parse_block128(&key, *argv, NULL))) { fprintf(stderr, "Invalid 128-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(); @@ -47,7 +47,7 @@ int main(int argc, char** argv) if (strcmp("--", *argv) == 0) break; - if (aesni_parse_block128(&plain, *argv) != 0) + if (aesni_is_error(aesni_parse_block128(&plain, *argv, NULL))) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; -- cgit v1.2.3