crypt32: Don't check for the TLV after indefinite-length sequence items, the item's decoder has already done so.

This commit is contained in:
Juan Lang 2008-12-19 15:37:35 -08:00 committed by Alexandre Julliard
parent 09aec4f155
commit fa65c3f634
1 changed files with 4 additions and 20 deletions

View File

@ -376,26 +376,10 @@ static BOOL CRYPT_AsnDecodeSequenceItems(struct AsnDecodeSequenceItem items[],
} }
else else
{ {
if (itemLen == CMSG_INDEFINITE_LENGTH) ptr += itemDecoded;
{ decoded += itemDecoded;
if (itemDecoded > itemEncodedLen - 2 || TRACE("item %d: decoded %d bytes\n", i,
*(ptr + itemDecoded) != 0 || itemDecoded);
*(ptr + itemDecoded + 1) != 0)
{
TRACE("expected 0 TLV\n");
SetLastError(CRYPT_E_ASN1_CORRUPT);
ret = FALSE;
}
else
itemDecoded += 2;
}
if (ret)
{
ptr += itemDecoded;
decoded += itemDecoded;
TRACE("item %d: decoded %d bytes\n", i,
itemDecoded);
}
} }
} }
else if (items[i].optional && else if (items[i].optional &&