format fixes, prototype fixes, const fixesdiff -r1.1.1.1 -r1.2 src/crypto/external/bsd/openssl/dist/crypto/bf/bftest.c
(christos)
--- src/crypto/external/bsd/openssl/dist/crypto/bf/Attic/bftest.c 2009/07/19 23:02:59 1.1.1.1
+++ src/crypto/external/bsd/openssl/dist/crypto/bf/Attic/bftest.c 2011/06/11 16:54:56 1.2
@@ -69,27 +69,27 @@ | @@ -69,27 +69,27 @@ | |||
69 | #ifdef OPENSSL_NO_BF | 69 | #ifdef OPENSSL_NO_BF | |
70 | int main(int argc, char *argv[]) | 70 | int main(int argc, char *argv[]) | |
71 | { | 71 | { | |
72 | printf("No BF support\n"); | 72 | printf("No BF support\n"); | |
73 | return(0); | 73 | return(0); | |
74 | } | 74 | } | |
75 | #else | 75 | #else | |
76 | #include <openssl/blowfish.h> | 76 | #include <openssl/blowfish.h> | |
77 | 77 | |||
78 | #ifdef CHARSET_EBCDIC | 78 | #ifdef CHARSET_EBCDIC | |
79 | #include <openssl/ebcdic.h> | 79 | #include <openssl/ebcdic.h> | |
80 | #endif | 80 | #endif | |
81 | 81 | |||
82 | static char *bf_key[2]={ | 82 | static const char *bf_key[2]={ | |
83 | "abcdefghijklmnopqrstuvwxyz", | 83 | "abcdefghijklmnopqrstuvwxyz", | |
84 | "Who is John Galt?" | 84 | "Who is John Galt?" | |
85 | }; | 85 | }; | |
86 | 86 | |||
87 | /* big endian */ | 87 | /* big endian */ | |
88 | static BF_LONG bf_plain[2][2]={ | 88 | static BF_LONG bf_plain[2][2]={ | |
89 | {0x424c4f57L,0x46495348L}, | 89 | {0x424c4f57L,0x46495348L}, | |
90 | {0xfedcba98L,0x76543210L} | 90 | {0xfedcba98L,0x76543210L} | |
91 | }; | 91 | }; | |
92 | 92 | |||
93 | static BF_LONG bf_cipher[2][2]={ | 93 | static BF_LONG bf_cipher[2][2]={ | |
94 | {0x324ed0feL,0xf413a203L}, | 94 | {0x324ed0feL,0xf413a203L}, | |
95 | {0xcc91732bL,0x8022f684L} | 95 | {0xcc91732bL,0x8022f684L} | |
@@ -361,27 +361,27 @@ static int test(void) | @@ -361,27 +361,27 @@ static int test(void) | |||
361 | unsigned char out[8]; | 361 | unsigned char out[8]; | |
362 | BF_LONG len; | 362 | BF_LONG len; | |
363 | 363 | |||
364 | #ifdef CHARSET_EBCDIC | 364 | #ifdef CHARSET_EBCDIC | |
365 | ebcdic2ascii(cbc_data, cbc_data, strlen(cbc_data)); | 365 | ebcdic2ascii(cbc_data, cbc_data, strlen(cbc_data)); | |
366 | #endif | 366 | #endif | |
367 | 367 | |||
368 | printf("testing blowfish in raw ecb mode\n"); | 368 | printf("testing blowfish in raw ecb mode\n"); | |
369 | for (n=0; n<2; n++) | 369 | for (n=0; n<2; n++) | |
370 | { | 370 | { | |
371 | #ifdef CHARSET_EBCDIC | 371 | #ifdef CHARSET_EBCDIC | |
372 | ebcdic2ascii(bf_key[n], bf_key[n], strlen(bf_key[n])); | 372 | ebcdic2ascii(bf_key[n], bf_key[n], strlen(bf_key[n])); | |
373 | #endif | 373 | #endif | |
374 | BF_set_key(&key,strlen(bf_key[n]),(unsigned char *)bf_key[n]); | 374 | BF_set_key(&key,strlen(bf_key[n]), (const unsigned char *)bf_key[n]); | |
375 | 375 | |||
376 | data[0]=bf_plain[n][0]; | 376 | data[0]=bf_plain[n][0]; | |
377 | data[1]=bf_plain[n][1]; | 377 | data[1]=bf_plain[n][1]; | |
378 | BF_encrypt(data,&key); | 378 | BF_encrypt(data,&key); | |
379 | if (memcmp(&(bf_cipher[n][0]),&(data[0]),8) != 0) | 379 | if (memcmp(&(bf_cipher[n][0]),&(data[0]),8) != 0) | |
380 | { | 380 | { | |
381 | printf("BF_encrypt error encrypting\n"); | 381 | printf("BF_encrypt error encrypting\n"); | |
382 | printf("got :"); | 382 | printf("got :"); | |
383 | for (i=0; i<2; i++) | 383 | for (i=0; i<2; i++) | |
384 | printf("%08lX ",(unsigned long)data[i]); | 384 | printf("%08lX ",(unsigned long)data[i]); | |
385 | printf("\n"); | 385 | printf("\n"); | |
386 | printf("expected:"); | 386 | printf("expected:"); | |
387 | for (i=0; i<2; i++) | 387 | for (i=0; i<2; i++) |
--- src/crypto/external/bsd/openssl/dist/crypto/bn/Attic/bntest.c 2009/12/26 23:31:43 1.1.1.2
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/Attic/bntest.c 2011/06/11 16:54:56 1.2
@@ -117,27 +117,27 @@ int test_gf2m_mod_div(BIO *bp,BN_CTX *ct | @@ -117,27 +117,27 @@ int test_gf2m_mod_div(BIO *bp,BN_CTX *ct | |||
117 | int test_gf2m_mod_exp(BIO *bp,BN_CTX *ctx); | 117 | int test_gf2m_mod_exp(BIO *bp,BN_CTX *ctx); | |
118 | int test_gf2m_mod_sqrt(BIO *bp,BN_CTX *ctx); | 118 | int test_gf2m_mod_sqrt(BIO *bp,BN_CTX *ctx); | |
119 | int test_gf2m_mod_solve_quad(BIO *bp,BN_CTX *ctx); | 119 | int test_gf2m_mod_solve_quad(BIO *bp,BN_CTX *ctx); | |
120 | int test_kron(BIO *bp,BN_CTX *ctx); | 120 | int test_kron(BIO *bp,BN_CTX *ctx); | |
121 | int test_sqrt(BIO *bp,BN_CTX *ctx); | 121 | int test_sqrt(BIO *bp,BN_CTX *ctx); | |
122 | int rand_neg(void); | 122 | int rand_neg(void); | |
123 | static int results=0; | 123 | static int results=0; | |
124 | 124 | |||
125 | static unsigned char lst[]="\xC6\x4F\x43\x04\x2A\xEA\xCA\x6E\x58\x36\x80\x5B\xE8\xC9" | 125 | static unsigned char lst[]="\xC6\x4F\x43\x04\x2A\xEA\xCA\x6E\x58\x36\x80\x5B\xE8\xC9" | |
126 | "\x9B\x04\x5D\x48\x36\xC2\xFD\x16\xC9\x64\xF0"; | 126 | "\x9B\x04\x5D\x48\x36\xC2\xFD\x16\xC9\x64\xF0"; | |
127 | 127 | |||
128 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; | 128 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; | |
129 | 129 | |||
130 | static void message(BIO *out, char *m) | 130 | static void message(BIO *out, const char *m) | |
131 | { | 131 | { | |
132 | fprintf(stderr, "test %s\n", m); | 132 | fprintf(stderr, "test %s\n", m); | |
133 | BIO_puts(out, "print \"test "); | 133 | BIO_puts(out, "print \"test "); | |
134 | BIO_puts(out, m); | 134 | BIO_puts(out, m); | |
135 | BIO_puts(out, "\\n\"\n"); | 135 | BIO_puts(out, "\\n\"\n"); | |
136 | } | 136 | } | |
137 | 137 | |||
138 | int main(int argc, char *argv[]) | 138 | int main(int argc, char *argv[]) | |
139 | { | 139 | { | |
140 | BN_CTX *ctx; | 140 | BN_CTX *ctx; | |
141 | BIO *out; | 141 | BIO *out; | |
142 | char *outfile=NULL; | 142 | char *outfile=NULL; | |
143 | 143 |
--- src/crypto/external/bsd/openssl/dist/crypto/bn/Attic/divtest.c 2011/05/15 23:43:56 1.3
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/Attic/divtest.c 2011/06/11 16:54:56 1.4
@@ -1,24 +1,24 @@ | @@ -1,24 +1,24 @@ | |||
1 | #include <openssl/bn.h> | 1 | #include <openssl/bn.h> | |
2 | #include <openssl/rand.h> | 2 | #include <openssl/rand.h> | |
3 | 3 | |||
4 | static int Rand(void) | 4 | static int Rand(void) | |
5 | { | 5 | { | |
6 | unsigned char x[2]; | 6 | unsigned char x[2]; | |
7 | RAND_pseudo_bytes(x,2); | 7 | RAND_pseudo_bytes(x,2); | |
8 | return (x[0] + 2*x[1]); | 8 | return (x[0] + 2*x[1]); | |
9 | } | 9 | } | |
10 | 10 | |||
11 | static void bug(char *m, BIGNUM *a, BIGNUM *b) | 11 | static void bug(const char *m, BIGNUM *a, BIGNUM *b) | |
12 | { | 12 | { | |
13 | printf("%s!\na=",m); | 13 | printf("%s!\na=",m); | |
14 | BN_print_fp(stdout, a); | 14 | BN_print_fp(stdout, a); | |
15 | printf("\nb="); | 15 | printf("\nb="); | |
16 | BN_print_fp(stdout, b); | 16 | BN_print_fp(stdout, b); | |
17 | printf("\n"); | 17 | printf("\n"); | |
18 | fflush(stdout); | 18 | fflush(stdout); | |
19 | exit(1); | 19 | exit(1); | |
20 | } | 20 | } | |
21 | 21 | |||
22 | int | 22 | int | |
23 | main(int argc, char *argv[]) | 23 | main(int argc, char *argv[]) | |
24 | { | 24 | { |
--- src/crypto/external/bsd/openssl/dist/crypto/cast/Attic/casttest.c 2009/07/19 23:03:26 1.1.1.1
+++ src/crypto/external/bsd/openssl/dist/crypto/cast/Attic/casttest.c 2011/06/11 16:54:57 1.2
@@ -170,27 +170,27 @@ int main(int argc, char *argv[]) | @@ -170,27 +170,27 @@ int main(int argc, char *argv[]) | |||
170 | printf("expected:"); | 170 | printf("expected:"); | |
171 | for (i=0; i<8; i++) | 171 | for (i=0; i<8; i++) | |
172 | printf("%02X ",in[i]); | 172 | printf("%02X ",in[i]); | |
173 | printf("\n"); | 173 | printf("\n"); | |
174 | err=3; | 174 | err=3; | |
175 | } | 175 | } | |
176 | } | 176 | } | |
177 | if (err == 0) | 177 | if (err == 0) | |
178 | printf("ecb cast5 ok\n"); | 178 | printf("ecb cast5 ok\n"); | |
179 | 179 | |||
180 | #ifdef FULL_TEST | 180 | #ifdef FULL_TEST | |
181 | { | 181 | { | |
182 | unsigned char out_a[16],out_b[16]; | 182 | unsigned char out_a[16],out_b[16]; | |
183 | static char *hex="0123456789ABCDEF"; | 183 | static const char *hex="0123456789ABCDEF"; | |
184 | 184 | |||
185 | printf("This test will take some time...."); | 185 | printf("This test will take some time...."); | |
186 | fflush(stdout); | 186 | fflush(stdout); | |
187 | memcpy(out_a,in_a,sizeof(in_a)); | 187 | memcpy(out_a,in_a,sizeof(in_a)); | |
188 | memcpy(out_b,in_b,sizeof(in_b)); | 188 | memcpy(out_b,in_b,sizeof(in_b)); | |
189 | i=1; | 189 | i=1; | |
190 | 190 | |||
191 | for (l=0; l<1000000L; l++) | 191 | for (l=0; l<1000000L; l++) | |
192 | { | 192 | { | |
193 | CAST_set_key(&key_b,16,out_b); | 193 | CAST_set_key(&key_b,16,out_b); | |
194 | CAST_ecb_encrypt(&(out_a[0]),&(out_a[0]),&key_b,CAST_ENCRYPT); | 194 | CAST_ecb_encrypt(&(out_a[0]),&(out_a[0]),&key_b,CAST_ENCRYPT); | |
195 | CAST_ecb_encrypt(&(out_a[8]),&(out_a[8]),&key_b,CAST_ENCRYPT); | 195 | CAST_ecb_encrypt(&(out_a[8]),&(out_a[8]),&key_b,CAST_ENCRYPT); | |
196 | CAST_set_key(&key,16,out_a); | 196 | CAST_set_key(&key,16,out_a); |
--- src/crypto/external/bsd/openssl/dist/crypto/conf/Attic/test.c 2011/05/16 00:08:33 1.3
+++ src/crypto/external/bsd/openssl/dist/crypto/conf/Attic/test.c 2011/06/11 16:54:57 1.4
@@ -56,27 +56,27 @@ | @@ -56,27 +56,27 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] | |
57 | */ | 57 | */ | |
58 | 58 | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> | |
60 | #include <stdlib.h> | 60 | #include <stdlib.h> | |
61 | #include <openssl/conf.h> | 61 | #include <openssl/conf.h> | |
62 | #include <openssl/err.h> | 62 | #include <openssl/err.h> | |
63 | 63 | |||
64 | int | 64 | int | |
65 | main(void) | 65 | main(void) | |
66 | { | 66 | { | |
67 | LHASH_OF(CONF_VALUE) *conf; | 67 | LHASH_OF(CONF_VALUE) *conf; | |
68 | long eline; | 68 | long eline; | |
69 | char *s,*s2; | 69 | char *s; | |
70 | 70 | |||
71 | #ifdef USE_WIN32 | 71 | #ifdef USE_WIN32 | |
72 | CONF_set_default_method(CONF_WIN32); | 72 | CONF_set_default_method(CONF_WIN32); | |
73 | #endif | 73 | #endif | |
74 | conf=CONF_load(NULL,"ssleay.cnf",&eline); | 74 | conf=CONF_load(NULL,"ssleay.cnf",&eline); | |
75 | if (conf == NULL) | 75 | if (conf == NULL) | |
76 | { | 76 | { | |
77 | ERR_load_crypto_strings(); | 77 | ERR_load_crypto_strings(); | |
78 | printf("unable to load configuration, line %ld\n",eline); | 78 | printf("unable to load configuration, line %ld\n",eline); | |
79 | ERR_print_errors_fp(stderr); | 79 | ERR_print_errors_fp(stderr); | |
80 | exit(1); | 80 | exit(1); | |
81 | } | 81 | } | |
82 | lh_stats((_LHASH *)conf,stdout); | 82 | lh_stats((_LHASH *)conf,stdout); |
--- src/crypto/external/bsd/openssl/dist/crypto/des/Attic/destest.c 2009/07/20 20:41:05 1.3
+++ src/crypto/external/bsd/openssl/dist/crypto/des/Attic/destest.c 2011/06/11 16:54:57 1.4
@@ -376,27 +376,27 @@ int main(int argc, char *argv[]) | @@ -376,27 +376,27 @@ int main(int argc, char *argv[]) | |||
376 | &iv3,&iv2,DES_ENCRYPT); | 376 | &iv3,&iv2,DES_ENCRYPT); | |
377 | /* if (memcmp(cbc_out,cbc3_ok, | 377 | /* if (memcmp(cbc_out,cbc3_ok, | |
378 | (unsigned int)(strlen((char *)cbc_data)+1+7)/8*8) != 0) | 378 | (unsigned int)(strlen((char *)cbc_data)+1+7)/8*8) != 0) | |
379 | { | 379 | { | |
380 | printf("DES_ede3_cbc_encrypt encrypt error\n"); | 380 | printf("DES_ede3_cbc_encrypt encrypt error\n"); | |
381 | err=1; | 381 | err=1; | |
382 | } | 382 | } | |
383 | */ | 383 | */ | |
384 | memcpy(iv3,cbc_iv,sizeof(cbc_iv)); | 384 | memcpy(iv3,cbc_iv,sizeof(cbc_iv)); | |
385 | memset(iv2,'\0',sizeof iv2); | 385 | memset(iv2,'\0',sizeof iv2); | |
386 | DES_ede3_cbcm_encrypt(cbc_out,cbc_in,i,&ks,&ks2,&ks3,&iv3,&iv2,DES_DECRYPT); | 386 | DES_ede3_cbcm_encrypt(cbc_out,cbc_in,i,&ks,&ks2,&ks3,&iv3,&iv2,DES_DECRYPT); | |
387 | if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0) | 387 | if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0) | |
388 | { | 388 | { | |
389 | int n; | 389 | unsigned int n; | |
390 | 390 | |||
391 | printf("DES_ede3_cbcm_encrypt decrypt error\n"); | 391 | printf("DES_ede3_cbcm_encrypt decrypt error\n"); | |
392 | for(n=0 ; n < i ; ++n) | 392 | for(n=0 ; n < i ; ++n) | |
393 | printf(" %02x",cbc_data[n]); | 393 | printf(" %02x",cbc_data[n]); | |
394 | printf("\n"); | 394 | printf("\n"); | |
395 | for(n=0 ; n < i ; ++n) | 395 | for(n=0 ; n < i ; ++n) | |
396 | printf(" %02x",cbc_in[n]); | 396 | printf(" %02x",cbc_in[n]); | |
397 | printf("\n"); | 397 | printf("\n"); | |
398 | err=1; | 398 | err=1; | |
399 | } | 399 | } | |
400 | #endif | 400 | #endif | |
401 | 401 | |||
402 | printf("Doing ecb\n"); | 402 | printf("Doing ecb\n"); | |
@@ -525,43 +525,43 @@ int main(int argc, char *argv[]) | @@ -525,43 +525,43 @@ int main(int argc, char *argv[]) | |||
525 | memset(cbc_out,0,40); | 525 | memset(cbc_out,0,40); | |
526 | memset(cbc_in,0,40); | 526 | memset(cbc_in,0,40); | |
527 | i=strlen((char *)cbc_data)+1; | 527 | i=strlen((char *)cbc_data)+1; | |
528 | /* i=((i+7)/8)*8; */ | 528 | /* i=((i+7)/8)*8; */ | |
529 | memcpy(iv3,cbc_iv,sizeof(cbc_iv)); | 529 | memcpy(iv3,cbc_iv,sizeof(cbc_iv)); | |
530 | 530 | |||
531 | DES_ede3_cbc_encrypt(cbc_data,cbc_out,16L,&ks,&ks2,&ks3,&iv3, | 531 | DES_ede3_cbc_encrypt(cbc_data,cbc_out,16L,&ks,&ks2,&ks3,&iv3, | |
532 | DES_ENCRYPT); | 532 | DES_ENCRYPT); | |
533 | DES_ede3_cbc_encrypt(&(cbc_data[16]),&(cbc_out[16]),i-16,&ks,&ks2,&ks3, | 533 | DES_ede3_cbc_encrypt(&(cbc_data[16]),&(cbc_out[16]),i-16,&ks,&ks2,&ks3, | |
534 | &iv3,DES_ENCRYPT); | 534 | &iv3,DES_ENCRYPT); | |
535 | if (memcmp(cbc_out,cbc3_ok, | 535 | if (memcmp(cbc_out,cbc3_ok, | |
536 | (unsigned int)(strlen((char *)cbc_data)+1+7)/8*8) != 0) | 536 | (unsigned int)(strlen((char *)cbc_data)+1+7)/8*8) != 0) | |
537 | { | 537 | { | |
538 | int n; | 538 | unsigned int n; | |
539 | 539 | |||
540 | printf("DES_ede3_cbc_encrypt encrypt error\n"); | 540 | printf("DES_ede3_cbc_encrypt encrypt error\n"); | |
541 | for(n=0 ; n < i ; ++n) | 541 | for(n=0 ; n < i ; ++n) | |
542 | printf(" %02x",cbc_out[n]); | 542 | printf(" %02x",cbc_out[n]); | |
543 | printf("\n"); | 543 | printf("\n"); | |
544 | for(n=0 ; n < i ; ++n) | 544 | for(n=0 ; n < i ; ++n) | |
545 | printf(" %02x",cbc3_ok[n]); | 545 | printf(" %02x",cbc3_ok[n]); | |
546 | printf("\n"); | 546 | printf("\n"); | |
547 | err=1; | 547 | err=1; | |
548 | } | 548 | } | |
549 | 549 | |||
550 | memcpy(iv3,cbc_iv,sizeof(cbc_iv)); | 550 | memcpy(iv3,cbc_iv,sizeof(cbc_iv)); | |
551 | DES_ede3_cbc_encrypt(cbc_out,cbc_in,i,&ks,&ks2,&ks3,&iv3,DES_DECRYPT); | 551 | DES_ede3_cbc_encrypt(cbc_out,cbc_in,i,&ks,&ks2,&ks3,&iv3,DES_DECRYPT); | |
552 | if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0) | 552 | if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0) | |
553 | { | 553 | { | |
554 | int n; | 554 | unsigned int n; | |
555 | 555 | |||
556 | printf("DES_ede3_cbc_encrypt decrypt error\n"); | 556 | printf("DES_ede3_cbc_encrypt decrypt error\n"); | |
557 | for(n=0 ; n < i ; ++n) | 557 | for(n=0 ; n < i ; ++n) | |
558 | printf(" %02x",cbc_data[n]); | 558 | printf(" %02x",cbc_data[n]); | |
559 | printf("\n"); | 559 | printf("\n"); | |
560 | for(n=0 ; n < i ; ++n) | 560 | for(n=0 ; n < i ; ++n) | |
561 | printf(" %02x",cbc_in[n]); | 561 | printf(" %02x",cbc_in[n]); | |
562 | printf("\n"); | 562 | printf("\n"); | |
563 | err=1; | 563 | err=1; | |
564 | } | 564 | } | |
565 | 565 | |||
566 | #ifndef LIBDES_LIT | 566 | #ifndef LIBDES_LIT | |
567 | printf("Doing pcbc\n"); | 567 | printf("Doing pcbc\n"); | |
@@ -818,27 +818,27 @@ plain[8+4], plain[8+5], plain[8+6], plai | @@ -818,27 +818,27 @@ plain[8+4], plain[8+5], plain[8+6], plai | |||
818 | #ifdef OPENSSL_SYS_NETWARE | 818 | #ifdef OPENSSL_SYS_NETWARE | |
819 | if (err) printf("ERROR: %d\n", err); | 819 | if (err) printf("ERROR: %d\n", err); | |
820 | #endif | 820 | #endif | |
821 | printf("\n"); | 821 | printf("\n"); | |
822 | return(err); | 822 | return(err); | |
823 | } | 823 | } | |
824 | 824 | |||
825 | static char *pt(unsigned char *p) | 825 | static char *pt(unsigned char *p) | |
826 | { | 826 | { | |
827 | static char bufs[10][20]; | 827 | static char bufs[10][20]; | |
828 | static int bnum=0; | 828 | static int bnum=0; | |
829 | char *ret; | 829 | char *ret; | |
830 | int i; | 830 | int i; | |
831 | static char *f="0123456789ABCDEF"; | 831 | static const char *f="0123456789ABCDEF"; | |
832 | 832 | |||
833 | ret= &(bufs[bnum++][0]); | 833 | ret= &(bufs[bnum++][0]); | |
834 | bnum%=10; | 834 | bnum%=10; | |
835 | for (i=0; i<8; i++) | 835 | for (i=0; i<8; i++) | |
836 | { | 836 | { | |
837 | ret[i*2]=f[(p[i]>>4)&0xf]; | 837 | ret[i*2]=f[(p[i]>>4)&0xf]; | |
838 | ret[i*2+1]=f[p[i]&0xf]; | 838 | ret[i*2+1]=f[p[i]&0xf]; | |
839 | } | 839 | } | |
840 | ret[16]='\0'; | 840 | ret[16]='\0'; | |
841 | return(ret); | 841 | return(ret); | |
842 | } | 842 | } | |
843 | 843 | |||
844 | #ifndef LIBDES_LIT | 844 | #ifndef LIBDES_LIT |
--- src/crypto/external/bsd/openssl/dist/crypto/ec/Attic/ectest.c 2011/06/05 14:58:41 1.1.1.2
+++ src/crypto/external/bsd/openssl/dist/crypto/ec/Attic/ectest.c 2011/06/11 16:54:57 1.2
@@ -224,27 +224,27 @@ static void group_order_tests(EC_GROUP * | @@ -224,27 +224,27 @@ static void group_order_tests(EC_GROUP * | |||
224 | /* n2 = (1 - order) * (1 + order) */ | 224 | /* n2 = (1 - order) * (1 + order) */ | |
225 | if (!BN_mul(n2, n1, n2, ctx)) ABORT; | 225 | if (!BN_mul(n2, n1, n2, ctx)) ABORT; | |
226 | if(!EC_POINT_mul(group, Q, NULL, P, n2, ctx)) ABORT; | 226 | if(!EC_POINT_mul(group, Q, NULL, P, n2, ctx)) ABORT; | |
227 | if (0 != EC_POINT_cmp(group, Q, P, ctx)) ABORT; | 227 | if (0 != EC_POINT_cmp(group, Q, P, ctx)) ABORT; | |
228 | fprintf(stdout, "ok\n"); | 228 | fprintf(stdout, "ok\n"); | |
229 | EC_POINT_free(P); | 229 | EC_POINT_free(P); | |
230 | EC_POINT_free(Q); | 230 | EC_POINT_free(Q); | |
231 | BN_free(n1); | 231 | BN_free(n1); | |
232 | BN_free(n2); | 232 | BN_free(n2); | |
233 | BN_free(order); | 233 | BN_free(order); | |
234 | BN_CTX_free(ctx); | 234 | BN_CTX_free(ctx); | |
235 | } | 235 | } | |
236 | 236 | |||
237 | static void prime_field_tests() | 237 | static void prime_field_tests(void) | |
238 | { | 238 | { | |
239 | BN_CTX *ctx = NULL; | 239 | BN_CTX *ctx = NULL; | |
240 | BIGNUM *p, *a, *b; | 240 | BIGNUM *p, *a, *b; | |
241 | EC_GROUP *group; | 241 | EC_GROUP *group; | |
242 | EC_GROUP *P_160 = NULL, *P_192 = NULL, *P_224 = NULL, *P_256 = NULL, *P_384 = NULL, *P_521 = NULL; | 242 | EC_GROUP *P_160 = NULL, *P_192 = NULL, *P_224 = NULL, *P_256 = NULL, *P_384 = NULL, *P_521 = NULL; | |
243 | EC_POINT *P, *Q, *R; | 243 | EC_POINT *P, *Q, *R; | |
244 | BIGNUM *x, *y, *z; | 244 | BIGNUM *x, *y, *z; | |
245 | unsigned char buf[100]; | 245 | unsigned char buf[100]; | |
246 | size_t i, len; | 246 | size_t i, len; | |
247 | int k; | 247 | int k; | |
248 | 248 | |||
249 | #if 1 /* optional */ | 249 | #if 1 /* optional */ | |
250 | ctx = BN_CTX_new(); | 250 | ctx = BN_CTX_new(); | |
@@ -767,27 +767,27 @@ static void prime_field_tests() | @@ -767,27 +767,27 @@ static void prime_field_tests() | |||
767 | if (!BN_hex2bn(&p, _p)) ABORT; \ | 767 | if (!BN_hex2bn(&p, _p)) ABORT; \ | |
768 | if (!BN_hex2bn(&a, _a)) ABORT; \ | 768 | if (!BN_hex2bn(&a, _a)) ABORT; \ | |
769 | if (!BN_hex2bn(&b, _b)) ABORT; \ | 769 | if (!BN_hex2bn(&b, _b)) ABORT; \ | |
770 | if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) ABORT; \ | 770 | if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) ABORT; \ | |
771 | CHAR2_CURVE_TEST_INTERNAL(_name, _p, _a, _b, _x, _y, _y_bit, _order, _cof, _degree, _variable) \ | 771 | CHAR2_CURVE_TEST_INTERNAL(_name, _p, _a, _b, _x, _y, _y_bit, _order, _cof, _degree, _variable) \ | |
772 | fprintf(stdout, "verify degree ..."); \ | 772 | fprintf(stdout, "verify degree ..."); \ | |
773 | if (EC_GROUP_get_degree(group) != _degree) ABORT; \ | 773 | if (EC_GROUP_get_degree(group) != _degree) ABORT; \ | |
774 | fprintf(stdout, " ok\n"); \ | 774 | fprintf(stdout, " ok\n"); \ | |
775 | group_order_tests(group); \ | 775 | group_order_tests(group); \ | |
776 | if (!(_variable = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; \ | 776 | if (!(_variable = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; \ | |
777 | if (!EC_GROUP_copy(_variable, group)) ABORT; \ | 777 | if (!EC_GROUP_copy(_variable, group)) ABORT; \ | |
778 | 778 | |||
779 | 779 | |||
780 | static void char2_field_tests() | 780 | static void char2_field_tests(void) | |
781 | { | 781 | { | |
782 | BN_CTX *ctx = NULL; | 782 | BN_CTX *ctx = NULL; | |
783 | BIGNUM *p, *a, *b; | 783 | BIGNUM *p, *a, *b; | |
784 | EC_GROUP *group; | 784 | EC_GROUP *group; | |
785 | EC_GROUP *C2_K163 = NULL, *C2_K233 = NULL, *C2_K283 = NULL, *C2_K409 = NULL, *C2_K571 = NULL; | 785 | EC_GROUP *C2_K163 = NULL, *C2_K233 = NULL, *C2_K283 = NULL, *C2_K409 = NULL, *C2_K571 = NULL; | |
786 | EC_GROUP *C2_B163 = NULL, *C2_B233 = NULL, *C2_B283 = NULL, *C2_B409 = NULL, *C2_B571 = NULL; | 786 | EC_GROUP *C2_B163 = NULL, *C2_B233 = NULL, *C2_B283 = NULL, *C2_B409 = NULL, *C2_B571 = NULL; | |
787 | EC_POINT *P, *Q, *R; | 787 | EC_POINT *P, *Q, *R; | |
788 | BIGNUM *x, *y, *z, *cof; | 788 | BIGNUM *x, *y, *z, *cof; | |
789 | unsigned char buf[100]; | 789 | unsigned char buf[100]; | |
790 | size_t i, len; | 790 | size_t i, len; | |
791 | int k; | 791 | int k; | |
792 | 792 | |||
793 | #if 1 /* optional */ | 793 | #if 1 /* optional */ |
--- src/crypto/external/bsd/openssl/dist/crypto/engine/Attic/enginetest.c 2009/07/19 23:04:00 1.1.1.1
+++ src/crypto/external/bsd/openssl/dist/crypto/engine/Attic/enginetest.c 2011/06/11 16:54:57 1.2
@@ -248,28 +248,28 @@ cleanup_loop: | @@ -248,28 +248,28 @@ cleanup_loop: | |||
248 | printf("\nAbout to empty the engine-type list\n"); | 248 | printf("\nAbout to empty the engine-type list\n"); | |
249 | while((ptr = ENGINE_get_first()) != NULL) | 249 | while((ptr = ENGINE_get_first()) != NULL) | |
250 | { | 250 | { | |
251 | if(!ENGINE_remove(ptr)) | 251 | if(!ENGINE_remove(ptr)) | |
252 | { | 252 | { | |
253 | printf("\nRemove failed!\n"); | 253 | printf("\nRemove failed!\n"); | |
254 | goto end; | 254 | goto end; | |
255 | } | 255 | } | |
256 | ENGINE_free(ptr); | 256 | ENGINE_free(ptr); | |
257 | printf("."); fflush(stdout); | 257 | printf("."); fflush(stdout); | |
258 | } | 258 | } | |
259 | for(loop = 0; loop < 512; loop++) | 259 | for(loop = 0; loop < 512; loop++) | |
260 | { | 260 | { | |
261 | OPENSSL_free((void *)ENGINE_get_id(block[loop])); | 261 | OPENSSL_free((void *)(intptr_t)ENGINE_get_id(block[loop])); | |
262 | OPENSSL_free((void *)ENGINE_get_name(block[loop])); | 262 | OPENSSL_free((void *)(intptr_t)ENGINE_get_name(block[loop])); | |
263 | } | 263 | } | |
264 | printf("\nTests completed happily\n"); | 264 | printf("\nTests completed happily\n"); | |
265 | to_return = 0; | 265 | to_return = 0; | |
266 | end: | 266 | end: | |
267 | if(to_return) | 267 | if(to_return) | |
268 | ERR_print_errors_fp(stderr); | 268 | ERR_print_errors_fp(stderr); | |
269 | if(new_h1) ENGINE_free(new_h1); | 269 | if(new_h1) ENGINE_free(new_h1); | |
270 | if(new_h2) ENGINE_free(new_h2); | 270 | if(new_h2) ENGINE_free(new_h2); | |
271 | if(new_h3) ENGINE_free(new_h3); | 271 | if(new_h3) ENGINE_free(new_h3); | |
272 | if(new_h4) ENGINE_free(new_h4); | 272 | if(new_h4) ENGINE_free(new_h4); | |
273 | for(loop = 0; loop < 512; loop++) | 273 | for(loop = 0; loop < 512; loop++) | |
274 | if(block[loop]) | 274 | if(block[loop]) | |
275 | ENGINE_free(block[loop]); | 275 | ENGINE_free(block[loop]); |
--- src/crypto/external/bsd/openssl/dist/crypto/hmac/Attic/hmactest.c 2009/07/19 23:30:39 1.2
+++ src/crypto/external/bsd/openssl/dist/crypto/hmac/Attic/hmactest.c 2011/06/11 16:54:57 1.3
@@ -71,61 +71,61 @@ int main(int argc, char *argv[]) | @@ -71,61 +71,61 @@ int main(int argc, char *argv[]) | |||
71 | #else | 71 | #else | |
72 | #include <openssl/hmac.h> | 72 | #include <openssl/hmac.h> | |
73 | #ifndef OPENSSL_NO_MD5 | 73 | #ifndef OPENSSL_NO_MD5 | |
74 | #include <openssl/md5.h> | 74 | #include <openssl/md5.h> | |
75 | #endif | 75 | #endif | |
76 | 76 | |||
77 | #ifdef CHARSET_EBCDIC | 77 | #ifdef CHARSET_EBCDIC | |
78 | #include <openssl/ebcdic.h> | 78 | #include <openssl/ebcdic.h> | |
79 | #endif | 79 | #endif | |
80 | 80 | |||
81 | #ifndef OPENSSL_NO_MD5 | 81 | #ifndef OPENSSL_NO_MD5 | |
82 | static struct test_st | 82 | static struct test_st | |
83 | { | 83 | { | |
84 | unsigned char key[16]; | 84 | const unsigned char key[16]; | |
85 | int key_len; | 85 | int key_len; | |
86 | unsigned char data[64]; | 86 | const unsigned char data[64]; | |
87 | int data_len; | 87 | int data_len; | |
88 | unsigned char *digest; | 88 | const unsigned char *digest; | |
89 | } test[4]={ | 89 | } test[4]={ | |
90 | { "", | 90 | { "", | |
91 | 0, | 91 | 0, | |
92 | "More text test vectors to stuff up EBCDIC machines :-)", | 92 | "More text test vectors to stuff up EBCDIC machines :-)", | |
93 | 54, | 93 | 54, | |
94 | (unsigned char *)"e9139d1e6ee064ef8cf514fc7dc83e86", | 94 | (const unsigned char *)"e9139d1e6ee064ef8cf514fc7dc83e86", | |
95 | },{ {0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b, | 95 | },{ {0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b, | |
96 | 0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,}, | 96 | 0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,}, | |
97 | 16, | 97 | 16, | |
98 | "Hi There", | 98 | "Hi There", | |
99 | 8, | 99 | 8, | |
100 | (unsigned char *)"9294727a3638bb1c13f48ef8158bfc9d", | 100 | (const unsigned char *)"9294727a3638bb1c13f48ef8158bfc9d", | |
101 | },{ "Jefe", | 101 | },{ "Jefe", | |
102 | 4, | 102 | 4, | |
103 | "what do ya want for nothing?", | 103 | "what do ya want for nothing?", | |
104 | 28, | 104 | 28, | |
105 | (unsigned char *)"750c783e6ab0b503eaa86e310a5db738", | 105 | (const unsigned char *)"750c783e6ab0b503eaa86e310a5db738", | |
106 | },{ | 106 | },{ | |
107 | {0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa, | 107 | {0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa, | |
108 | 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,}, | 108 | 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,}, | |
109 | 16, | 109 | 16, | |
110 | {0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | 110 | {0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | |
111 | 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | 111 | 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | |
112 | 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | 112 | 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | |
113 | 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | 113 | 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | |
114 | 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | 114 | 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | |
115 | 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | 115 | 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, | |
116 | 0xdd,0xdd}, | 116 | 0xdd,0xdd}, | |
117 | 50, | 117 | 50, | |
118 | (unsigned char *)"56be34521d144c88dbb8c733f0e8b3f6", | 118 | (const unsigned char *)"56be34521d144c88dbb8c733f0e8b3f6", | |
119 | }, | 119 | }, | |
120 | }; | 120 | }; | |
121 | #endif | 121 | #endif | |
122 | 122 | |||
123 | static char *pt(unsigned char *md); | 123 | static char *pt(unsigned char *md); | |
124 | int main(int argc, char *argv[]) | 124 | int main(int argc, char *argv[]) | |
125 | { | 125 | { | |
126 | #ifndef OPENSSL_NO_MD5 | 126 | #ifndef OPENSSL_NO_MD5 | |
127 | int i; | 127 | int i; | |
128 | char *p; | 128 | char *p; | |
129 | #endif | 129 | #endif | |
130 | int err=0; | 130 | int err=0; | |
131 | 131 | |||
@@ -137,27 +137,27 @@ int main(int argc, char *argv[]) | @@ -137,27 +137,27 @@ int main(int argc, char *argv[]) | |||
137 | ebcdic2ascii(test[0].data, test[0].data, test[0].data_len); | 137 | ebcdic2ascii(test[0].data, test[0].data, test[0].data_len); | |
138 | ebcdic2ascii(test[1].data, test[1].data, test[1].data_len); | 138 | ebcdic2ascii(test[1].data, test[1].data, test[1].data_len); | |
139 | ebcdic2ascii(test[2].key, test[2].key, test[2].key_len); | 139 | ebcdic2ascii(test[2].key, test[2].key, test[2].key_len); | |
140 | ebcdic2ascii(test[2].data, test[2].data, test[2].data_len); | 140 | ebcdic2ascii(test[2].data, test[2].data, test[2].data_len); | |
141 | #endif | 141 | #endif | |
142 | 142 | |||
143 | for (i=0; i<4; i++) | 143 | for (i=0; i<4; i++) | |
144 | { | 144 | { | |
145 | p=pt(HMAC(EVP_md5(), | 145 | p=pt(HMAC(EVP_md5(), | |
146 | test[i].key, test[i].key_len, | 146 | test[i].key, test[i].key_len, | |
147 | test[i].data, test[i].data_len, | 147 | test[i].data, test[i].data_len, | |
148 | NULL,NULL)); | 148 | NULL,NULL)); | |
149 | 149 | |||
150 | if (strcmp(p,(char *)test[i].digest) != 0) | 150 | if (strcmp(p,(const char *)test[i].digest) != 0) | |
151 | { | 151 | { | |
152 | printf("error calculating HMAC on %d entry'\n",i); | 152 | printf("error calculating HMAC on %d entry'\n",i); | |
153 | printf("got %s instead of %s\n",p,test[i].digest); | 153 | printf("got %s instead of %s\n",p,test[i].digest); | |
154 | err++; | 154 | err++; | |
155 | } | 155 | } | |
156 | else | 156 | else | |
157 | printf("test %d ok\n",i); | 157 | printf("test %d ok\n",i); | |
158 | } | 158 | } | |
159 | #endif /* OPENSSL_NO_MD5 */ | 159 | #endif /* OPENSSL_NO_MD5 */ | |
160 | EXIT(err); | 160 | EXIT(err); | |
161 | return(0); | 161 | return(0); | |
162 | } | 162 | } | |
163 | 163 |
--- src/crypto/external/bsd/openssl/dist/crypto/md2/Attic/md2test.c 2009/07/20 20:41:05 1.3
+++ src/crypto/external/bsd/openssl/dist/crypto/md2/Attic/md2test.c 2011/06/11 16:54:57 1.4
@@ -66,61 +66,61 @@ | @@ -66,61 +66,61 @@ | |||
66 | int main(int argc, char *argv[]) | 66 | int main(int argc, char *argv[]) | |
67 | { | 67 | { | |
68 | printf("No MD2 support\n"); | 68 | printf("No MD2 support\n"); | |
69 | return(0); | 69 | return(0); | |
70 | } | 70 | } | |
71 | #else | 71 | #else | |
72 | #include <openssl/evp.h> | 72 | #include <openssl/evp.h> | |
73 | #include <openssl/md2.h> | 73 | #include <openssl/md2.h> | |
74 | 74 | |||
75 | #ifdef CHARSET_EBCDIC | 75 | #ifdef CHARSET_EBCDIC | |
76 | #include <openssl/ebcdic.h> | 76 | #include <openssl/ebcdic.h> | |
77 | #endif | 77 | #endif | |
78 | 78 | |||
79 | static char *test[]={ | 79 | static const char *test[]={ | |
80 | "", | 80 | "", | |
81 | "a", | 81 | "a", | |
82 | "abc", | 82 | "abc", | |
83 | "message digest", | 83 | "message digest", | |
84 | "abcdefghijklmnopqrstuvwxyz", | 84 | "abcdefghijklmnopqrstuvwxyz", | |
85 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | 85 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | |
86 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890", | 86 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890", | |
87 | NULL, | 87 | NULL, | |
88 | }; | 88 | }; | |
89 | 89 | |||
90 | static char *ret[]={ | 90 | static const char *ret[]={ | |
91 | "8350e5a3e24c153df2275c9f80692773", | 91 | "8350e5a3e24c153df2275c9f80692773", | |
92 | "32ec01ec4a6dac72c0ab96fb34c0b5d1", | 92 | "32ec01ec4a6dac72c0ab96fb34c0b5d1", | |
93 | "da853b0d3f88d99b30283a69e6ded6bb", | 93 | "da853b0d3f88d99b30283a69e6ded6bb", | |
94 | "ab4f496bfb2a530b219ff33031fe06b0", | 94 | "ab4f496bfb2a530b219ff33031fe06b0", | |
95 | "4e8ddff3650292ab5a4108c3aa47940b", | 95 | "4e8ddff3650292ab5a4108c3aa47940b", | |
96 | "da33def2a42df13975352846c30338cd", | 96 | "da33def2a42df13975352846c30338cd", | |
97 | "d5976f79d83d3a0dc9806c3c66f3efd8", | 97 | "d5976f79d83d3a0dc9806c3c66f3efd8", | |
98 | }; | 98 | }; | |
99 | 99 | |||
100 | static char *pt(unsigned char *md); | 100 | static char *pt(unsigned char *md); | |
101 | int main(int argc, char *argv[]) | 101 | int main(int argc, char *argv[]) | |
102 | { | 102 | { | |
103 | int i,err=0; | 103 | int i,err=0; | |
104 | char **P,**R; | 104 | const char **P,**R; | |
105 | char *p; | 105 | char *p; | |
106 | unsigned char md[MD2_DIGEST_LENGTH]; | 106 | unsigned char md[MD2_DIGEST_LENGTH]; | |
107 | 107 | |||
108 | P=test; | 108 | P=test; | |
109 | R=ret; | 109 | R=ret; | |
110 | i=1; | 110 | i=1; | |
111 | while (*P != NULL) | 111 | while (*P != NULL) | |
112 | { | 112 | { | |
113 | EVP_Digest((unsigned char *)*P,strlen(*P),md,NULL,EVP_md2(), NULL); | 113 | EVP_Digest((const unsigned char *)*P,strlen(*P),md,NULL,EVP_md2(), NULL); | |
114 | p=pt(md); | 114 | p=pt(md); | |
115 | if (strcmp(p,*R) != 0) | 115 | if (strcmp(p,*R) != 0) | |
116 | { | 116 | { | |
117 | printf("error calculating MD2 on '%s'\n",*P); | 117 | printf("error calculating MD2 on '%s'\n",*P); | |
118 | printf("got %s instead of %s\n",p,*R); | 118 | printf("got %s instead of %s\n",p,*R); | |
119 | err++; | 119 | err++; | |
120 | } | 120 | } | |
121 | else | 121 | else | |
122 | printf("test %d ok\n",i); | 122 | printf("test %d ok\n",i); | |
123 | i++; | 123 | i++; | |
124 | R++; | 124 | R++; | |
125 | P++; | 125 | P++; | |
126 | } | 126 | } |
--- src/crypto/external/bsd/openssl/dist/crypto/md4/Attic/md4test.c 2009/07/19 23:30:40 1.2
+++ src/crypto/external/bsd/openssl/dist/crypto/md4/Attic/md4test.c 2011/06/11 16:54:57 1.3
@@ -62,63 +62,63 @@ | @@ -62,63 +62,63 @@ | |||
62 | 62 | |||
63 | #include "../e_os.h" | 63 | #include "../e_os.h" | |
64 | 64 | |||
65 | #ifdef OPENSSL_NO_MD4 | 65 | #ifdef OPENSSL_NO_MD4 | |
66 | int main(int argc, char *argv[]) | 66 | int main(int argc, char *argv[]) | |
67 | { | 67 | { | |
68 | printf("No MD4 support\n"); | 68 | printf("No MD4 support\n"); | |
69 | return(0); | 69 | return(0); | |
70 | } | 70 | } | |
71 | #else | 71 | #else | |
72 | #include <openssl/evp.h> | 72 | #include <openssl/evp.h> | |
73 | #include <openssl/md4.h> | 73 | #include <openssl/md4.h> | |
74 | 74 | |||
75 | static char *test[]={ | 75 | static const char *test[]={ | |
76 | "", | 76 | "", | |
77 | "a", | 77 | "a", | |
78 | "abc", | 78 | "abc", | |
79 | "message digest", | 79 | "message digest", | |
80 | "abcdefghijklmnopqrstuvwxyz", | 80 | "abcdefghijklmnopqrstuvwxyz", | |
81 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | 81 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | |
82 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890", | 82 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890", | |
83 | NULL, | 83 | NULL, | |
84 | }; | 84 | }; | |
85 | 85 | |||
86 | static char *ret[]={ | 86 | static const char *ret[]={ | |
87 | "31d6cfe0d16ae931b73c59d7e0c089c0", | 87 | "31d6cfe0d16ae931b73c59d7e0c089c0", | |
88 | "bde52cb31de33e46245e05fbdbd6fb24", | 88 | "bde52cb31de33e46245e05fbdbd6fb24", | |
89 | "a448017aaf21d8525fc10ae87aa6729d", | 89 | "a448017aaf21d8525fc10ae87aa6729d", | |
90 | "d9130a8164549fe818874806e1c7014b", | 90 | "d9130a8164549fe818874806e1c7014b", | |
91 | "d79e1c308aa5bbcdeea8ed63df412da9", | 91 | "d79e1c308aa5bbcdeea8ed63df412da9", | |
92 | "043f8582f241db351ce627e153e7f0e4", | 92 | "043f8582f241db351ce627e153e7f0e4", | |
93 | "e33b4ddc9c38f2199c3e7b164fcc0536", | 93 | "e33b4ddc9c38f2199c3e7b164fcc0536", | |
94 | }; | 94 | }; | |
95 | 95 | |||
96 | static char *pt(unsigned char *md); | 96 | static char *pt(unsigned char *md); | |
97 | int main(int argc, char *argv[]) | 97 | int main(int argc, char *argv[]) | |
98 | { | 98 | { | |
99 | int i,err=0; | 99 | int i,err=0; | |
100 | char **P,**R; | 100 | const char **P,**R; | |
101 | char *p; | 101 | char *p; | |
102 | unsigned char md[MD4_DIGEST_LENGTH]; | 102 | unsigned char md[MD4_DIGEST_LENGTH]; | |
103 | 103 | |||
104 | P=test; | 104 | P=test; | |
105 | R=ret; | 105 | R=ret; | |
106 | i=1; | 106 | i=1; | |
107 | while (*P != NULL) | 107 | while (*P != NULL) | |
108 | { | 108 | { | |
109 | EVP_Digest(&(P[0][0]),strlen((char *)*P),md,NULL,EVP_md4(), NULL); | 109 | EVP_Digest(&(P[0][0]),strlen((const char *)*P),md,NULL,EVP_md4(), NULL); | |
110 | p=pt(md); | 110 | p=pt(md); | |
111 | if (strcmp(p,(char *)*R) != 0) | 111 | if (strcmp(p,(const char *)*R) != 0) | |
112 | { | 112 | { | |
113 | printf("error calculating MD4 on '%s'\n",*P); | 113 | printf("error calculating MD4 on '%s'\n",*P); | |
114 | printf("got %s instead of %s\n",p,*R); | 114 | printf("got %s instead of %s\n",p,*R); | |
115 | err++; | 115 | err++; | |
116 | } | 116 | } | |
117 | else | 117 | else | |
118 | printf("test %d ok\n",i); | 118 | printf("test %d ok\n",i); | |
119 | i++; | 119 | i++; | |
120 | R++; | 120 | R++; | |
121 | P++; | 121 | P++; | |
122 | } | 122 | } | |
123 | EXIT(err); | 123 | EXIT(err); | |
124 | return(0); | 124 | return(0); |
--- src/crypto/external/bsd/openssl/dist/crypto/md5/Attic/md5test.c 2009/07/19 23:30:40 1.2
+++ src/crypto/external/bsd/openssl/dist/crypto/md5/Attic/md5test.c 2011/06/11 16:54:57 1.3
@@ -62,63 +62,63 @@ | @@ -62,63 +62,63 @@ | |||
62 | 62 | |||
63 | #include "../e_os.h" | 63 | #include "../e_os.h" | |
64 | 64 | |||
65 | #ifdef OPENSSL_NO_MD5 | 65 | #ifdef OPENSSL_NO_MD5 | |
66 | int main(int argc, char *argv[]) | 66 | int main(int argc, char *argv[]) | |
67 | { | 67 | { | |
68 | printf("No MD5 support\n"); | 68 | printf("No MD5 support\n"); | |
69 | return(0); | 69 | return(0); | |
70 | } | 70 | } | |
71 | #else | 71 | #else | |
72 | #include <openssl/evp.h> | 72 | #include <openssl/evp.h> | |
73 | #include <openssl/md5.h> | 73 | #include <openssl/md5.h> | |
74 | 74 | |||
75 | static char *test[]={ | 75 | static const char *test[]={ | |
76 | "", | 76 | "", | |
77 | "a", | 77 | "a", | |
78 | "abc", | 78 | "abc", | |
79 | "message digest", | 79 | "message digest", | |
80 | "abcdefghijklmnopqrstuvwxyz", | 80 | "abcdefghijklmnopqrstuvwxyz", | |
81 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | 81 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | |
82 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890", | 82 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890", | |
83 | NULL, | 83 | NULL, | |
84 | }; | 84 | }; | |
85 | 85 | |||
86 | static char *ret[]={ | 86 | static const char *ret[]={ | |
87 | "d41d8cd98f00b204e9800998ecf8427e", | 87 | "d41d8cd98f00b204e9800998ecf8427e", | |
88 | "0cc175b9c0f1b6a831c399e269772661", | 88 | "0cc175b9c0f1b6a831c399e269772661", | |
89 | "900150983cd24fb0d6963f7d28e17f72", | 89 | "900150983cd24fb0d6963f7d28e17f72", | |
90 | "f96b697d7cb7938d525a2f31aaf161d0", | 90 | "f96b697d7cb7938d525a2f31aaf161d0", | |
91 | "c3fcd3d76192e4007dfb496cca67e13b", | 91 | "c3fcd3d76192e4007dfb496cca67e13b", | |
92 | "d174ab98d277d9f5a5611c2c9f419d9f", | 92 | "d174ab98d277d9f5a5611c2c9f419d9f", | |
93 | "57edf4a22be3c955ac49da2e2107b67a", | 93 | "57edf4a22be3c955ac49da2e2107b67a", | |
94 | }; | 94 | }; | |
95 | 95 | |||
96 | static char *pt(unsigned char *md); | 96 | static char *pt(unsigned char *md); | |
97 | int main(int argc, char *argv[]) | 97 | int main(int argc, char *argv[]) | |
98 | { | 98 | { | |
99 | int i,err=0; | 99 | int i,err=0; | |
100 | char **P,**R; | 100 | const char **P,**R; | |
101 | char *p; | 101 | char *p; | |
102 | unsigned char md[MD5_DIGEST_LENGTH]; | 102 | unsigned char md[MD5_DIGEST_LENGTH]; | |
103 | 103 | |||
104 | P=test; | 104 | P=test; | |
105 | R=ret; | 105 | R=ret; | |
106 | i=1; | 106 | i=1; | |
107 | while (*P != NULL) | 107 | while (*P != NULL) | |
108 | { | 108 | { | |
109 | EVP_Digest(&(P[0][0]),strlen((char *)*P),md,NULL,EVP_md5(), NULL); | 109 | EVP_Digest(&(P[0][0]),strlen((const char *)*P),md,NULL,EVP_md5(), NULL); | |
110 | p=pt(md); | 110 | p=pt(md); | |
111 | if (strcmp(p,(char *)*R) != 0) | 111 | if (strcmp(p,(const char *)*R) != 0) | |
112 | { | 112 | { | |
113 | printf("error calculating MD5 on '%s'\n",*P); | 113 | printf("error calculating MD5 on '%s'\n",*P); | |
114 | printf("got %s instead of %s\n",p,*R); | 114 | printf("got %s instead of %s\n",p,*R); | |
115 | err++; | 115 | err++; | |
116 | } | 116 | } | |
117 | else | 117 | else | |
118 | printf("test %d ok\n",i); | 118 | printf("test %d ok\n",i); | |
119 | i++; | 119 | i++; | |
120 | R++; | 120 | R++; | |
121 | P++; | 121 | P++; | |
122 | } | 122 | } | |
123 | 123 | |||
124 | #ifdef OPENSSL_SYS_NETWARE | 124 | #ifdef OPENSSL_SYS_NETWARE |
--- src/crypto/external/bsd/openssl/dist/crypto/ripemd/Attic/rmdtest.c 2009/07/19 23:30:41 1.2
+++ src/crypto/external/bsd/openssl/dist/crypto/ripemd/Attic/rmdtest.c 2011/06/11 16:54:58 1.3
@@ -66,68 +66,68 @@ | @@ -66,68 +66,68 @@ | |||
66 | int main(int argc, char *argv[]) | 66 | int main(int argc, char *argv[]) | |
67 | { | 67 | { | |
68 | printf("No ripemd support\n"); | 68 | printf("No ripemd support\n"); | |
69 | return(0); | 69 | return(0); | |
70 | } | 70 | } | |
71 | #else | 71 | #else | |
72 | #include <openssl/ripemd.h> | 72 | #include <openssl/ripemd.h> | |
73 | #include <openssl/evp.h> | 73 | #include <openssl/evp.h> | |
74 | 74 | |||
75 | #ifdef CHARSET_EBCDIC | 75 | #ifdef CHARSET_EBCDIC | |
76 | #include <openssl/ebcdic.h> | 76 | #include <openssl/ebcdic.h> | |
77 | #endif | 77 | #endif | |
78 | 78 | |||
79 | static char *test[]={ | 79 | static const char *test[]={ | |
80 | "", | 80 | "", | |
81 | "a", | 81 | "a", | |
82 | "abc", | 82 | "abc", | |
83 | "message digest", | 83 | "message digest", | |
84 | "abcdefghijklmnopqrstuvwxyz", | 84 | "abcdefghijklmnopqrstuvwxyz", | |
85 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", | 85 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", | |
86 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | 86 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | |
87 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890", | 87 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890", | |
88 | NULL, | 88 | NULL, | |
89 | }; | 89 | }; | |
90 | 90 | |||
91 | static char *ret[]={ | 91 | static const char *ret[]={ | |
92 | "9c1185a5c5e9fc54612808977ee8f548b2258d31", | 92 | "9c1185a5c5e9fc54612808977ee8f548b2258d31", | |
93 | "0bdc9d2d256b3ee9daae347be6f4dc835a467ffe", | 93 | "0bdc9d2d256b3ee9daae347be6f4dc835a467ffe", | |
94 | "8eb208f7e05d987a9b044a8e98c6b087f15a0bfc", | 94 | "8eb208f7e05d987a9b044a8e98c6b087f15a0bfc", | |
95 | "5d0689ef49d2fae572b881b123a85ffa21595f36", | 95 | "5d0689ef49d2fae572b881b123a85ffa21595f36", | |
96 | "f71c27109c692c1b56bbdceb5b9d2865b3708dbc", | 96 | "f71c27109c692c1b56bbdceb5b9d2865b3708dbc", | |
97 | "12a053384a9c0c88e405a06c27dcf49ada62eb2b", | 97 | "12a053384a9c0c88e405a06c27dcf49ada62eb2b", | |
98 | "b0e20b6e3116640286ed3a87a5713079b21f5189", | 98 | "b0e20b6e3116640286ed3a87a5713079b21f5189", | |
99 | "9b752e45573d4b39f4dbd3323cab82bf63326bfb", | 99 | "9b752e45573d4b39f4dbd3323cab82bf63326bfb", | |
100 | }; | 100 | }; | |
101 | 101 | |||
102 | static char *pt(unsigned char *md); | 102 | static char *pt(unsigned char *md); | |
103 | int main(int argc, char *argv[]) | 103 | int main(int argc, char *argv[]) | |
104 | { | 104 | { | |
105 | int i,err=0; | 105 | int i,err=0; | |
106 | char **P,**R; | 106 | const char **P,**R; | |
107 | char *p; | 107 | char *p; | |
108 | unsigned char md[RIPEMD160_DIGEST_LENGTH]; | 108 | unsigned char md[RIPEMD160_DIGEST_LENGTH]; | |
109 | 109 | |||
110 | P=test; | 110 | P=test; | |
111 | R=ret; | 111 | R=ret; | |
112 | i=1; | 112 | i=1; | |
113 | while (*P != NULL) | 113 | while (*P != NULL) | |
114 | { | 114 | { | |
115 | #ifdef CHARSET_EBCDIC | 115 | #ifdef CHARSET_EBCDIC | |
116 | ebcdic2ascii((char *)*P, (char *)*P, strlen((char *)*P)); | 116 | ebcdic2ascii((const char *)*P, (const char *)*P, strlen((const char *)*P)); | |
117 | #endif | 117 | #endif | |
118 | EVP_Digest(&(P[0][0]),strlen((char *)*P),md,NULL,EVP_ripemd160(), NULL); | 118 | EVP_Digest(&(P[0][0]),strlen((const char *)*P),md,NULL,EVP_ripemd160(), NULL); | |
119 | p=pt(md); | 119 | p=pt(md); | |
120 | if (strcmp(p,(char *)*R) != 0) | 120 | if (strcmp(p,(const char *)*R) != 0) | |
121 | { | 121 | { | |
122 | printf("error calculating RIPEMD160 on '%s'\n",*P); | 122 | printf("error calculating RIPEMD160 on '%s'\n",*P); | |
123 | printf("got %s instead of %s\n",p,*R); | 123 | printf("got %s instead of %s\n",p,*R); | |
124 | err++; | 124 | err++; | |
125 | } | 125 | } | |
126 | else | 126 | else | |
127 | printf("test %d ok\n",i); | 127 | printf("test %d ok\n",i); | |
128 | i++; | 128 | i++; | |
129 | R++; | 129 | R++; | |
130 | P++; | 130 | P++; | |
131 | } | 131 | } | |
132 | EXIT(err); | 132 | EXIT(err); | |
133 | return(0); | 133 | return(0); |
--- src/crypto/external/bsd/openssl/dist/crypto/sha/Attic/sha1test.c 2009/07/19 23:30:41 1.2
+++ src/crypto/external/bsd/openssl/dist/crypto/sha/Attic/sha1test.c 2011/06/11 16:54:58 1.3
@@ -69,73 +69,73 @@ int main(int argc, char *argv[]) | @@ -69,73 +69,73 @@ int main(int argc, char *argv[]) | |||
69 | return(0); | 69 | return(0); | |
70 | } | 70 | } | |
71 | #else | 71 | #else | |
72 | #include <openssl/evp.h> | 72 | #include <openssl/evp.h> | |
73 | #include <openssl/sha.h> | 73 | #include <openssl/sha.h> | |
74 | 74 | |||
75 | #ifdef CHARSET_EBCDIC | 75 | #ifdef CHARSET_EBCDIC | |
76 | #include <openssl/ebcdic.h> | 76 | #include <openssl/ebcdic.h> | |
77 | #endif | 77 | #endif | |
78 | 78 | |||
79 | #undef SHA_0 /* FIPS 180 */ | 79 | #undef SHA_0 /* FIPS 180 */ | |
80 | #define SHA_1 /* FIPS 180-1 */ | 80 | #define SHA_1 /* FIPS 180-1 */ | |
81 | 81 | |||
82 | static char *test[]={ | 82 | static const char *test[]={ | |
83 | "abc", | 83 | "abc", | |
84 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", | 84 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", | |
85 | NULL, | 85 | NULL, | |
86 | }; | 86 | }; | |
87 | 87 | |||
88 | #ifdef SHA_0 | 88 | #ifdef SHA_0 | |
89 | static char *ret[]={ | 89 | static const char *ret[]={ | |
90 | "0164b8a914cd2a5e74c4f7ff082c4d97f1edf880", | 90 | "0164b8a914cd2a5e74c4f7ff082c4d97f1edf880", | |
91 | "d2516ee1acfa5baf33dfc1c471e438449ef134c8", | 91 | "d2516ee1acfa5baf33dfc1c471e438449ef134c8", | |
92 | }; | 92 | }; | |
93 | static char *bigret= | 93 | static const char *bigret= | |
94 | "3232affa48628a26653b5aaa44541fd90d690603"; | 94 | "3232affa48628a26653b5aaa44541fd90d690603"; | |
95 | #endif | 95 | #endif | |
96 | #ifdef SHA_1 | 96 | #ifdef SHA_1 | |
97 | static char *ret[]={ | 97 | static const char *ret[]={ | |
98 | "a9993e364706816aba3e25717850c26c9cd0d89d", | 98 | "a9993e364706816aba3e25717850c26c9cd0d89d", | |
99 | "84983e441c3bd26ebaae4aa1f95129e5e54670f1", | 99 | "84983e441c3bd26ebaae4aa1f95129e5e54670f1", | |
100 | }; | 100 | }; | |
101 | static char *bigret= | 101 | static const char *bigret= | |
102 | "34aa973cd4c4daa4f61eeb2bdbad27316534016f"; | 102 | "34aa973cd4c4daa4f61eeb2bdbad27316534016f"; | |
103 | #endif | 103 | #endif | |
104 | 104 | |||
105 | static char *pt(unsigned char *md); | 105 | static char *pt(unsigned char *md); | |
106 | int main(int argc, char *argv[]) | 106 | int main(int argc, char *argv[]) | |
107 | { | 107 | { | |
108 | int i,err=0; | 108 | int i,err=0; | |
109 | char **P,**R; | 109 | const char **P,**R; | |
110 | static unsigned char buf[1000]; | 110 | static unsigned char buf[1000]; | |
111 | char *p,*r; | 111 | const char *p,*r; | |
112 | EVP_MD_CTX c; | 112 | EVP_MD_CTX c; | |
113 | unsigned char md[SHA_DIGEST_LENGTH]; | 113 | unsigned char md[SHA_DIGEST_LENGTH]; | |
114 | 114 | |||
115 | #ifdef CHARSET_EBCDIC | 115 | #ifdef CHARSET_EBCDIC | |
116 | ebcdic2ascii(test[0], test[0], strlen(test[0])); | 116 | ebcdic2ascii(test[0], test[0], strlen(test[0])); | |
117 | ebcdic2ascii(test[1], test[1], strlen(test[1])); | 117 | ebcdic2ascii(test[1], test[1], strlen(test[1])); | |
118 | #endif | 118 | #endif | |
119 | 119 | |||
120 | EVP_MD_CTX_init(&c); | 120 | EVP_MD_CTX_init(&c); | |
121 | P=test; | 121 | P=test; | |
122 | R=ret; | 122 | R=ret; | |
123 | i=1; | 123 | i=1; | |
124 | while (*P != NULL) | 124 | while (*P != NULL) | |
125 | { | 125 | { | |
126 | EVP_Digest(*P,strlen((char *)*P),md,NULL,EVP_sha1(), NULL); | 126 | EVP_Digest(*P,strlen((const char *)*P),md,NULL,EVP_sha1(), NULL); | |
127 | p=pt(md); | 127 | p=pt(md); | |
128 | if (strcmp(p,(char *)*R) != 0) | 128 | if (strcmp(p,(const char *)*R) != 0) | |
129 | { | 129 | { | |
130 | printf("error calculating SHA1 on '%s'\n",*P); | 130 | printf("error calculating SHA1 on '%s'\n",*P); | |
131 | printf("got %s instead of %s\n",p,*R); | 131 | printf("got %s instead of %s\n",p,*R); | |
132 | err++; | 132 | err++; | |
133 | } | 133 | } | |
134 | else | 134 | else | |
135 | printf("test %d ok\n",i); | 135 | printf("test %d ok\n",i); | |
136 | i++; | 136 | i++; | |
137 | R++; | 137 | R++; | |
138 | P++; | 138 | P++; | |
139 | } | 139 | } | |
140 | 140 | |||
141 | memset(buf,'a',1000); | 141 | memset(buf,'a',1000); |
--- src/crypto/external/bsd/openssl/dist/crypto/sha/Attic/shatest.c 2009/07/19 23:30:42 1.2
+++ src/crypto/external/bsd/openssl/dist/crypto/sha/Attic/shatest.c 2011/06/11 16:54:58 1.3
@@ -69,56 +69,56 @@ int main(int argc, char *argv[]) | @@ -69,56 +69,56 @@ int main(int argc, char *argv[]) | |||
69 | return(0); | 69 | return(0); | |
70 | } | 70 | } | |
71 | #else | 71 | #else | |
72 | #include <openssl/evp.h> | 72 | #include <openssl/evp.h> | |
73 | #include <openssl/sha.h> | 73 | #include <openssl/sha.h> | |
74 | 74 | |||
75 | #ifdef CHARSET_EBCDIC | 75 | #ifdef CHARSET_EBCDIC | |
76 | #include <openssl/ebcdic.h> | 76 | #include <openssl/ebcdic.h> | |
77 | #endif | 77 | #endif | |
78 | 78 | |||
79 | #define SHA_0 /* FIPS 180 */ | 79 | #define SHA_0 /* FIPS 180 */ | |
80 | #undef SHA_1 /* FIPS 180-1 */ | 80 | #undef SHA_1 /* FIPS 180-1 */ | |
81 | 81 | |||
82 | static char *test[]={ | 82 | static const char *test[]={ | |
83 | "abc", | 83 | "abc", | |
84 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", | 84 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", | |
85 | NULL, | 85 | NULL, | |
86 | }; | 86 | }; | |
87 | 87 | |||
88 | #ifdef SHA_0 | 88 | #ifdef SHA_0 | |
89 | static char *ret[]={ | 89 | static const char *ret[]={ | |
90 | "0164b8a914cd2a5e74c4f7ff082c4d97f1edf880", | 90 | "0164b8a914cd2a5e74c4f7ff082c4d97f1edf880", | |
91 | "d2516ee1acfa5baf33dfc1c471e438449ef134c8", | 91 | "d2516ee1acfa5baf33dfc1c471e438449ef134c8", | |
92 | }; | 92 | }; | |
93 | static char *bigret= | 93 | static const char *bigret= | |
94 | "3232affa48628a26653b5aaa44541fd90d690603"; | 94 | "3232affa48628a26653b5aaa44541fd90d690603"; | |
95 | #endif | 95 | #endif | |
96 | #ifdef SHA_1 | 96 | #ifdef SHA_1 | |
97 | static char *ret[]={ | 97 | static const char *ret[]={ | |
98 | "a9993e364706816aba3e25717850c26c9cd0d89d", | 98 | "a9993e364706816aba3e25717850c26c9cd0d89d", | |
99 | "84983e441c3bd26ebaae4aa1f95129e5e54670f1", | 99 | "84983e441c3bd26ebaae4aa1f95129e5e54670f1", | |
100 | }; | 100 | }; | |
101 | static char *bigret= | 101 | static const char *bigret= | |
102 | "34aa973cd4c4daa4f61eeb2bdbad27316534016f"; | 102 | "34aa973cd4c4daa4f61eeb2bdbad27316534016f"; | |
103 | #endif | 103 | #endif | |
104 | 104 | |||
105 | static char *pt(unsigned char *md); | 105 | static char *pt(unsigned char *md); | |
106 | int main(int argc, char *argv[]) | 106 | int main(int argc, char *argv[]) | |
107 | { | 107 | { | |
108 | int i,err=0; | 108 | int i,err=0; | |
109 | char **P,**R; | 109 | const char **P,**R; | |
110 | static unsigned char buf[1000]; | 110 | static unsigned char buf[1000]; | |
111 | char *p,*r; | 111 | const char *p,*r; | |
112 | EVP_MD_CTX c; | 112 | EVP_MD_CTX c; | |
113 | unsigned char md[SHA_DIGEST_LENGTH]; | 113 | unsigned char md[SHA_DIGEST_LENGTH]; | |
114 | 114 | |||
115 | #ifdef CHARSET_EBCDIC | 115 | #ifdef CHARSET_EBCDIC | |
116 | ebcdic2ascii(test[0], test[0], strlen(test[0])); | 116 | ebcdic2ascii(test[0], test[0], strlen(test[0])); | |
117 | ebcdic2ascii(test[1], test[1], strlen(test[1])); | 117 | ebcdic2ascii(test[1], test[1], strlen(test[1])); | |
118 | #endif | 118 | #endif | |
119 | 119 | |||
120 | EVP_MD_CTX_init(&c); | 120 | EVP_MD_CTX_init(&c); | |
121 | P=test; | 121 | P=test; | |
122 | R=ret; | 122 | R=ret; | |
123 | i=1; | 123 | i=1; | |
124 | while (*P != NULL) | 124 | while (*P != NULL) |
--- src/crypto/external/bsd/openssl/dist/crypto/threads/Attic/mttest.c 2009/07/20 20:41:06 1.3
+++ src/crypto/external/bsd/openssl/dist/crypto/threads/Attic/mttest.c 2011/06/11 16:54:58 1.4
@@ -142,37 +142,37 @@ static int s_nbio=0; | @@ -142,37 +142,37 @@ static int s_nbio=0; | |||
142 | 142 | |||
143 | int thread_number=10; | 143 | int thread_number=10; | |
144 | int number_of_loops=10; | 144 | int number_of_loops=10; | |
145 | int reconnect=0; | 145 | int reconnect=0; | |
146 | int cache_stats=0; | 146 | int cache_stats=0; | |
147 | 147 | |||
148 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; | 148 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; | |
149 | 149 | |||
150 | int doit(char *ctx[4]); | 150 | int doit(char *ctx[4]); | |
151 | static void print_stats(FILE *fp, SSL_CTX *ctx) | 151 | static void print_stats(FILE *fp, SSL_CTX *ctx) | |
152 | { | 152 | { | |
153 | fprintf(fp,"%4ld items in the session cache\n", | 153 | fprintf(fp,"%4ld items in the session cache\n", | |
154 | SSL_CTX_sess_number(ctx)); | 154 | SSL_CTX_sess_number(ctx)); | |
155 | fprintf(fp,"%4d client connects (SSL_connect())\n", | 155 | fprintf(fp,"%4ld client connects (SSL_connect())\n", | |
156 | SSL_CTX_sess_connect(ctx)); | 156 | SSL_CTX_sess_connect(ctx)); | |
157 | fprintf(fp,"%4d client connects that finished\n", | 157 | fprintf(fp,"%4ld client connects that finished\n", | |
158 | SSL_CTX_sess_connect_good(ctx)); | 158 | SSL_CTX_sess_connect_good(ctx)); | |
159 | fprintf(fp,"%4d server connects (SSL_accept())\n", | 159 | fprintf(fp,"%4ld server connects (SSL_accept())\n", | |
160 | SSL_CTX_sess_accept(ctx)); | 160 | SSL_CTX_sess_accept(ctx)); | |
161 | fprintf(fp,"%4d server connects that finished\n", | 161 | fprintf(fp,"%4ld server connects that finished\n", | |
162 | SSL_CTX_sess_accept_good(ctx)); | 162 | SSL_CTX_sess_accept_good(ctx)); | |
163 | fprintf(fp,"%4d session cache hits\n",SSL_CTX_sess_hits(ctx)); | 163 | fprintf(fp,"%4ld session cache hits\n",SSL_CTX_sess_hits(ctx)); | |
164 | fprintf(fp,"%4d session cache misses\n",SSL_CTX_sess_misses(ctx)); | 164 | fprintf(fp,"%4ld session cache misses\n",SSL_CTX_sess_misses(ctx)); | |
165 | fprintf(fp,"%4d session cache timeouts\n",SSL_CTX_sess_timeouts(ctx)); | 165 | fprintf(fp,"%4ld session cache timeouts\n",SSL_CTX_sess_timeouts(ctx)); | |
166 | } | 166 | } | |
167 | 167 | |||
168 | static void sv_usage(void) | 168 | static void sv_usage(void) | |
169 | { | 169 | { | |
170 | fprintf(stderr,"usage: ssltest [args ...]\n"); | 170 | fprintf(stderr,"usage: ssltest [args ...]\n"); | |
171 | fprintf(stderr,"\n"); | 171 | fprintf(stderr,"\n"); | |
172 | fprintf(stderr," -server_auth - check server certificate\n"); | 172 | fprintf(stderr," -server_auth - check server certificate\n"); | |
173 | fprintf(stderr," -client_auth - do client authentication\n"); | 173 | fprintf(stderr," -client_auth - do client authentication\n"); | |
174 | fprintf(stderr," -v - more output\n"); | 174 | fprintf(stderr," -v - more output\n"); | |
175 | fprintf(stderr," -CApath arg - PEM format directory of CA's\n"); | 175 | fprintf(stderr," -CApath arg - PEM format directory of CA's\n"); | |
176 | fprintf(stderr," -CAfile arg - PEM format file of CA's\n"); | 176 | fprintf(stderr," -CAfile arg - PEM format file of CA's\n"); | |
177 | fprintf(stderr," -threads arg - number of threads\n"); | 177 | fprintf(stderr," -threads arg - number of threads\n"); | |
178 | fprintf(stderr," -loops arg - number of 'connections', per thread\n"); | 178 | fprintf(stderr," -loops arg - number of 'connections', per thread\n"); | |
@@ -182,28 +182,28 @@ static void sv_usage(void) | @@ -182,28 +182,28 @@ static void sv_usage(void) | |||
182 | fprintf(stderr," -ccert arg - client certificate/key\n"); | 182 | fprintf(stderr," -ccert arg - client certificate/key\n"); | |
183 | fprintf(stderr," -ssl3 - just SSLv3n\n"); | 183 | fprintf(stderr," -ssl3 - just SSLv3n\n"); | |
184 | } | 184 | } | |
185 | 185 | |||
186 | int main(int argc, char *argv[]) | 186 | int main(int argc, char *argv[]) | |
187 | { | 187 | { | |
188 | char *CApath=NULL,*CAfile=NULL; | 188 | char *CApath=NULL,*CAfile=NULL; | |
189 | int badop=0; | 189 | int badop=0; | |
190 | int ret=1; | 190 | int ret=1; | |
191 | int client_auth=0; | 191 | int client_auth=0; | |
192 | int server_auth=0; | 192 | int server_auth=0; | |
193 | SSL_CTX *s_ctx=NULL; | 193 | SSL_CTX *s_ctx=NULL; | |
194 | SSL_CTX *c_ctx=NULL; | 194 | SSL_CTX *c_ctx=NULL; | |
195 | char *scert=TEST_SERVER_CERT; | 195 | const char *scert=TEST_SERVER_CERT; | |
196 | char *ccert=TEST_CLIENT_CERT; | 196 | const char *ccert=TEST_CLIENT_CERT; | |
197 | const SSL_METHOD *ssl_method=SSLv23_method(); | 197 | const SSL_METHOD *ssl_method=SSLv23_method(); | |
198 | 198 | |||
199 | RAND_seed(rnd_seed, sizeof rnd_seed); | 199 | RAND_seed(rnd_seed, sizeof rnd_seed); | |
200 | 200 | |||
201 | if (bio_err == NULL) | 201 | if (bio_err == NULL) | |
202 | bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); | 202 | bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); | |
203 | if (bio_stdout == NULL) | 203 | if (bio_stdout == NULL) | |
204 | bio_stdout=BIO_new_fp(stdout,BIO_NOCLOSE); | 204 | bio_stdout=BIO_new_fp(stdout,BIO_NOCLOSE); | |
205 | argc--; | 205 | argc--; | |
206 | argv++; | 206 | argv++; | |
207 | 207 | |||
208 | while (argc >= 1) | 208 | while (argc >= 1) | |
209 | { | 209 | { | |
@@ -357,27 +357,27 @@ end: | @@ -357,27 +357,27 @@ end: | |||
357 | } | 357 | } | |
358 | SSL_CTX_free(s_ctx); | 358 | SSL_CTX_free(s_ctx); | |
359 | fprintf(stderr,"done free\n"); | 359 | fprintf(stderr,"done free\n"); | |
360 | } | 360 | } | |
361 | exit(ret); | 361 | exit(ret); | |
362 | return(0); | 362 | return(0); | |
363 | } | 363 | } | |
364 | 364 | |||
365 | #define W_READ 1 | 365 | #define W_READ 1 | |
366 | #define W_WRITE 2 | 366 | #define W_WRITE 2 | |
367 | #define C_DONE 1 | 367 | #define C_DONE 1 | |
368 | #define S_DONE 2 | 368 | #define S_DONE 2 | |
369 | 369 | |||
370 | int ndoit(SSL_CTX *ssl_ctx[2]) | 370 | static int ndoit(SSL_CTX *ssl_ctx[2]) | |
371 | { | 371 | { | |
372 | int i; | 372 | int i; | |
373 | int ret; | 373 | int ret; | |
374 | char *ctx[4]; | 374 | char *ctx[4]; | |
375 | 375 | |||
376 | ctx[0]=(char *)ssl_ctx[0]; | 376 | ctx[0]=(char *)ssl_ctx[0]; | |
377 | ctx[1]=(char *)ssl_ctx[1]; | 377 | ctx[1]=(char *)ssl_ctx[1]; | |
378 | 378 | |||
379 | if (reconnect) | 379 | if (reconnect) | |
380 | { | 380 | { | |
381 | ctx[2]=(char *)SSL_new(ssl_ctx[0]); | 381 | ctx[2]=(char *)SSL_new(ssl_ctx[0]); | |
382 | ctx[3]=(char *)SSL_new(ssl_ctx[1]); | 382 | ctx[3]=(char *)SSL_new(ssl_ctx[1]); | |
383 | } | 383 | } | |
@@ -821,28 +821,28 @@ static long *lock_count; | @@ -821,28 +821,28 @@ static long *lock_count; | |||
821 | void thread_setup(void) | 821 | void thread_setup(void) | |
822 | { | 822 | { | |
823 | int i; | 823 | int i; | |
824 | 824 | |||
825 | lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(mutex_t)); | 825 | lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(mutex_t)); | |
826 | lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); | 826 | lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); | |
827 | for (i=0; i<CRYPTO_num_locks(); i++) | 827 | for (i=0; i<CRYPTO_num_locks(); i++) | |
828 | { | 828 | { | |
829 | lock_count[i]=0; | 829 | lock_count[i]=0; | |
830 | /* rwlock_init(&(lock_cs[i]),USYNC_THREAD,NULL); */ | 830 | /* rwlock_init(&(lock_cs[i]),USYNC_THREAD,NULL); */ | |
831 | mutex_init(&(lock_cs[i]),USYNC_THREAD,NULL); | 831 | mutex_init(&(lock_cs[i]),USYNC_THREAD,NULL); | |
832 | } | 832 | } | |
833 | 833 | |||
834 | CRYPTO_set_id_callback((unsigned long (*)())solaris_thread_id); | 834 | CRYPTO_set_id_callback((unsigned long (*)(void))solaris_thread_id); | |
835 | CRYPTO_set_locking_callback((void (*)())solaris_locking_callback); | 835 | CRYPTO_set_locking_callback((void (*)(void))solaris_locking_callback); | |
836 | } | 836 | } | |
837 | 837 | |||
838 | void thread_cleanup(void) | 838 | void thread_cleanup(void) | |
839 | { | 839 | { | |
840 | int i; | 840 | int i; | |
841 | 841 | |||
842 | CRYPTO_set_locking_callback(NULL); | 842 | CRYPTO_set_locking_callback(NULL); | |
843 | 843 | |||
844 | fprintf(stderr,"cleanup\n"); | 844 | fprintf(stderr,"cleanup\n"); | |
845 | 845 | |||
846 | for (i=0; i<CRYPTO_num_locks(); i++) | 846 | for (i=0; i<CRYPTO_num_locks(); i++) | |
847 | { | 847 | { | |
848 | /* rwlock_destroy(&(lock_cs[i])); */ | 848 | /* rwlock_destroy(&(lock_cs[i])); */ | |
@@ -943,28 +943,28 @@ void thread_setup(void) | @@ -943,28 +943,28 @@ void thread_setup(void) | |||
943 | usconfig(CONF_STHREADIOOFF); | 943 | usconfig(CONF_STHREADIOOFF); | |
944 | usconfig(CONF_STHREADMALLOCOFF); | 944 | usconfig(CONF_STHREADMALLOCOFF); | |
945 | usconfig(CONF_INITUSERS,100); | 945 | usconfig(CONF_INITUSERS,100); | |
946 | usconfig(CONF_LOCKTYPE,US_DEBUGPLUS); | 946 | usconfig(CONF_LOCKTYPE,US_DEBUGPLUS); | |
947 | arena=usinit(filename); | 947 | arena=usinit(filename); | |
948 | unlink(filename); | 948 | unlink(filename); | |
949 | 949 | |||
950 | lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(usema_t *)); | 950 | lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(usema_t *)); | |
951 | for (i=0; i<CRYPTO_num_locks(); i++) | 951 | for (i=0; i<CRYPTO_num_locks(); i++) | |
952 | { | 952 | { | |
953 | lock_cs[i]=usnewsema(arena,1); | 953 | lock_cs[i]=usnewsema(arena,1); | |
954 | } | 954 | } | |
955 | 955 | |||
956 | CRYPTO_set_id_callback((unsigned long (*)())irix_thread_id); | 956 | CRYPTO_set_id_callback((unsigned long (*)(void))irix_thread_id); | |
957 | CRYPTO_set_locking_callback((void (*)())irix_locking_callback); | 957 | CRYPTO_set_locking_callback((void (*)(void))irix_locking_callback); | |
958 | } | 958 | } | |
959 | 959 | |||
960 | void thread_cleanup(void) | 960 | void thread_cleanup(void) | |
961 | { | 961 | { | |
962 | int i; | 962 | int i; | |
963 | 963 | |||
964 | CRYPTO_set_locking_callback(NULL); | 964 | CRYPTO_set_locking_callback(NULL); | |
965 | for (i=0; i<CRYPTO_num_locks(); i++) | 965 | for (i=0; i<CRYPTO_num_locks(); i++) | |
966 | { | 966 | { | |
967 | char buf[10]; | 967 | char buf[10]; | |
968 | 968 | |||
969 | snprintf(buf, sizeof(buf), "%2d:",i); | 969 | snprintf(buf, sizeof(buf), "%2d:",i); | |
970 | usdumpsema(lock_cs[i],stdout,buf); | 970 | usdumpsema(lock_cs[i],stdout,buf); | |
@@ -1028,28 +1028,28 @@ static long *lock_count; | @@ -1028,28 +1028,28 @@ static long *lock_count; | |||
1028 | 1028 | |||
1029 | void thread_setup(void) | 1029 | void thread_setup(void) | |
1030 | { | 1030 | { | |
1031 | int i; | 1031 | int i; | |
1032 | 1032 | |||
1033 | lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); | 1033 | lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); | |
1034 | lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); | 1034 | lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); | |
1035 | for (i=0; i<CRYPTO_num_locks(); i++) | 1035 | for (i=0; i<CRYPTO_num_locks(); i++) | |
1036 | { | 1036 | { | |
1037 | lock_count[i]=0; | 1037 | lock_count[i]=0; | |
1038 | pthread_mutex_init(&(lock_cs[i]),NULL); | 1038 | pthread_mutex_init(&(lock_cs[i]),NULL); | |
1039 | } | 1039 | } | |
1040 | 1040 | |||
1041 | CRYPTO_set_id_callback((unsigned long (*)())pthreads_thread_id); | 1041 | CRYPTO_set_id_callback((unsigned long (*)(void))pthreads_thread_id); | |
1042 | CRYPTO_set_locking_callback((void (*)())pthreads_locking_callback); | 1042 | CRYPTO_set_locking_callback((void (*)(int, int, const char *, int))pthreads_locking_callback); | |
1043 | } | 1043 | } | |
1044 | 1044 | |||
1045 | void thread_cleanup(void) | 1045 | void thread_cleanup(void) | |
1046 | { | 1046 | { | |
1047 | int i; | 1047 | int i; | |
1048 | 1048 | |||
1049 | CRYPTO_set_locking_callback(NULL); | 1049 | CRYPTO_set_locking_callback(NULL); | |
1050 | fprintf(stderr,"cleanup\n"); | 1050 | fprintf(stderr,"cleanup\n"); | |
1051 | for (i=0; i<CRYPTO_num_locks(); i++) | 1051 | for (i=0; i<CRYPTO_num_locks(); i++) | |
1052 | { | 1052 | { | |
1053 | pthread_mutex_destroy(&(lock_cs[i])); | 1053 | pthread_mutex_destroy(&(lock_cs[i])); | |
1054 | fprintf(stderr,"%8ld:%s\n",lock_count[i], | 1054 | fprintf(stderr,"%8ld:%s\n",lock_count[i], | |
1055 | CRYPTO_get_lock_name(i)); | 1055 | CRYPTO_get_lock_name(i)); | |
@@ -1091,27 +1091,27 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX | @@ -1091,27 +1091,27 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX | |||
1091 | SSL_CTX *ssl_ctx[2]; | 1091 | SSL_CTX *ssl_ctx[2]; | |
1092 | pthread_t thread_ctx[MAX_THREAD_NUMBER]; | 1092 | pthread_t thread_ctx[MAX_THREAD_NUMBER]; | |
1093 | int i; | 1093 | int i; | |
1094 | 1094 | |||
1095 | ssl_ctx[0]=s_ctx; | 1095 | ssl_ctx[0]=s_ctx; | |
1096 | ssl_ctx[1]=c_ctx; | 1096 | ssl_ctx[1]=c_ctx; | |
1097 | 1097 | |||
1098 | /* | 1098 | /* | |
1099 | thr_setconcurrency(thread_number); | 1099 | thr_setconcurrency(thread_number); | |
1100 | */ | 1100 | */ | |
1101 | for (i=0; i<thread_number; i++) | 1101 | for (i=0; i<thread_number; i++) | |
1102 | { | 1102 | { | |
1103 | pthread_create(&(thread_ctx[i]), NULL, | 1103 | pthread_create(&(thread_ctx[i]), NULL, | |
1104 | (void *(*)())ndoit, (void *)ssl_ctx); | 1104 | (void *(*)(void *))ndoit, (void *)ssl_ctx); | |
1105 | } | 1105 | } | |
1106 | 1106 | |||
1107 | printf("reaping\n"); | 1107 | printf("reaping\n"); | |
1108 | for (i=0; i<thread_number; i++) | 1108 | for (i=0; i<thread_number; i++) | |
1109 | { | 1109 | { | |
1110 | pthread_join(thread_ctx[i],NULL); | 1110 | pthread_join(thread_ctx[i],NULL); | |
1111 | } | 1111 | } | |
1112 | 1112 | |||
1113 | printf("pthreads threads done (%d,%d)\n", | 1113 | printf("pthreads threads done (%d,%d)\n", | |
1114 | s_ctx->references,c_ctx->references); | 1114 | s_ctx->references,c_ctx->references); | |
1115 | } | 1115 | } | |
1116 | 1116 | |||
1117 | unsigned long pthreads_thread_id(void) | 1117 | unsigned long pthreads_thread_id(void) | |
@@ -1132,28 +1132,28 @@ void thread_setup(void) | @@ -1132,28 +1132,28 @@ void thread_setup(void) | |||
1132 | { | 1132 | { | |
1133 | int i; | 1133 | int i; | |
1134 | 1134 | |||
1135 | lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(MPKMutex)); | 1135 | lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(MPKMutex)); | |
1136 | lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); | 1136 | lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); | |
1137 | for (i=0; i<CRYPTO_num_locks(); i++) | 1137 | for (i=0; i<CRYPTO_num_locks(); i++) | |
1138 | { | 1138 | { | |
1139 | lock_count[i]=0; | 1139 | lock_count[i]=0; | |
1140 | lock_cs[i]=MPKMutexAlloc("OpenSSL mutex"); | 1140 | lock_cs[i]=MPKMutexAlloc("OpenSSL mutex"); | |
1141 | } | 1141 | } | |
1142 | 1142 | |||
1143 | ThreadSem = MPKSemaphoreAlloc("OpenSSL mttest semaphore", 0 ); | 1143 | ThreadSem = MPKSemaphoreAlloc("OpenSSL mttest semaphore", 0 ); | |
1144 | 1144 | |||
1145 | CRYPTO_set_id_callback((unsigned long (*)())netware_thread_id); | 1145 | CRYPTO_set_id_callback((unsigned long (*)(void))netware_thread_id); | |
1146 | CRYPTO_set_locking_callback((void (*)())netware_locking_callback); | 1146 | CRYPTO_set_locking_callback((void (*)(void))netware_locking_callback); | |
1147 | } | 1147 | } | |
1148 | 1148 | |||
1149 | void thread_cleanup(void) | 1149 | void thread_cleanup(void) | |
1150 | { | 1150 | { | |
1151 | int i; | 1151 | int i; | |
1152 | 1152 | |||
1153 | CRYPTO_set_locking_callback(NULL); | 1153 | CRYPTO_set_locking_callback(NULL); | |
1154 | 1154 | |||
1155 | fprintf(stdout,"thread_cleanup\n"); | 1155 | fprintf(stdout,"thread_cleanup\n"); | |
1156 | 1156 | |||
1157 | for (i=0; i<CRYPTO_num_locks(); i++) | 1157 | for (i=0; i<CRYPTO_num_locks(); i++) | |
1158 | { | 1158 | { | |
1159 | MPKMutexFree(lock_cs[i]); | 1159 | MPKMutexFree(lock_cs[i]); | |
@@ -1221,27 +1221,27 @@ static long* lock_count; | @@ -1221,27 +1221,27 @@ static long* lock_count; | |||
1221 | 1221 | |||
1222 | void thread_setup(void) | 1222 | void thread_setup(void) | |
1223 | { | 1223 | { | |
1224 | int i; | 1224 | int i; | |
1225 | 1225 | |||
1226 | lock_cs=(BLocker**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(BLocker*)); | 1226 | lock_cs=(BLocker**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(BLocker*)); | |
1227 | lock_count=(long*)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); | 1227 | lock_count=(long*)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); | |
1228 | for (i=0; i<CRYPTO_num_locks(); i++) | 1228 | for (i=0; i<CRYPTO_num_locks(); i++) | |
1229 | { | 1229 | { | |
1230 | lock_count[i]=0; | 1230 | lock_count[i]=0; | |
1231 | lock_cs[i] = new BLocker(CRYPTO_get_lock_name(i)); | 1231 | lock_cs[i] = new BLocker(CRYPTO_get_lock_name(i)); | |
1232 | } | 1232 | } | |
1233 | 1233 | |||
1234 | CRYPTO_set_id_callback((unsigned long (*)())beos_thread_id); | 1234 | CRYPTO_set_id_callback((unsigned long (*)(void))beos_thread_id); | |
1235 | CRYPTO_set_locking_callback(beos_locking_callback); | 1235 | CRYPTO_set_locking_callback(beos_locking_callback); | |
1236 | } | 1236 | } | |
1237 | 1237 | |||
1238 | void thread_cleanup(void) | 1238 | void thread_cleanup(void) | |
1239 | { | 1239 | { | |
1240 | int i; | 1240 | int i; | |
1241 | 1241 | |||
1242 | CRYPTO_set_locking_callback(NULL); | 1242 | CRYPTO_set_locking_callback(NULL); | |
1243 | fprintf(stderr,"cleanup\n"); | 1243 | fprintf(stderr,"cleanup\n"); | |
1244 | for (i=0; i<CRYPTO_num_locks(); i++) | 1244 | for (i=0; i<CRYPTO_num_locks(); i++) | |
1245 | { | 1245 | { | |
1246 | delete lock_cs[i]; | 1246 | delete lock_cs[i]; | |
1247 | fprintf(stderr,"%8ld:%s\n",lock_count[i], | 1247 | fprintf(stderr,"%8ld:%s\n",lock_count[i], |
--- src/crypto/external/bsd/openssl/dist/crypto/x509v3/Attic/tabtest.c 2011/05/16 00:08:33 1.4
+++ src/crypto/external/bsd/openssl/dist/crypto/x509v3/Attic/tabtest.c 2011/06/11 16:54:58 1.5
@@ -59,27 +59,28 @@ | @@ -59,27 +59,28 @@ | |||
59 | /* Simple program to check the ext_dat.h is correct and print out | 59 | /* Simple program to check the ext_dat.h is correct and print out | |
60 | * problems if it is not. | 60 | * problems if it is not. | |
61 | */ | 61 | */ | |
62 | 62 | |||
63 | #include <stdio.h> | 63 | #include <stdio.h> | |
64 | 64 | |||
65 | #include <openssl/x509v3.h> | 65 | #include <openssl/x509v3.h> | |
66 | 66 | |||
67 | #include "ext_dat.h" | 67 | #include "ext_dat.h" | |
68 | 68 | |||
69 | int | 69 | int | |
70 | main(void) | 70 | main(void) | |
71 | { | 71 | { | |
72 | int i, prev = -1, bad = 0; | 72 | int prev = -1, bad = 0; | |
73 | unsigned int i; | |||
73 | const X509V3_EXT_METHOD **tmp; | 74 | const X509V3_EXT_METHOD **tmp; | |
74 | i = sizeof(standard_exts) / sizeof(X509V3_EXT_METHOD *); | 75 | i = sizeof(standard_exts) / sizeof(X509V3_EXT_METHOD *); | |
75 | if(i != STANDARD_EXTENSION_COUNT) | 76 | if(i != STANDARD_EXTENSION_COUNT) | |
76 | fprintf(stderr, "Extension number invalid expecting %d\n", i); | 77 | fprintf(stderr, "Extension number invalid expecting %d\n", i); | |
77 | tmp = standard_exts; | 78 | tmp = standard_exts; | |
78 | for(i = 0; i < STANDARD_EXTENSION_COUNT; i++, tmp++) { | 79 | for(i = 0; i < STANDARD_EXTENSION_COUNT; i++, tmp++) { | |
79 | if((*tmp)->ext_nid < prev) bad = 1; | 80 | if((*tmp)->ext_nid < prev) bad = 1; | |
80 | prev = (*tmp)->ext_nid; | 81 | prev = (*tmp)->ext_nid; | |
81 | 82 | |||
82 | } | 83 | } | |
83 | if(bad) { | 84 | if(bad) { | |
84 | tmp = standard_exts; | 85 | tmp = standard_exts; | |
85 | fprintf(stderr, "Extensions out of order!\n"); | 86 | fprintf(stderr, "Extensions out of order!\n"); |