summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dh/dhtest.c
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/dh/dhtest.c
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/dh/dhtest.c')
-rw-r--r--src/lib/libcrypto/dh/dhtest.c36
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
70int 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 84static void MS_CALLBACK cb(int p, int n, void *arg);
77static void MS_CALLBACK cb(int p, int n, char *arg);
78#else
79static 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
87BIO *out=NULL; 90BIO *out=NULL;
88 91
89int main(argc,argv) 92int main(int argc, char *argv[])
90int argc;
91char *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
173static void MS_CALLBACK cb(p, n,arg) 174static void MS_CALLBACK cb(int p, int n, void *arg)
174int p;
175int n;
176char *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