提交 4e0d184a 编写于 作者: D Dr. Stephen Henson

Fix name length limit check.

The name length limit check in x509_name_ex_d2i() includes
the containing structure as well as the actual X509_NAME. This will
cause large CRLs to be rejected.

Fix by limiting the length passed to ASN1_item_ex_d2i() which will
then return an error if the passed X509_NAME exceeds the length.

RT#4531
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 c73aa309
...@@ -194,10 +194,8 @@ static int x509_name_ex_d2i(ASN1_VALUE **val, ...@@ -194,10 +194,8 @@ static int x509_name_ex_d2i(ASN1_VALUE **val,
int i, j, ret; int i, j, ret;
STACK_OF(X509_NAME_ENTRY) *entries; STACK_OF(X509_NAME_ENTRY) *entries;
X509_NAME_ENTRY *entry; X509_NAME_ENTRY *entry;
if (len > X509_NAME_MAX) { if (len > X509_NAME_MAX)
ASN1err(ASN1_F_X509_NAME_EX_D2I, ASN1_R_TOO_LONG); len = X509_NAME_MAX;
return 0;
}
q = p; q = p;
/* Get internal representation of Name */ /* Get internal representation of Name */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册