projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Always return a value.
[oweals/openssl.git]
/
apps
/
dsaparam.c
diff --git
a/apps/dsaparam.c
b/apps/dsaparam.c
index 7d4a12f56256566cb3eb1bf21bb20620ab42f5f6..f861ec7b1ad8cf2d1c6e31b70b5c85d30f2974a2 100644
(file)
--- a/
apps/dsaparam.c
+++ b/
apps/dsaparam.c
@@
-84,7
+84,10
@@
* -genkey
*/
* -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;
int MAIN(int argc, char **argv)
{
DSA *dsa=NULL;
@@
-202,7
+205,15
@@
bad:
}
}
if (outfile == NULL)
}
}
if (outfile == NULL)
+ {
BIO_set_fp(out,stdout,BIO_NOCLOSE);
BIO_set_fp(out,stdout,BIO_NOCLOSE);
+#ifdef VMS
+ {
+ BIO *tmpbio = BIO_new(BIO_f_linebuffer());
+ out = BIO_push(tmpbio, out);
+ }
+#endif
+ }
else
{
if (BIO_write_filename(out,outfile) <= 0)
else
{
if (BIO_write_filename(out,outfile) <= 0)
@@
-225,8
+236,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");
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);
}
else if (informat == FORMAT_ASN1)
dsa=d2i_DSAparams_bio(in,NULL);
@@
-258,10
+268,10
@@
bad:
bits_p=BN_num_bits(dsa->p);
bits_q=BN_num_bits(dsa->q);
bits_g=BN_num_bits(dsa->g);
bits_p=BN_num_bits(dsa->p);
bits_q=BN_num_bits(dsa->q);
bits_g=BN_num_bits(dsa->g);
- data=(unsigned char *)
M
alloc(len+20);
+ data=(unsigned char *)
OPENSSL_m
alloc(len+20);
if (data == NULL)
{
if (data == NULL)
{
- perror("
M
alloc");
+ perror("
OPENSSL_m
alloc");
goto end;
}
l=BN_bn2bin(dsa->p,data);
goto end;
}
l=BN_bn2bin(dsa->p,data);
@@
-318,7
+328,7
@@
bad:
}
if (!i)
{
}
if (!i)
{
- BIO_printf(bio_err,"unable to write DSA param
a
ters\n");
+ BIO_printf(bio_err,"unable to write DSA param
e
ters\n");
ERR_print_errors(bio_err);
goto end;
}
ERR_print_errors(bio_err);
goto end;
}
@@
-345,12
+355,12
@@
bad:
ret=0;
end:
if (in != NULL) BIO_free(in);
ret=0;
end:
if (in != NULL) BIO_free(in);
- if (out != NULL) BIO_free(out);
+ if (out != NULL) BIO_free
_all
(out);
if (dsa != NULL) DSA_free(dsa);
EXIT(ret);
}
if (dsa != NULL) DSA_free(dsa);
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='*';
{
char c='*';
@@
-358,8
+368,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';
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
#ifdef LINT
p=n;
#endif