diff options
| author | miod <> | 2014-04-22 21:27:15 +0000 |
|---|---|---|
| committer | miod <> | 2014-04-22 21:27:15 +0000 |
| commit | 4e5c7a92843baa574477161a6a1b2df108ba3cde (patch) | |
| tree | 7f01145a77987f3aea2deaa91990a805eb4bb794 /src/lib/libssl/src | |
| parent | e22e908b0314c8680bfa1ce27f4d5ddb881238c5 (diff) | |
| download | openbsd-4e5c7a92843baa574477161a6a1b2df108ba3cde.tar.gz openbsd-4e5c7a92843baa574477161a6a1b2df108ba3cde.tar.bz2 openbsd-4e5c7a92843baa574477161a6a1b2df108ba3cde.zip | |
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 'src/lib/libssl/src')
| -rw-r--r-- | src/lib/libssl/src/crypto/aes/aes_wrap.c | 16 |
1 files changed, 15 insertions, 1 deletions
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) | |||
| 231 | }; | 231 | }; |
| 232 | 232 | ||
| 233 | AES_KEY wctx, xctx; | 233 | AES_KEY wctx, xctx; |
| 234 | int ret; | 234 | int ret, nfailures = 0; |
| 235 | ret = AES_wrap_unwrap_test(kek, 128, NULL, e1, key, 16); | 235 | ret = AES_wrap_unwrap_test(kek, 128, NULL, e1, key, 16); |
| 236 | if (ret == 0) | ||
| 237 | nfailures++; | ||
| 236 | fprintf(stderr, "Key test result %d\n", ret); | 238 | fprintf(stderr, "Key test result %d\n", ret); |
| 237 | ret = AES_wrap_unwrap_test(kek, 192, NULL, e2, key, 16); | 239 | ret = AES_wrap_unwrap_test(kek, 192, NULL, e2, key, 16); |
| 240 | if (ret == 0) | ||
| 241 | nfailures++; | ||
| 238 | fprintf(stderr, "Key test result %d\n", ret); | 242 | fprintf(stderr, "Key test result %d\n", ret); |
| 239 | ret = AES_wrap_unwrap_test(kek, 256, NULL, e3, key, 16); | 243 | ret = AES_wrap_unwrap_test(kek, 256, NULL, e3, key, 16); |
| 244 | if (ret == 0) | ||
| 245 | nfailures++; | ||
| 240 | fprintf(stderr, "Key test result %d\n", ret); | 246 | fprintf(stderr, "Key test result %d\n", ret); |
| 241 | ret = AES_wrap_unwrap_test(kek, 192, NULL, e4, key, 24); | 247 | ret = AES_wrap_unwrap_test(kek, 192, NULL, e4, key, 24); |
| 248 | if (ret == 0) | ||
| 249 | nfailures++; | ||
| 242 | fprintf(stderr, "Key test result %d\n", ret); | 250 | fprintf(stderr, "Key test result %d\n", ret); |
| 243 | ret = AES_wrap_unwrap_test(kek, 256, NULL, e5, key, 24); | 251 | ret = AES_wrap_unwrap_test(kek, 256, NULL, e5, key, 24); |
| 252 | if (ret == 0) | ||
| 253 | nfailures++; | ||
| 244 | fprintf(stderr, "Key test result %d\n", ret); | 254 | fprintf(stderr, "Key test result %d\n", ret); |
| 245 | ret = AES_wrap_unwrap_test(kek, 256, NULL, e6, key, 32); | 255 | ret = AES_wrap_unwrap_test(kek, 256, NULL, e6, key, 32); |
| 256 | if (ret == 0) | ||
| 257 | nfailures++; | ||
| 246 | fprintf(stderr, "Key test result %d\n", ret); | 258 | fprintf(stderr, "Key test result %d\n", ret); |
| 259 | |||
| 260 | return nfailures; | ||
| 247 | } | 261 | } |
| 248 | 262 | ||
| 249 | #endif | 263 | #endif |
