fixed DoS vulnerability in the parsing of distinguished names

This commit is contained in:
Andreas Steffen
2009-06-09 22:03:33 +02:00
parent 260158e53e
commit b29832c74f
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -296,6 +296,11 @@ size_t asn1_length(chunk_t *blob)
len = 256*len + *blob->ptr++;
blob->len--;
}
if (len > blob->len)
{
DBG2("length is larger than remaining blob size");
return ASN1_INVALID_LENGTH;
}
return len;
}
+1 -1
View File
@@ -158,7 +158,7 @@ static bool iterate(private_asn1_parser_t *this, int *objectID, chunk_t *object)
blob1->len = asn1_length(blob);
if (blob1->len == ASN1_INVALID_LENGTH || blob->len < blob1->len)
if (blob1->len == ASN1_INVALID_LENGTH)
{
DBG1("L%d - %s: length of ASN.1 object invalid or too large",
level, obj.name);