From 71b791a2ff679463d6ef915490232cfa037f02b2 Mon Sep 17 00:00:00 2001 From: miod <> Date: Tue, 22 Apr 2014 21:27:15 +0000 Subject: 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. --- src/lib/libssl/src/crypto/aes/aes_wrap.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/lib/libssl') diff --git a/src/lib/libssl/src/crypto/aes/aes_wrap.c b/src/lib/libssl/src/crypto/aes/aes_wrap.c index 668978425a..40533440bf 100644 --- a/src/lib/libssl/src/crypto/aes/aes_wrap.c +++ b/src/lib/libssl/src/crypto/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 -- cgit v1.2.3-55-g6feb