summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bntest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bntest.c')
-rw-r--r--src/lib/libcrypto/bn/bntest.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/lib/libcrypto/bn/bntest.c b/src/lib/libcrypto/bn/bntest.c
index 8158a67374..3c8c540387 100644
--- a/src/lib/libcrypto/bn/bntest.c
+++ b/src/lib/libcrypto/bn/bntest.c
@@ -68,10 +68,6 @@
68#include <openssl/x509.h> 68#include <openssl/x509.h>
69#include <openssl/err.h> 69#include <openssl/err.h>
70 70
71#ifdef OPENSSL_SYS_WINDOWS
72#include "../bio/bss_file.c"
73#endif
74
75const int num0 = 100; /* number of tests */ 71const int num0 = 100; /* number of tests */
76const int num1 = 50; /* additional tests for some functions */ 72const int num1 = 50; /* additional tests for some functions */
77const int num2 = 5; /* number of tests for slow functions */ 73const int num2 = 5; /* number of tests for slow functions */
@@ -96,11 +92,6 @@ int test_sqrt(BIO *bp,BN_CTX *ctx);
96int rand_neg(void); 92int rand_neg(void);
97static int results=0; 93static int results=0;
98 94
99#ifdef OPENSSL_NO_STDIO
100#define APPS_WIN16
101#include "bss_file.c"
102#endif
103
104static unsigned char lst[]="\xC6\x4F\x43\x04\x2A\xEA\xCA\x6E\x58\x36\x80\x5B\xE8\xC9" 95static unsigned char lst[]="\xC6\x4F\x43\x04\x2A\xEA\xCA\x6E\x58\x36\x80\x5B\xE8\xC9"
105"\x9B\x04\x5D\x48\x36\xC2\xFD\x16\xC9\x64\xF0"; 96"\x9B\x04\x5D\x48\x36\xC2\xFD\x16\xC9\x64\xF0";
106 97
@@ -141,10 +132,10 @@ int main(int argc, char *argv[])
141 132
142 133
143 ctx=BN_CTX_new(); 134 ctx=BN_CTX_new();
144 if (ctx == NULL) exit(1); 135 if (ctx == NULL) EXIT(1);
145 136
146 out=BIO_new(BIO_s_file()); 137 out=BIO_new(BIO_s_file());
147 if (out == NULL) exit(1); 138 if (out == NULL) EXIT(1);
148 if (outfile == NULL) 139 if (outfile == NULL)
149 { 140 {
150 BIO_set_fp(out,stdout,BIO_NOCLOSE); 141 BIO_set_fp(out,stdout,BIO_NOCLOSE);
@@ -154,7 +145,7 @@ int main(int argc, char *argv[])
154 if (!BIO_write_filename(out,outfile)) 145 if (!BIO_write_filename(out,outfile))
155 { 146 {
156 perror(outfile); 147 perror(outfile);
157 exit(1); 148 EXIT(1);
158 } 149 }
159 } 150 }
160 151
@@ -238,14 +229,14 @@ int main(int argc, char *argv[])
238 BIO_free(out); 229 BIO_free(out);
239 230
240/**/ 231/**/
241 exit(0); 232 EXIT(0);
242err: 233err:
243 BIO_puts(out,"1\n"); /* make sure the Perl script fed by bc notices 234 BIO_puts(out,"1\n"); /* make sure the Perl script fed by bc notices
244 * the failure, see test_bn in test/Makefile.ssl*/ 235 * the failure, see test_bn in test/Makefile.ssl*/
245 BIO_flush(out); 236 BIO_flush(out);
246 ERR_load_crypto_strings(); 237 ERR_load_crypto_strings();
247 ERR_print_errors_fp(stderr); 238 ERR_print_errors_fp(stderr);
248 exit(1); 239 EXIT(1);
249 return(1); 240 return(1);
250 } 241 }
251 242
@@ -488,7 +479,7 @@ int test_mul(BIO *bp)
488 BN_CTX *ctx; 479 BN_CTX *ctx;
489 480
490 ctx = BN_CTX_new(); 481 ctx = BN_CTX_new();
491 if (ctx == NULL) exit(1); 482 if (ctx == NULL) EXIT(1);
492 483
493 BN_init(&a); 484 BN_init(&a);
494 BN_init(&b); 485 BN_init(&b);
@@ -726,7 +717,7 @@ int test_mod_mul(BIO *bp, BN_CTX *ctx)
726 while ((l=ERR_get_error())) 717 while ((l=ERR_get_error()))
727 fprintf(stderr,"ERROR:%s\n", 718 fprintf(stderr,"ERROR:%s\n",
728 ERR_error_string(l,NULL)); 719 ERR_error_string(l,NULL));
729 exit(1); 720 EXIT(1);
730 } 721 }
731 if (bp != NULL) 722 if (bp != NULL)
732 { 723 {