Manpages for the DH utils and fix for a memory leak in dh program
[openssl.git] / apps / dh.c
index 02742485ce234609ec002063d855201b70e97e15..d68b38808540433543fcf5ed6b1c9db2c184df64 100644 (file)
--- a/apps/dh.c
+++ b/apps/dh.c
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef NO_DH
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
@@ -148,8 +149,8 @@ int MAIN(int argc, char **argv)
 bad:
                BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
                BIO_printf(bio_err,"where options are\n");
-               BIO_printf(bio_err," -inform arg   input format - one of DER TXT PEM\n");
-               BIO_printf(bio_err," -outform arg  output format - one of DER TXT PEM\n");
+               BIO_printf(bio_err," -inform arg   input format - one of DER PEM\n");
+               BIO_printf(bio_err," -outform arg  output format - one of DER PEM\n");
                BIO_printf(bio_err," -in arg       input file\n");
                BIO_printf(bio_err," -out arg      output file\n");
                BIO_printf(bio_err," -check        check the DH parameters\n");
@@ -193,7 +194,7 @@ bad:
        if      (informat == FORMAT_ASN1)
                dh=d2i_DHparams_bio(in,NULL);
        else if (informat == FORMAT_PEM)
-               dh=PEM_read_bio_DHparams(in,NULL,NULL);
+               dh=PEM_read_bio_DHparams(in,NULL,NULL,NULL);
        else
                {
                BIO_printf(bio_err,"bad input format specified\n");
@@ -281,6 +282,7 @@ bad:
                printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
                printf("\t\treturn(NULL);\n");
                printf("\treturn(dh);\n\t}\n");
+               Free(data);
                }
 
 
@@ -308,3 +310,4 @@ end:
        if (dh != NULL) DH_free(dh);
        EXIT(ret);
        }
+#endif