1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-31 22:18:03 +02:00

2006-08-28 Marcus Brinkmann <marcus@g10code.de>

* app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
        resp. "OPENPGP.1" for KEYIDSTR.
This commit is contained in:
Marcus Brinkmann 2006-08-29 18:29:30 +00:00
parent d8602648b8
commit 8ffa3b4cbb
2 changed files with 47 additions and 34 deletions

View File

@ -1,3 +1,8 @@
2006-08-28 Marcus Brinkmann <marcus@g10code.de>
* app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
resp. "OPENPGP.1" for KEYIDSTR.
2006-08-21 Werner Koch <wk@g10code.com>
* pcsc-wrapper.c (handle_open, handle_close): Reset card and

View File

@ -2128,9 +2128,12 @@ do_sign (app_t app, const char *keyidstr, int hashalgo,
}
/* Check whether an OpenPGP card of any version has been requested. */
if (strlen (keyidstr) < 32 || strncmp (keyidstr, "D27600012401", 12))
if (!strcmp (keyidstr, "OPENPGP.1"))
;
else if (strlen (keyidstr) < 32 || strncmp (keyidstr, "D27600012401", 12))
return gpg_error (GPG_ERR_INV_ID);
else
{
for (s=keyidstr, n=0; hexdigitp (s); s++, n++)
;
if (n != 32)
@ -2149,6 +2152,7 @@ do_sign (app_t app, const char *keyidstr, int hashalgo,
return gpg_error (GPG_ERR_INV_CARD);
if (memcmp (app->serialno, tmp_sn, 16))
return gpg_error (GPG_ERR_WRONG_CARD);
}
/* If a fingerprint has been specified check it against the one on
the card. This is allows for a meaningful error message in case
@ -2322,9 +2326,12 @@ do_decipher (app_t app, const char *keyidstr,
return gpg_error (GPG_ERR_INV_VALUE);
/* Check whether an OpenPGP card of any version has been requested. */
if (strlen (keyidstr) < 32 || strncmp (keyidstr, "D27600012401", 12))
if (!strcmp (keyidstr, "OPENPGP.2"))
;
else if (strlen (keyidstr) < 32 || strncmp (keyidstr, "D27600012401", 12))
return gpg_error (GPG_ERR_INV_ID);
else
{
for (s=keyidstr, n=0; hexdigitp (s); s++, n++)
;
if (n != 32)
@ -2343,6 +2350,7 @@ do_decipher (app_t app, const char *keyidstr,
return gpg_error (GPG_ERR_INV_CARD);
if (memcmp (app->serialno, tmp_sn, 16))
return gpg_error (GPG_ERR_WRONG_CARD);
}
/* If a fingerprint has been specified check it against the one on
the card. This is allows for a meaningful error message in case