X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fdh.c;h=7465442e49f1c07f8d766029ca8bdfe599c0eb43;hb=9693045170a671fde225a23ced1108fbc6dcf097;hp=becbdb6671a5ed0227e8f7ef06686247d10be4ec;hpb=657e60fa00ddde3618600d6306be913214d30457;p=oweals%2Fopenssl.git diff --git a/apps/dh.c b/apps/dh.c index becbdb6671..7465442e49 100644 --- a/apps/dh.c +++ b/apps/dh.c @@ -1,4 +1,5 @@ /* apps/dh.c */ +/* obsoleted by dhparam.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -82,6 +83,8 @@ * -C */ +int MAIN(int, char **); + int MAIN(int argc, char **argv) { DH *dh=NULL; @@ -181,7 +184,15 @@ bad: } } if (outfile == NULL) + { 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) @@ -232,8 +243,8 @@ bad: } if (i & DH_CHECK_P_NOT_PRIME) printf("p value is not prime\n"); - if (i & DH_CHECK_P_NOT_STRONG_PRIME) - printf("p value is not a strong prime\n"); + if (i & DH_CHECK_P_NOT_SAFE_PRIME) + printf("p value is not a safe prime\n"); if (i & DH_UNABLE_TO_CHECK_GENERATOR) printf("unable to check the generator value\n"); if (i & DH_NOT_SUITABLE_GENERATOR) @@ -248,10 +259,10 @@ bad: len=BN_num_bytes(dh->p); bits=BN_num_bits(dh->p); - data=(unsigned char *)Malloc(len); + data=(unsigned char *)OPENSSL_malloc(len); if (data == NULL) { - perror("Malloc"); + perror("OPENSSL_malloc"); goto end; } l=BN_bn2bin(dh->p,data); @@ -282,7 +293,7 @@ bad: printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n"); printf("\t\treturn(NULL);\n"); printf("\treturn(dh);\n\t}\n"); - Free(data); + OPENSSL_free(data); } @@ -306,7 +317,7 @@ bad: ret=0; end: if (in != NULL) BIO_free(in); - if (out != NULL) BIO_free(out); + if (out != NULL) BIO_free_all(out); if (dh != NULL) DH_free(dh); EXIT(ret); }