Merge pull request #3529 from SparkiDev/ocsp_single_ext

OCSP: Handle extensions in singleResponse
pull/3535/head
toddouska 2020-12-02 13:26:46 -08:00 committed by GitHub
commit 0be45e731b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -16828,6 +16828,18 @@ static int DecodeSingleResponse(byte* source,
#endif
}
/* Skip the optional extensions in singleResponse. */
localIdx = idx;
if (((int)(idx - prevIndex) < wrapperSz) &&
GetASNTag(source, &localIdx, &tag, size) == 0 &&
tag == (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 1))
{
idx++;
if (GetLength(source, &idx, &length, size) < 0)
return ASN_PARSE_E;
idx += length;
}
*ioIndex = idx;
return 0;