1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-10 21:38:50 +01:00

scd: Support GET DATA response with no header for DO 0x00FA.

* scd/app-openpgp.c (do_getattr): Support Gnuk, as well.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-09-04 17:16:59 +09:00
parent eba2563dab
commit 43bbc25b0f

View File

@ -1256,11 +1256,13 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name)
if (valuelen < 2) if (valuelen < 2)
return gpg_error (GPG_ERR_INV_OBJ); return gpg_error (GPG_ERR_INV_OBJ);
tag = *p++; tag = p[0];
len = *p++; len = p[1];
if (tag != 0x00FA) /* Does it comes tag+len at the head? */
return gpg_error (GPG_ERR_INV_OBJ); if (tag == 0x00FA)
{
p += 2;
if (len == 0x81) if (len == 0x81)
{ {
@ -1277,7 +1279,7 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name)
} }
valuelen -= (p - value); valuelen -= (p - value);
value = p; value = (unsigned char *)p;
if (valuelen != len) if (valuelen != len)
{ {
@ -1287,6 +1289,7 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name)
if (app->card->cardtype != CARDTYPE_YUBIKEY) if (app->card->cardtype != CARDTYPE_YUBIKEY)
return gpg_error (GPG_ERR_INV_OBJ); return gpg_error (GPG_ERR_INV_OBJ);
} }
}
for (; p < value + valuelen; p += len) for (; p < value + valuelen; p += len)
{ {