"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mkpasswd.c" between
whois_5.5.3.tar.xz and whois_5.5.4.tar.xz

About: whois is an improved whois client (searching in a RFC-3912 database)

mkpasswd.c  (whois_5.5.3.tar.xz):mkpasswd.c  (whois_5.5.4.tar.xz)
skipping to change at line 100 skipping to change at line 100
static const struct crypt_method methods[] = { static const struct crypt_method methods[] = {
/* method prefix minlen, maxlen rounds description */ /* method prefix minlen, maxlen rounds description */
#ifdef CRYPT_GENSALT_IMPLEMENTS_DEFAULT_PREFIX #ifdef CRYPT_GENSALT_IMPLEMENTS_DEFAULT_PREFIX
{ "auto", NULL, 0, 0, 0, NULL }, { "auto", NULL, 0, 0, 0, NULL },
#endif #endif
/* compatibility aliases for mkpasswd versions < 5.4.0 */ /* compatibility aliases for mkpasswd versions < 5.4.0 */
{ "des", "", 2, 2, 0, NULL }, { "des", "", 2, 2, 0, NULL },
{ "md5", "$1$", 8, 8, 0, NULL }, { "md5", "$1$", 8, 8, 0, NULL },
#if defined XCRYPT_VERSION_NUM #if defined XCRYPT_VERSION_NUM
{ "yescrypt", "$y$", 0, 0, 0, "Yescrypt" }, { "yescrypt", "$y$", 0, 0, 1, "Yescrypt" },
#if XCRYPT_VERSION_NUM >= ((4 << 16) | 4) #if XCRYPT_VERSION_NUM >= ((4 << 16) | 4)
{ "gost-yescrypt", "$gy$", 0, 0, 0, "GOST Yescrypt" }, { "gost-yescrypt", "$gy$", 0, 0, 1, "GOST Yescrypt" },
#endif #endif
{ "scrypt", "$7$", 0, 0, 0, "scrypt" }, { "scrypt", "$7$", 0, 0, 1, "scrypt" },
#endif #endif
#ifdef HAVE_BCRYPT_OBSOLETE #ifdef HAVE_BCRYPT_OBSOLETE
/* http://marc.info/?l=openbsd-misc&m=139320023202696 */ /* http://marc.info/?l=openbsd-misc&m=139320023202696 */
{ "bf", "$2a$", 22, 22, 2, "bcrypt" }, { "bf", "$2a$", 22, 22, 2, "bcrypt" },
#endif #endif
#ifdef HAVE_BCRYPT #ifdef HAVE_BCRYPT
{ "bcrypt", "$2b$", 22, 22, 2, "bcrypt" }, { "bcrypt", "$2b$", 22, 22, 2, "bcrypt" },
{ "bcrypt-a", "$2a$", 22, 22, 2, "bcrypt (obsolete $2a$ version )" }, { "bcrypt-a", "$2a$", 22, 22, 2, "bcrypt (obsolete $2a$ version )" },
#endif #endif
#if defined HAVE_SHA_CRYPT #if defined HAVE_SHA_CRYPT
skipping to change at line 179 skipping to change at line 179
textdomain(NLS_CAT_NAME); textdomain(NLS_CAT_NAME);
#endif #endif
/* prepend options from environment */ /* prepend options from environment */
argv = merge_args(getenv("MKPASSWD_OPTIONS"), argv, &argc); argv = merge_args(getenv("MKPASSWD_OPTIONS"), argv, &argc);
while ((ch = GETOPT_LONGISH(argc, argv, "hH:m:5P:R:sS:V", longopts, NULL)) while ((ch = GETOPT_LONGISH(argc, argv, "hH:m:5P:R:sS:V", longopts, NULL))
> 0) { > 0) {
switch (ch) { switch (ch) {
case '5': case '5':
optarg = (char *) "md5"; optarg = (char *) "md5crypt";
/* fall through */ /* fall through */
case 'm': case 'm':
case 'H': case 'H':
if (!optarg || strcaseeq("help", optarg)) { if (!optarg || strcaseeq("help", optarg)) {
display_methods(); display_methods();
exit(0); exit(0);
} }
#if defined HAVE_LINUX_CRYPT_GENSALT || defined HAVE_SOLARIS_CRYPT_GENSALT #if defined HAVE_LINUX_CRYPT_GENSALT || defined HAVE_SOLARIS_CRYPT_GENSALT
if (optarg[0] == '$' if (optarg[0] == '$'
&& strlen(optarg) > 2 && strlen(optarg) > 2
skipping to change at line 285 skipping to change at line 285
/* bcrypt strings always contain the rounds number */ /* bcrypt strings always contain the rounds number */
if (rounds <= 5) if (rounds <= 5)
rounds = 5; rounds = 5;
/* actually it is the logarithm of the number of rounds */ /* actually it is the logarithm of the number of rounds */
snprintf(rounds_str, sizeof(rounds_str), "%02u$", rounds); snprintf(rounds_str, sizeof(rounds_str), "%02u$", rounds);
} else if (rounds_support && rounds) } else if (rounds_support && rounds)
snprintf(rounds_str, sizeof(rounds_str), "rounds=%u$", rounds); snprintf(rounds_str, sizeof(rounds_str), "rounds=%u$", rounds);
else else
rounds_str[0] = '\0'; rounds_str[0] = '\0';
if (salt_arg) { if (salt_arg && salt_arg[0] == '$')
salt = NOFAIL(strdup(salt_arg));
else if (salt_arg && salt_arg[0] != '\0') {
unsigned int c = strlen(salt_arg); unsigned int c = strlen(salt_arg);
if (c < salt_minlen || c > salt_maxlen) { if (c < salt_minlen || c > salt_maxlen) {
if (salt_minlen == salt_maxlen) if (salt_minlen == salt_maxlen)
fprintf(stderr, ngettext( fprintf(stderr, ngettext(
"Wrong salt length: %d byte when %d expected.\n", "Wrong salt length: %d byte when %d expected.\n",
"Wrong salt length: %d bytes when %d expected.\n", c), "Wrong salt length: %d bytes when %d expected.\n", c),
c, salt_maxlen); c, salt_maxlen);
else else
fprintf(stderr, ngettext( fprintf(stderr, ngettext(
"Wrong salt length: %d byte when %d <= n <= %d" "Wrong salt length: %d byte when %d <= n <= %d"
skipping to change at line 499 skipping to change at line 501
#endif /* RANDOM_DEVICE || HAVE_ARC4RANDOM_BUF || HAVE_GETENTROPY*/ #endif /* RANDOM_DEVICE || HAVE_ARC4RANDOM_BUF || HAVE_GETENTROPY*/
void NORETURN display_help(int error) void NORETURN display_help(int error)
{ {
fprintf((EXIT_SUCCESS == error) ? stdout : stderr, fprintf((EXIT_SUCCESS == error) ? stdout : stderr,
_("Usage: mkpasswd [OPTIONS]... [PASSWORD [SALT]]\n" _("Usage: mkpasswd [OPTIONS]... [PASSWORD [SALT]]\n"
"Crypts the PASSWORD using crypt(3).\n\n")); "Crypts the PASSWORD using crypt(3).\n\n"));
fprintf((EXIT_SUCCESS == error) ? stdout : stderr, _( fprintf((EXIT_SUCCESS == error) ? stdout : stderr, _(
" -m, --method=TYPE select method TYPE\n" " -m, --method=TYPE select method TYPE\n"
" -5 like --method=md5\n" " -5 like --method=md5crypt\n"
" -S, --salt=SALT use the specified SALT\n" " -S, --salt=SALT use the specified SALT\n"
)); ));
fprintf((EXIT_SUCCESS == error) ? stdout : stderr, _( fprintf((EXIT_SUCCESS == error) ? stdout : stderr, _(
" -R, --rounds=NUMBER use the specified NUMBER of rounds\n" " -R, --rounds=NUMBER use the specified NUMBER of rounds\n"
" -P, --password-fd=NUM read the password from file descriptor NUM\n" " -P, --password-fd=NUM read the password from file descriptor NUM\n"
" instead of /dev/tty\n" " instead of /dev/tty\n"
" -s, --stdin like --password-fd=0\n" " -s, --stdin like --password-fd=0\n"
)); ));
fprintf((EXIT_SUCCESS == error) ? stdout : stderr, _( fprintf((EXIT_SUCCESS == error) ? stdout : stderr, _(
" -h, --help display this help and exit\n" " -h, --help display this help and exit\n"
 End of changes. 6 change blocks. 
6 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)