- strlcpy(msg, "Bad passphrase, try again: ", sizeof msg);
+ snprintf(msg, sizeof msg,
+ "Bad passphrase, try again for %.200s: ", comment);
- if (ssh_add_identity_constrained(ac, private, comment, lifetime,
- confirm)) {
+ if (ssh_add_identity_constrained(ac, private, comment, lifetime,
+ confirm)) {
fprintf(stderr, "Identity added: %s (%s)\n", filename, comment);
ret = 0;
if (lifetime != 0)
fprintf(stderr,
"Lifetime set to %d seconds\n", lifetime);
fprintf(stderr, "Identity added: %s (%s)\n", filename, comment);
ret = 0;
if (lifetime != 0)
fprintf(stderr,
"Lifetime set to %d seconds\n", lifetime);
fprintf(stderr,
"The user has to confirm each use of the key\n");
} else if (ssh_add_identity(ac, private, comment)) {
fprintf(stderr,
"The user has to confirm each use of the key\n");
} else if (ssh_add_identity(ac, private, comment)) {
- if (ssh_update_card(ac, add, id, pin)) {
+ if (ssh_update_card(ac, add, id, pin, lifetime, confirm)) {
fprintf(stderr, "Card %s: %s\n",
add ? "added" : "removed", id);
fprintf(stderr, "Card %s: %s\n",
add ? "added" : "removed", id);
} else {
fprintf(stderr, "Could not %s card: %s\n",
add ? "add" : "remove", id);
} else {
fprintf(stderr, "Could not %s card: %s\n",
add ? "add" : "remove", id);
char *sc_reader_id = NULL;
int i, ch, deleting = 0, ret = 0;
char *sc_reader_id = NULL;
int i, ch, deleting = 0, ret = 0;
snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir,
default_files[i]);
if (stat(buf, &st) < 0)
snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir,
default_files[i]);
if (stat(buf, &st) < 0)