Extend the docs on setting the cipher list. Lutz Jaenicke <Lutz.Jaenicke@aet.TU...
[openssl.git] / apps / dsaparam.c
index 7d4a12f56256566cb3eb1bf21bb20620ab42f5f6..a15d6ea3096714abbdb3e81e67fe1fe9d875316f 100644 (file)
  * -genkey
  */
 
-static void MS_CALLBACK dsa_cb(int p, int n, char *arg);
+static void MS_CALLBACK dsa_cb(int p, int n, void *arg);
+
+int MAIN(int, char **);
+
 int MAIN(int argc, char **argv)
        {
        DSA *dsa=NULL;
@@ -225,8 +228,7 @@ bad:
                assert(need_rand);
                BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
                BIO_printf(bio_err,"This could take some time\n");
-               dsa=DSA_generate_parameters(num,NULL,0,NULL,NULL,
-                       dsa_cb,(char *)bio_err);
+               dsa=DSA_generate_parameters(num,NULL,0,NULL,NULL, dsa_cb,bio_err);
                }
        else if (informat == FORMAT_ASN1)
                dsa=d2i_DSAparams_bio(in,NULL);
@@ -258,10 +260,10 @@ bad:
                bits_p=BN_num_bits(dsa->p);
                bits_q=BN_num_bits(dsa->q);
                bits_g=BN_num_bits(dsa->g);
-               data=(unsigned char *)Malloc(len+20);
+               data=(unsigned char *)OPENSSL_malloc(len+20);
                if (data == NULL)
                        {
-                       perror("Malloc");
+                       perror("OPENSSL_malloc");
                        goto end;
                        }
                l=BN_bn2bin(dsa->p,data);
@@ -318,7 +320,7 @@ bad:
                        }
                if (!i)
                        {
-                       BIO_printf(bio_err,"unable to write DSA paramaters\n");
+                       BIO_printf(bio_err,"unable to write DSA parameters\n");
                        ERR_print_errors(bio_err);
                        goto end;
                        }
@@ -350,7 +352,7 @@ end:
        EXIT(ret);
        }
 
-static void MS_CALLBACK dsa_cb(int p, int n, char *arg)
+static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
        {
        char c='*';
 
@@ -358,8 +360,8 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg)
        if (p == 1) c='+';
        if (p == 2) c='*';
        if (p == 3) c='\n';
-       BIO_write((BIO *)arg,&c,1);
-       (void)BIO_flush((BIO *)arg);
+       BIO_write(arg,&c,1);
+       (void)BIO_flush(arg);
 #ifdef LINT
        p=n;
 #endif