提交 7ed485bc 编写于 作者: D Dr. Stephen Henson

The OID sanity check was incorrect. It should only disallow *leading* 0x80

values.
上级 069d4cfe
...@@ -904,6 +904,7 @@ bad: ...@@ -904,6 +904,7 @@ bad:
else if (text == i) else if (text == i)
{ {
X509_print_ex(out,x,nmflag, certflag); X509_print_ex(out,x,nmflag, certflag);
ERR_print_errors_fp(stderr);
} }
else if (startdate == i) else if (startdate == i)
{ {
......
...@@ -290,12 +290,12 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, ...@@ -290,12 +290,12 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
const unsigned char *p; const unsigned char *p;
unsigned char *data; unsigned char *data;
int i; int i;
/* Sanity check OID encoding: can't have 0x80 in subidentifiers, see: /* Sanity check OID encoding: can't have leading 0x80 in
* X.690 8.19.2 * subidentifiers, see: X.690 8.19.2
*/ */
for (i = 0, p = *pp + 1; i < len - 1; i++, p++) for (i = 0, p = *pp + 1; i < len - 1; i++, p++)
{ {
if (*p == 0x80) if (*p == 0x80 && (!i || !(p[-1] & 0x80)))
{ {
ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING); ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING);
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册