version 1.39, 2015/02/24 18:45:51 |
version 1.40, 2015/02/26 17:46:15 |
|
|
pref = login_getcapstr(lc, "localcipher", NULL, NULL); |
pref = login_getcapstr(lc, "localcipher", NULL, NULL); |
} |
} |
if (crypt_newhash(string, pref, buffer, sizeof(buffer)) != 0) |
if (crypt_newhash(string, pref, buffer, sizeof(buffer)) != 0) |
errx(1, "can't generate hash"); |
err(1, "can't generate hash"); |
|
|
fputs(buffer, stdout); |
fputs(buffer, stdout); |
} |
} |
|
|
int opt; |
int opt; |
int operation = -1; |
int operation = -1; |
int prompt = 0; |
int prompt = 0; |
char *extra = NULL; /* Store salt or number of rounds */ |
char *extra = NULL; /* Store login class or number of rounds */ |
const char *errstr; |
const char *errstr; |
|
|
while ((opt = getopt(argc, argv, "pb:c:")) != -1) { |
while ((opt = getopt(argc, argv, "pb:c:")) != -1) { |
|
|
if (strcmp(optarg, "a") != 0) { |
if (strcmp(optarg, "a") != 0) { |
(void)strtonum(optarg, 4, 31, &errstr); |
(void)strtonum(optarg, 4, 31, &errstr); |
if (errstr != NULL) |
if (errstr != NULL) |
errx(1, "rounds is %s: %s", errstr, optarg); |
errx(1, "rounds is %s: %s", errstr, |
|
optarg); |
} |
} |
extra = optarg; |
extra = optarg; |
break; |
break; |
|
|
if ((string = strdup(argv[optind])) == NULL) |
if ((string = strdup(argv[optind])) == NULL) |
err(1, NULL); |
err(1, NULL); |
/* Wipe the argument. */ |
/* Wipe the argument. */ |
memset(argv[optind], 0, strlen(argv[optind])); |
explicit_bzero(argv[optind], strlen(argv[optind])); |
|
|
print_passwd(string, operation, extra); |
print_passwd(string, operation, extra); |
|
|
(void)fputc('\n', stdout); |
(void)fputc('\n', stdout); |
|
|
/* Wipe our copy, before we free it. */ |
/* Wipe our copy, before we free it. */ |
memset(string, 0, strlen(string)); |
explicit_bzero(string, strlen(string)); |
free(string); |
free(string); |
} |
} |
exit(0); |
exit(0); |