mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
A bunch of changes for the openpgp card.
This commit is contained in:
parent
0c67c75cbe
commit
577d9c2342
19 changed files with 1958 additions and 263 deletions
|
@ -169,8 +169,7 @@ print_sha1_fpr_colon (FILE *fp, const unsigned char *fpr)
|
|||
static void
|
||||
print_name (FILE *fp, const char *text, const char *name)
|
||||
{
|
||||
tty_fprintf (fp, text);
|
||||
|
||||
tty_fprintf (fp, "%s", text);
|
||||
|
||||
/* FIXME: tty_printf_utf8_string2 eats everything after and
|
||||
including an @ - e.g. when printing an url. */
|
||||
|
@ -192,7 +191,7 @@ print_isoname (FILE *fp, const char *text, const char *tag, const char *name)
|
|||
if (opt.with_colons)
|
||||
fprintf (fp, "%s:", tag);
|
||||
else
|
||||
tty_fprintf (fp, text);
|
||||
tty_fprintf (fp, "%s", text);
|
||||
|
||||
if (name && *name)
|
||||
{
|
||||
|
@ -446,6 +445,14 @@ change_name (void)
|
|||
if (*p == ' ')
|
||||
*p = '<';
|
||||
|
||||
if (strlen (isoname) > 39 )
|
||||
{
|
||||
tty_printf (_("Error: Combined name too long "
|
||||
"(limit is %d characters).\n"), 39);
|
||||
xfree (isoname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
log_debug ("setting Name to `%s'\n", isoname);
|
||||
rc = agent_scd_setattr ("DISP-NAME", isoname, strlen (isoname) );
|
||||
if (rc)
|
||||
|
@ -468,6 +475,14 @@ change_url (void)
|
|||
trim_spaces (url);
|
||||
cpr_kill_prompt ();
|
||||
|
||||
if (strlen (url) > 254 )
|
||||
{
|
||||
tty_printf (_("Error: URL too long "
|
||||
"(limit is %d characters).\n"), 254);
|
||||
xfree (url);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = agent_scd_setattr ("PUBKEY-URL", url, strlen (url) );
|
||||
if (rc)
|
||||
log_error ("error setting URL: %s\n", gpg_strerror (rc));
|
||||
|
@ -488,6 +503,14 @@ change_login (void)
|
|||
trim_spaces (data);
|
||||
cpr_kill_prompt ();
|
||||
|
||||
if (strlen (data) > 254 )
|
||||
{
|
||||
tty_printf (_("Error: Login data too long "
|
||||
"(limit is %d characters).\n"), 254);
|
||||
xfree (data);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = agent_scd_setattr ("LOGIN-DATA", data, strlen (data) );
|
||||
if (rc)
|
||||
log_error ("error setting login data: %s\n", gpg_strerror (rc));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue