aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/dsa/dsatest.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2003-10-29 04:14:08 +0000
committerGeoff Thorpe <geoff@openssl.org>2003-10-29 04:14:08 +0000
commit2aaec9cced89edfdc8375b38a130fa1c35a98025 (patch)
tree8f9339b8dac8d23ae1b424216b769cdeef7f59f0 /crypto/dsa/dsatest.c
parent9d473aa2e4076beb959bc9701786a0860877ee12 (diff)
downloadopenssl-2aaec9cced89edfdc8375b38a130fa1c35a98025.tar.gz
Update any code that was using deprecated functions so that everything builds
and links with OPENSSL_NO_DEPRECATED defined.
Diffstat (limited to 'crypto/dsa/dsatest.c')
-rw-r--r--crypto/dsa/dsatest.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/crypto/dsa/dsatest.c b/crypto/dsa/dsatest.c
index 49c630b106..1dbda6801b 100644
--- a/crypto/dsa/dsatest.c
+++ b/crypto/dsa/dsatest.c
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
#define MS_CALLBACK
#endif
-static void MS_CALLBACK dsa_cb(int p, int n, void *arg);
+static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *arg);
/* seed, out_p, out_q, out_g are taken from the updated Appendix 5 to
* FIPS PUB 186 and also appear in Appendix 5 to FIPS PIB 186-1 */
@@ -135,6 +135,7 @@ static BIO *bio_err=NULL;
int main(int argc, char **argv)
{
+ BN_GENCB cb;
DSA *dsa=NULL;
int counter,ret=0,i,j;
unsigned char buf[256];
@@ -154,7 +155,10 @@ int main(int argc, char **argv)
BIO_printf(bio_err,"test generation of DSA parameters\n");
- dsa=DSA_generate_parameters(512,seed,20,&counter,&h,dsa_cb,bio_err);
+ BN_GENCB_set(&cb, dsa_cb, bio_err);
+ if(((dsa = DSA_new()) == NULL) || !DSA_generate_parameters_ex(dsa, 512,
+ seed, 20, &counter, &h, &cb))
+ goto end;
BIO_printf(bio_err,"seed\n");
for (i=0; i<20; i+=4)
@@ -221,13 +225,7 @@ end:
return(0);
}
-static int cb_exit(int ec)
- {
- EXIT(ec);
- return(0); /* To keep some compilers quiet */
- }
-
-static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
+static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *arg)
{
char c='*';
static int ok=0,num=0;
@@ -236,13 +234,14 @@ static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
if (p == 1) c='+';
if (p == 2) { c='*'; ok++; }
if (p == 3) c='\n';
- BIO_write(arg,&c,1);
- (void)BIO_flush(arg);
+ BIO_write(arg->arg,&c,1);
+ (void)BIO_flush(arg->arg);
if (!ok && (p == 0) && (num > 1))
{
BIO_printf((BIO *)arg,"error in dsatest\n");
- cb_exit(1);
+ return 0;
}
+ return 1;
}
#endif