'passwd' tool.
[openssl.git] / apps / dh.c
index b4abbe7f0982bb787b09753e0fd170eee399bb16..becbdb6671a5ed0227e8f7ef06686247d10be4ec 100644 (file)
--- a/apps/dh.c
+++ b/apps/dh.c
@@ -72,7 +72,7 @@
 #undef PROG
 #define PROG   dh_main
 
-/* -inform arg - input format - default PEM (one of DER, TXT or PEM)
+/* -inform arg - input format - default PEM (DER or PEM)
  * -outform arg - output format - default PEM
  * -in arg     - input file - default stdin
  * -out arg    - output file - default stdout
@@ -149,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");
@@ -194,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");
@@ -219,7 +219,7 @@ bad:
                BN_print(stdout,dh->g);
                printf("\n");
                if (dh->length != 0)
-                       printf("recomented private length=%ld\n",dh->length);
+                       printf("recommended private length=%ld\n",dh->length);
 #endif
                }
        
@@ -282,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);
                }
 
 
@@ -297,7 +298,7 @@ bad:
                        }
                if (!i)
                        {
-                       BIO_printf(bio_err,"unable to write DH paramaters\n");
+                       BIO_printf(bio_err,"unable to write DH parameters\n");
                        ERR_print_errors(bio_err);
                        goto end;
                        }