Skip to content

Commit

Permalink
g10: Let card-edit/key-attr show message when change.
Browse files Browse the repository at this point in the history
* g10/card-util.c (ask_card_rsa_keysize): Don't show message here.
(ask_card_keyattr): Show message when change, also for ECC.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
  • Loading branch information
NIIBE Yutaka committed Apr 5, 2018
1 parent 83529e1 commit 870527d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions g10/card-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1389,12 +1389,7 @@ ask_card_rsa_keysize (unsigned int nbits)
"RSA", min_nbits, max_nbits);
}
else
{
tty_printf (_("The card will now be re-configured"
" to generate a key of %u bits\n"), req_nbits);
show_keysize_warning ();
return req_nbits;
}
return req_nbits;
}
}

Expand Down Expand Up @@ -1501,8 +1496,19 @@ ask_card_keyattr (int keyno, const struct key_attr *current)
}

leave:
if (!key_attr)
tty_printf (_("No change."));
if (key_attr)
{
if (key_attr->algo == PUBKEY_ALGO_RSA)
tty_printf (_("The card will now be re-configured"
" to generate a key of %u bits\n"), key_attr->nbits);
else if (key_attr->algo == PUBKEY_ALGO_ECDH
|| key_attr->algo == PUBKEY_ALGO_ECDSA
|| key_attr->algo == PUBKEY_ALGO_EDDSA)
tty_printf (_("The card will now be re-configured"
" to generate a key of type: %s\n"), key_attr->curve),

show_keysize_warning ();
}

return key_attr;
}
Expand Down

0 comments on commit 870527d

Please sign in to comment.