summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/x509.c1
-rw-r--r--crypto/asn1/a_object.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/apps/x509.c b/apps/x509.c
index e7e46d7b63..7f55cd1acb 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -904,6 +904,7 @@ bad:
else if (text == i)
{
X509_print_ex(out,x,nmflag, certflag);
+ERR_print_errors_fp(stderr);
}
else if (startdate == i)
{
diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c
index bd2d5a2d82..e5fbe7cbb1 100644
--- a/crypto/asn1/a_object.c
+++ b/crypto/asn1/a_object.c
@@ -290,12 +290,12 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
const unsigned char *p;
unsigned char *data;
int i;
- /* Sanity check OID encoding: can't have 0x80 in subidentifiers, see:
- * X.690 8.19.2
+ /* Sanity check OID encoding: can't have leading 0x80 in
+ * subidentifiers, see: X.690 8.19.2
*/
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);
return NULL;