diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/dh/dhtest.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/libcrypto/dh/dhtest.c b/src/lib/libcrypto/dh/dhtest.c index 488f10fd41..770331971f 100644 --- a/src/lib/libcrypto/dh/dhtest.c +++ b/src/lib/libcrypto/dh/dhtest.c | |||
| @@ -62,10 +62,18 @@ | |||
| 62 | #ifdef WINDOWS | 62 | #ifdef WINDOWS |
| 63 | #include "../bio/bss_file.c" | 63 | #include "../bio/bss_file.c" |
| 64 | #endif | 64 | #endif |
| 65 | #include "crypto.h" | 65 | #include <openssl/crypto.h> |
| 66 | #include "bio.h" | 66 | #include <openssl/bio.h> |
| 67 | #include "bn.h" | 67 | #include <openssl/bn.h> |
| 68 | #include "dh.h" | 68 | |
| 69 | #ifdef NO_DH | ||
| 70 | int main(int argc, char *argv[]) | ||
| 71 | { | ||
| 72 | printf("No DH support\n"); | ||
| 73 | return(0); | ||
| 74 | } | ||
| 75 | #else | ||
| 76 | #include <openssl/dh.h> | ||
| 69 | 77 | ||
| 70 | #ifdef WIN16 | 78 | #ifdef WIN16 |
| 71 | #define MS_CALLBACK _far _loadds | 79 | #define MS_CALLBACK _far _loadds |
| @@ -73,12 +81,7 @@ | |||
| 73 | #define MS_CALLBACK | 81 | #define MS_CALLBACK |
| 74 | #endif | 82 | #endif |
| 75 | 83 | ||
| 76 | #ifndef NOPROTO | 84 | static void MS_CALLBACK cb(int p, int n, void *arg); |
| 77 | static void MS_CALLBACK cb(int p, int n, char *arg); | ||
| 78 | #else | ||
| 79 | static void MS_CALLBACK cb(); | ||
| 80 | #endif | ||
| 81 | |||
| 82 | #ifdef NO_STDIO | 85 | #ifdef NO_STDIO |
| 83 | #define APPS_WIN16 | 86 | #define APPS_WIN16 |
| 84 | #include "bss_file.c" | 87 | #include "bss_file.c" |
| @@ -86,9 +89,7 @@ static void MS_CALLBACK cb(); | |||
| 86 | 89 | ||
| 87 | BIO *out=NULL; | 90 | BIO *out=NULL; |
| 88 | 91 | ||
| 89 | int main(argc,argv) | 92 | int main(int argc, char *argv[]) |
| 90 | int argc; | ||
| 91 | char *argv[]; | ||
| 92 | { | 93 | { |
| 93 | DH *a,*b; | 94 | DH *a,*b; |
| 94 | char buf[12]; | 95 | char buf[12]; |
| @@ -103,7 +104,7 @@ char *argv[]; | |||
| 103 | if (out == NULL) exit(1); | 104 | if (out == NULL) exit(1); |
| 104 | BIO_set_fp(out,stdout,BIO_NOCLOSE); | 105 | BIO_set_fp(out,stdout,BIO_NOCLOSE); |
| 105 | 106 | ||
| 106 | a=DH_generate_parameters(64,DH_GENERATOR_5,cb,(char *)out); | 107 | a=DH_generate_parameters(64,DH_GENERATOR_5,cb,out); |
| 107 | if (a == NULL) goto err; | 108 | if (a == NULL) goto err; |
| 108 | 109 | ||
| 109 | BIO_puts(out,"\np ="); | 110 | BIO_puts(out,"\np ="); |
| @@ -170,10 +171,7 @@ err: | |||
| 170 | return(ret); | 171 | return(ret); |
| 171 | } | 172 | } |
| 172 | 173 | ||
| 173 | static void MS_CALLBACK cb(p, n,arg) | 174 | static void MS_CALLBACK cb(int p, int n, void *arg) |
| 174 | int p; | ||
| 175 | int n; | ||
| 176 | char *arg; | ||
| 177 | { | 175 | { |
| 178 | char c='*'; | 176 | char c='*'; |
| 179 | 177 | ||
| @@ -182,7 +180,9 @@ char *arg; | |||
| 182 | if (p == 2) c='*'; | 180 | if (p == 2) c='*'; |
| 183 | if (p == 3) c='\n'; | 181 | if (p == 3) c='\n'; |
| 184 | BIO_write((BIO *)arg,&c,1); | 182 | BIO_write((BIO *)arg,&c,1); |
| 183 | (void)BIO_flush((BIO *)arg); | ||
| 185 | #ifdef LINT | 184 | #ifdef LINT |
| 186 | p=n; | 185 | p=n; |
| 187 | #endif | 186 | #endif |
| 188 | } | 187 | } |
| 188 | #endif | ||
