This has been added to avoid the situation where some host ctype.h functions
authorPauli <paul.dale@oracle.com>
Sun, 20 Aug 2017 21:19:17 +0000 (07:19 +1000)
committerPauli <paul.dale@oracle.com>
Mon, 21 Aug 2017 23:45:25 +0000 (09:45 +1000)
commita1df06b36347a31c17d09e6ca3e1464bdf7eb4d5
treebeb260df46896a5c8668dd7f64c5dcefe677b1e6
parent00dfbaad88a69ed8294d6039bf5f7d722f72bf39
This has been added to avoid the situation where some host ctype.h functions
return true for characters > 127.  I.e. they are allowing extended ASCII
characters through which then cause problems.  E.g. marking superscript '2' as
a number then causes the common (ch - '0') conversion to number to fail
miserably.  Likewise letters with diacritical marks can also cause problems.

If a non-ASCII character set is being used (currently only EBCDIC), it is
adjusted for.

The implementation uses a single table with a bit for each of the defined
classes.  These functions accept an int argument and fail for
values out of range or for characters outside of the ASCII set.  They will
work for both signed and unsigned character inputs.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4102)
34 files changed:
crypto/asn1/a_gentm.c
crypto/asn1/a_mbstr.c
crypto/asn1/a_object.c
crypto/asn1/a_print.c
crypto/asn1/a_strnid.c
crypto/asn1/a_time.c
crypto/asn1/a_utctm.c
crypto/asn1/asn_mime.c
crypto/asn1/asn_moid.c
crypto/asn1/asn_mstbl.c
crypto/asn1/f_int.c
crypto/asn1/f_string.c
crypto/bio/b_addr.c
crypto/bio/b_print.c
crypto/bn/bn_print.c
crypto/build.info
crypto/ctype.c [new file with mode: 0644]
crypto/evp/evp_cnf.c
crypto/include/internal/ctype.h [new file with mode: 0644]
crypto/o_str.c
crypto/objects/obj_dat.c
crypto/ocsp/ocsp_ht.c
crypto/pem/pem_lib.c
crypto/pkcs7/pk7_mime.c
crypto/store/loader_file.c
crypto/store/store_register.c
crypto/x509/x509_cmp.c
crypto/x509/x509_vfy.c
crypto/x509/x_name.c
crypto/x509v3/v3_conf.c
crypto/x509v3/v3_utl.c
test/build.info
test/ctype_internal_test.c [new file with mode: 0644]
test/recipes/02-test_internal_ctype.t [new file with mode: 0644]