|
Lines 287-300
add_file(AuthenticationConnection *ac, c
Link Here
|
| 287 |
static int |
287 |
static int |
| 288 |
update_card(AuthenticationConnection *ac, int add, const char *id) |
288 |
update_card(AuthenticationConnection *ac, int add, const char *id) |
| 289 |
{ |
289 |
{ |
| 290 |
char *pin; |
290 |
char *pin = NULL; |
| 291 |
int ret = -1; |
291 |
int ret = -1; |
| 292 |
|
292 |
|
| 293 |
pin = read_passphrase("Enter passphrase for PKCS#11: ", RP_ALLOW_STDIN); |
293 |
if (add) { |
| 294 |
if (pin == NULL) |
294 |
if ((pin = read_passphrase("Enter passphrase for PKCS#11: ", |
| 295 |
return -1; |
295 |
RP_ALLOW_STDIN)) == NULL) |
|
|
296 |
return -1; |
| 297 |
} |
| 296 |
|
298 |
|
| 297 |
if (ssh_update_card(ac, add, id, pin, lifetime, confirm)) { |
299 |
if (ssh_update_card(ac, add, id, pin == NULL ? "" : pin, |
|
|
300 |
lifetime, confirm)) { |
| 298 |
fprintf(stderr, "Card %s: %s\n", |
301 |
fprintf(stderr, "Card %s: %s\n", |
| 299 |
add ? "added" : "removed", id); |
302 |
add ? "added" : "removed", id); |
| 300 |
ret = 0; |
303 |
ret = 0; |