Add missing '#ifndef NO_DSA'.
[oweals/openssl.git] / apps / passwd.c
index f190e16cb5b6257790cc862a6f6bc68c4b4a26eb..ea2b089e24a73762fd027f997f5a34b5ef9e9487 100644 (file)
@@ -1,10 +1,10 @@
 /* apps/passwd.c */
 
-#if defined OPENSSL_NO_MD5 || defined CHARSET_EBCDIC
+#if defined NO_MD5 || defined CHARSET_EBCDIC
 # define NO_MD5CRYPT_1
 #endif
 
-#if !defined(OPENSSL_NO_DES) || !defined(NO_MD5CRYPT_1)
+#if !defined(NO_DES) || !defined(NO_MD5CRYPT_1)
 
 #include <assert.h>
 #include <string.h>
@@ -16,7 +16,7 @@
 #include <openssl/evp.h>
 #include <openssl/rand.h>
 
-#ifndef OPENSSL_NO_DES
+#ifndef NO_DES
 # include <openssl/des.h>
 #endif
 #ifndef NO_MD5CRYPT_1
@@ -50,7 +50,6 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
  * -salt string  - salt
  * -in file      - read passwords from file
  * -stdin        - read passwords from stdin
- * -noverify     - never verify when reading password from terminal
  * -quiet        - no warnings
  * -table        - format output as table
  * -reverse      - switch table columns
@@ -63,7 +62,6 @@ int MAIN(int argc, char **argv)
        int ret = 1;
        char *infile = NULL;
        int in_stdin = 0;
-       int in_noverify = 0;
        char *salt = NULL, *passwd = NULL, **passwds = NULL;
        char *salt_malloc = NULL, *passwd_malloc = NULL;
        size_t passwd_malloc_size = 0;
@@ -83,7 +81,7 @@ int MAIN(int argc, char **argv)
        if (out == NULL)
                goto err;
        BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
-#ifdef OPENSSL_SYS_VMS
+#ifdef VMS
        {
        BIO *tmpbio = BIO_new(BIO_f_linebuffer());
        out = BIO_push(tmpbio, out);
@@ -130,8 +128,6 @@ int MAIN(int argc, char **argv)
                        else
                                badopt = 1;
                        }
-               else if (strcmp(argv[i], "-noverify") == 0)
-                       in_noverify = 1;
                else if (strcmp(argv[i], "-quiet") == 0)
                        quiet = 1;
                else if (strcmp(argv[i], "-table") == 0)
@@ -157,7 +153,7 @@ int MAIN(int argc, char **argv)
                badopt = 1;
 
        /* reject unsupported algorithms */
-#ifdef OPENSSL_NO_DES
+#ifdef NO_DES
        if (usecrypt) badopt = 1;
 #endif
 #ifdef NO_MD5CRYPT_1
@@ -168,7 +164,7 @@ int MAIN(int argc, char **argv)
                {
                BIO_printf(bio_err, "Usage: passwd [options] [passwords]\n");
                BIO_printf(bio_err, "where options are\n");
-#ifndef OPENSSL_NO_DES
+#ifndef NO_DES
                BIO_printf(bio_err, "-crypt             standard Unix password algorithm (default)\n");
 #endif
 #ifndef NO_MD5CRYPT_1
@@ -178,7 +174,6 @@ int MAIN(int argc, char **argv)
                BIO_printf(bio_err, "-salt string       use provided salt\n");
                BIO_printf(bio_err, "-in file           read passwords from file\n");
                BIO_printf(bio_err, "-stdin             read passwords from stdin\n");
-               BIO_printf(bio_err, "-noverify          never verify when reading password from terminal\n");
                BIO_printf(bio_err, "-quiet             no warnings\n");
                BIO_printf(bio_err, "-table             format output as table\n");
                BIO_printf(bio_err, "-reverse           switch table columns\n");
@@ -227,7 +222,7 @@ int MAIN(int argc, char **argv)
                
                passwds = passwds_static;
                if (in == NULL)
-                       if (EVP_read_pw_string(passwd_malloc, passwd_malloc_size, "Password: ", !(passed_salt || in_noverify)) != 0)
+                       if (EVP_read_pw_string(passwd_malloc, passwd_malloc_size, "Password: ", 0) != 0)
                                goto err;
                passwds[0] = passwd_malloc;
                }
@@ -277,6 +272,7 @@ int MAIN(int argc, char **argv)
                        }
                while (!done);
                }
+       ret = 0;
 
 err:
        ERR_print_errors(bio_err);
@@ -422,7 +418,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
        /* first make sure we have a salt */
        if (!passed_salt)
                {
-#ifndef OPENSSL_NO_DES
+#ifndef NO_DES
                if (usecrypt)
                        {
                        if (*salt_malloc_p == NULL)
@@ -441,7 +437,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
                                                            * back to ASCII */
 #endif
                        }
-#endif /* !OPENSSL_NO_DES */
+#endif /* !NO_DES */
 
 #ifndef NO_MD5CRYPT_1
                if (use1 || useapr1)
@@ -476,7 +472,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
        assert(strlen(passwd) <= pw_maxlen);
        
        /* now compute password hash */
-#ifndef OPENSSL_NO_DES
+#ifndef NO_DES
        if (usecrypt)
                hash = des_crypt(passwd, *salt_p);
 #endif