summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-04-22 21:27:12 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-04-22 21:27:12 +0000
commitf543ee8ad141bff0415726832d84ea7de9f82d11 (patch)
tree69e0df747dfc3298bb33b11cefa2a40d8ecc6a51 /lib
parente6c54ceb8562dd50780798eaee178b31d9b68642 (diff)
When compiling with AES_WRAP_TEST, make main() return a meaningful value
instead of garbage, and add this to the libcrypto regress. Note these tests are incomplete, as they always use the default IV.
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/aes/aes_wrap.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libcrypto/aes/aes_wrap.c b/lib/libcrypto/aes/aes_wrap.c
index 668978425ad..40533440bf3 100644
--- a/lib/libcrypto/aes/aes_wrap.c
+++ b/lib/libcrypto/aes/aes_wrap.c
@@ -231,19 +231,33 @@ main(int argc, char **argv)
};
AES_KEY wctx, xctx;
- int ret;
+ int ret, nfailures = 0;
ret = AES_wrap_unwrap_test(kek, 128, NULL, e1, key, 16);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 192, NULL, e2, key, 16);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 256, NULL, e3, key, 16);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 192, NULL, e4, key, 24);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 256, NULL, e5, key, 24);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 256, NULL, e6, key, 32);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
+
+ return nfailures;
}
#endif