x509: Do not mark generated addrblock extension as critical
authorMartin Willi <martin@strongswan.org>
Tue, 21 Feb 2017 15:54:57 +0000 (16:54 +0100)
committerMartin Willi <martin@strongswan.org>
Mon, 27 Feb 2017 08:36:48 +0000 (09:36 +0100)
While RFC 3779 says we SHOULD mark it is critical, this has severe side effects
in practice. The addrblock extension is not widely used nor implemented, and
only a few applications can handle this extension. By marking it critical,
none of these applications can make use of such certificates where included
addrblocks do not matter, such as TLS/HTTPS.

If an application wants to make use of addrblocks, that is usually an explicit
decision. Then the very same application obviously can handle addrblocks, and
there is no need for the extension to be critical. In other words, for local
policy checks it is a local matter to handle the extension, hence making it
critical is usually not of much help.

src/libstrongswan/plugins/x509/x509_cert.c

index 2c03e97..b77c5db 100644 (file)
@@ -2289,9 +2289,8 @@ static bool generate(private_x509_cert_t *cert, certificate_t *sign_cert,
                                                        chunk_from_chars(0x00,0x02)),
                                                asn1_wrap(ASN1_SEQUENCE, "m", v6blocks));
                }
-               ipAddrBlocks = asn1_wrap(ASN1_SEQUENCE, "mmm",
+               ipAddrBlocks = asn1_wrap(ASN1_SEQUENCE, "mm",
                                                asn1_build_known_oid(OID_IP_ADDR_BLOCKS),
-                                               asn1_wrap(ASN1_BOOLEAN, "c", chunk_from_chars(0xFF)),
                                                asn1_wrap(ASN1_OCTET_STRING, "m",
                                                        asn1_wrap(ASN1_SEQUENCE, "mm",
                                                                v4blocks, v6blocks)));