aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/utils/aes128ecb_encrypt_file.cpp
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 /utils/aes128ecb_encrypt_file.cpp
parentcode style (diff)
downloadaes-tools-3f5df3abf1386ce9071046bb00e5eae27a10e2ef.tar.gz
aes-tools-3f5df3abf1386ce9071046bb00e5eae27a10e2ef.zip
handle block parsing errors the standard way
Diffstat (limited to 'utils/aes128ecb_encrypt_file.cpp')
-rw-r--r--utils/aes128ecb_encrypt_file.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/utils/aes128ecb_encrypt_file.cpp b/utils/aes128ecb_encrypt_file.cpp
index 694d8fe..a2d13c6 100644
--- a/utils/aes128ecb_encrypt_file.cpp
+++ b/utils/aes128ecb_encrypt_file.cpp
@@ -42,14 +42,10 @@ int main(int argc, char** argv)
if (argc != 4)
exit_with_usage();
- if (aesni_parse_block128(&key, argv[1]) != 0)
- {
- std::cerr << "Invalid 128-bit AES block '" << argv[1] << "'\n";
- exit_with_usage();
- }
-
try
{
+ aesni_parse_block128(&key, argv[1], aesni::ErrorDetailsThrowsInDestructor());
+
const std::string src_path(argv[2]);
const std::string dest_path(argv[3]);