aboutsummaryrefslogtreecommitdiffstats
path: root/g10/card-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/card-util.c')
-rw-r--r--g10/card-util.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/g10/card-util.c b/g10/card-util.c
index a396b7df4..8a03a26cf 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -212,6 +212,7 @@ get_manufacturer (unsigned int no)
case 0x000A: return "Dangerous Things";
case 0x002A: return "Magrathea";
+ case 0x0042: return "GnuPG e.V.";
case 0x1337: return "Warsaw Hackerspace";
case 0x2342: return "warpzone"; /* hackerspace Muenster. */
@@ -1121,7 +1122,8 @@ change_cafpr (int fprno)
char *data;
const char *s;
int i, c, rc;
- unsigned char fpr[20];
+ unsigned char fpr[MAX_FINGERPRINT_LEN];
+ int fprlen;
data = cpr_get ("cardedit.change_cafpr", _("CA fingerprint: "));
if (!data)
@@ -1129,7 +1131,7 @@ change_cafpr (int fprno)
trim_spaces (data);
cpr_kill_prompt ();
- for (i=0, s=data; i < 20 && *s; )
+ for (i=0, s=data; i < MAX_FINGERPRINT_LEN && *s; )
{
while (spacep(s))
s++;
@@ -1143,8 +1145,9 @@ change_cafpr (int fprno)
fpr[i++] = c;
s += 2;
}
+ fprlen = i;
xfree (data);
- if (i != 20 || *s)
+ if ((fprlen != 20 && fprlen != 32) || *s)
{
tty_printf (_("Error: invalid formatted fingerprint.\n"));
return -1;
@@ -1152,7 +1155,7 @@ change_cafpr (int fprno)
rc = agent_scd_setattr (fprno==1?"CA-FPR-1":
fprno==2?"CA-FPR-2":
- fprno==3?"CA-FPR-3":"x", fpr, 20, NULL );
+ fprno==3?"CA-FPR-3":"x", fpr, fprlen, NULL );
if (rc)
log_error ("error setting cafpr: %s\n", gpg_strerror (rc));
write_sc_op_status (rc);
@@ -1314,12 +1317,11 @@ show_keysize_warning (void)
return;
shown = 1;
tty_printf
- (_("Note: There is no guarantee that the card "
- "supports the requested size.\n"
- " If the key generation does not succeed, "
- "please check the\n"
- " documentation of your card to see what "
- "sizes are allowed.\n"));
+ (_("Note: There is no guarantee that the card supports the requested\n"
+ " key type or size. If the key generation does not succeed,\n"
+ " please check the documentation of your card to see which\n"
+ " key types and sizes are supported.\n")
+ );
}
@@ -1379,8 +1381,12 @@ ask_card_keyattr (int keyno, unsigned int nbits)
}
else
{
+ char name[30];
+
+ snprintf (name, sizeof name, "rsa%u", req_nbits);
tty_printf (_("The card will now be re-configured"
- " to generate a key of %u bits\n"), req_nbits);
+ " to generate a key of type: %s\n"),
+ name);
show_keysize_warning ();
return req_nbits;
}