diff options
author | beck <> | 2002-05-15 02:29:21 +0000 |
---|---|---|
committer | beck <> | 2002-05-15 02:29:21 +0000 |
commit | b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 (patch) | |
tree | fa27cf82a1250b64ed3bf5f4a18c7354d470bbcc /src/lib/libcrypto/rsa/rsa_test.c | |
parent | e471e1ea98d673597b182ea85f29e30c97cd08b5 (diff) | |
download | openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.gz openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.bz2 openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.zip |
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_test.c')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_test.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_test.c b/src/lib/libcrypto/rsa/rsa_test.c index e5ae0c1f69..b8b462d33b 100644 --- a/src/lib/libcrypto/rsa/rsa_test.c +++ b/src/lib/libcrypto/rsa/rsa_test.c | |||
@@ -3,12 +3,12 @@ | |||
3 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include <string.h> | 4 | #include <string.h> |
5 | 5 | ||
6 | #include "openssl/e_os.h" | 6 | #include "e_os.h" |
7 | 7 | ||
8 | #include <openssl/crypto.h> | 8 | #include <openssl/crypto.h> |
9 | #include <openssl/err.h> | 9 | #include <openssl/err.h> |
10 | #include <openssl/rand.h> | 10 | #include <openssl/rand.h> |
11 | #ifdef NO_RSA | 11 | #ifdef OPENSSL_NO_RSA |
12 | int main(int argc, char *argv[]) | 12 | int main(int argc, char *argv[]) |
13 | { | 13 | { |
14 | printf("No RSA support\n"); | 14 | printf("No RSA support\n"); |
@@ -16,6 +16,7 @@ int main(int argc, char *argv[]) | |||
16 | } | 16 | } |
17 | #else | 17 | #else |
18 | #include <openssl/rsa.h> | 18 | #include <openssl/rsa.h> |
19 | #include <openssl/engine.h> | ||
19 | 20 | ||
20 | #define SetKey \ | 21 | #define SetKey \ |
21 | key->n = BN_bin2bn(n, sizeof(n)-1, key->n); \ | 22 | key->n = BN_bin2bn(n, sizeof(n)-1, key->n); \ |
@@ -219,10 +220,12 @@ int main(int argc, char *argv[]) | |||
219 | int clen = 0; | 220 | int clen = 0; |
220 | int num; | 221 | int num; |
221 | 222 | ||
223 | CRYPTO_malloc_debug_init(); | ||
224 | CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL); | ||
225 | CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); | ||
226 | |||
222 | RAND_seed(rnd_seed, sizeof rnd_seed); /* or OAEP may fail */ | 227 | RAND_seed(rnd_seed, sizeof rnd_seed); /* or OAEP may fail */ |
223 | 228 | ||
224 | CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); | ||
225 | |||
226 | plen = sizeof(ptext_ex) - 1; | 229 | plen = sizeof(ptext_ex) - 1; |
227 | 230 | ||
228 | for (v = 0; v < 3; v++) | 231 | for (v = 0; v < 3; v++) |
@@ -305,9 +308,10 @@ int main(int argc, char *argv[]) | |||
305 | RSA_free(key); | 308 | RSA_free(key); |
306 | } | 309 | } |
307 | 310 | ||
311 | CRYPTO_cleanup_all_ex_data(); | ||
308 | ERR_remove_state(0); | 312 | ERR_remove_state(0); |
309 | 313 | ||
310 | CRYPTO_mem_leaks_fp(stdout); | 314 | CRYPTO_mem_leaks_fp(stderr); |
311 | 315 | ||
312 | return err; | 316 | return err; |
313 | } | 317 | } |