Don't use strcasecmp and strncasecmp for IA5 strings
authorMatt Caswell <matt@openssl.org>
Fri, 20 Oct 2017 16:11:03 +0000 (17:11 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 26 Oct 2017 13:53:16 +0000 (14:53 +0100)
commit6d2fbe914c2ead67d0f49f74fabe9e65519dcf91
tree42aee4b43b05a3674c8fbeb391635db797579741
parent2e6d51d7674eacfd1941e910a56c6897443a9c19
Don't use strcasecmp and strncasecmp for IA5 strings

The functions strcasecmp() and strncasecmp() will use locale specific rules
when performing comparison. This could cause some problems in certain
locales. For example in the Turkish locale an 'I' character is not the
uppercase version of 'i'. However IA5 strings should not use locale specific
rules, i.e. for an IA5 string 'I' is uppercase 'i' even if using the
Turkish locale.

This fixes a bug in name constraints checking reported by Thomas Pornin
(NCCGroup).

This is not considered a security issue because it would require both a
Turkish locale (or other locale with similar issues) and malfeasance by
a trusted name-constrained CA for a certificate to pass name constraints
in error. The constraints also have to be for excluded sub-trees which are
extremely rare. Failure to match permitted subtrees is a bug, not a
vulnerability.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4569)

(cherry picked from commit 9cde5f81222fd491d6d56eb8f37ab9c40a26f745)
crypto/x509v3/v3_ncons.c