Subject: What to do with incorrectly encoded X509 extensions ?

From: "Julien Stern" <[email-masked]>
Date: Wed, 22 Jan 2003 12:25:13 +0100

Hi all,

it seems that the sample certificate pkix-ex3.ber which can be
downloaded from http://www.imc.org/ietf-pkix/index.html has extensions
which are not correct ASN.1 wise (some non-optional fields are missing).

More specifically the Certificate Policies Extension seems to contains an
incorrect DER encoding within the octet string (missing 'qualifier'
field in a PolicyQualifierInfo).

If an extension is critical, and does not decode correctly,
I assume the only option is to reject the whole certificate.

In the present case, the extension is marked non-critical, so one option is
to ignore it, just when an OID is not understood. However, the situation
here is slightly different: the extension is understood, but invalid
with respect to the standard. So should I simply ignore this extension
or dismiss the whole certificate ?

Sincerely,

--
Julien Stern
Cryptolog International

---

From: Russ Housley <[email-masked]>
Date: Thu, 23 Jan 2003 09:06:17 -0500

Julien:

These example certificates are old.  They match RFC 2459, which has a known 
problem in it.  We belive that the examples in RFC 3280 correct this 
problem.  We are working to get the binary versions of the RFC 3280 
certificates and CRLs to Paul for posting on his web page.

Russ

---

From: "Julien Stern" <[email-masked]>
Date: Thu, 23 Jan 2003 15:30:29 +0100

Russ:

Thank a lot for your answer. I'll check from time to time to
see if they are updated.

However, this specific certificate raised the question of what to
do when an extension is incorrect (ASN.1 wise).

If a non-critical extension, say Certificate Policies or Authority
Key Identifier for example, is understood by our software but is
not correctly encoded, should we consider the whole certificate is
invalid or should we just ignore the extension, just as if we did not
understand the corresponding OID?

Both decisions seem to make sense to me:
- in the first case the rationale is that the certificate does not
  respect the profile and should therefore be dismissed
- in the second case the rationale is that we try to do our best
  to accomodate weird certificates and simply dismiss the extension
  as it is non-critical anyway

Does the standard specify the required behavior in some place I've
missed? Or should this decision be taken by the application?

Sincerely,

--
Julien Stern
Cryptolog International