#if !defined(OPENSSL_NO_DES) || !defined(NO_MD5CRYPT_1)
-# include <assert.h>
# include <string.h>
# include "apps.h"
{"quiet", OPT_QUIET, '-', "No warnings"},
{"table", OPT_TABLE, '-', "Format output as table"},
{"reverse", OPT_REVERSE, '-', "Switch table columns"},
+ {"salt", OPT_SALT, 's', "Use provided salt"},
+ {"stdin", OPT_STDIN, '-', "Read passwords from stdin"},
# ifndef NO_MD5CRYPT_1
{"apr1", OPT_APR1, '-', "MD5-based password algorithm, Apache variant"},
{"1", OPT_1, '-', "MD5-based password algorithm"},
# ifndef OPENSSL_NO_DES
{"crypt", OPT_CRYPT, '-', "Standard Unix password algorithm (default)"},
# endif
- {"salt", OPT_SALT, 's', "Use provided salt"},
- {"stdin", OPT_STDIN, '-', "Read passwords from stdin"},
{NULL}
};
goto opthelp;
# endif
+ if (!app_load_modules(NULL))
+ goto end;
+
if (infile && in_stdin) {
BIO_printf(bio_err, "%s: Can't combine -in and -stdin\n", prog);
goto end;
}
- in = bio_open_default(infile, "r");
+ in = bio_open_default(infile, 'r', FORMAT_TEXT);
if (in == NULL)
goto end;
end:
ERR_print_errors(bio_err);
- if (salt_malloc)
- OPENSSL_free(salt_malloc);
- if (passwd_malloc)
- OPENSSL_free(passwd_malloc);
+ OPENSSL_free(salt_malloc);
+ OPENSSL_free(passwd_malloc);
BIO_free(in);
return (ret);
}
int passwd_main(int argc, char **argv)
{
- fputs("Program not available.\n", stderr)
- return (1);
+ BIO_printf(bio_err, "Program not available.\n");
+ return (1);
}
#endif