]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/asn1/a_print.c
Support the EBCDIC character set and BS2000/OSD-POSIX (work in progress).
[thirdparty/openssl.git] / crypto / asn1 / a_print.c
index 3d7629089c9a6366d57f7bb66fb3fe4d05018830..cdec7a1561d873c99729b308f0cec80c185f1e28 100644 (file)
@@ -95,6 +95,7 @@ int ASN1_PRINTABLE_type(unsigned char *s, int len)
        while ((*s) && (len-- != 0))
                {
                c= *(s++);
+#ifndef CHARSET_EBCDIC
                if (!(  ((c >= 'a') && (c <= 'z')) ||
                        ((c >= 'A') && (c <= 'Z')) ||
                        (c == ' ') ||
@@ -108,6 +109,13 @@ int ASN1_PRINTABLE_type(unsigned char *s, int len)
                        ia5=1;
                if (c&0x80)
                        t61=1;
+#else
+               if (!isalnum(c) && (c != ' ') &&
+                   strchr("'()+,-./:=?", c) == NULL)
+                       ia5=1;
+               if (os_toascii[c] & 0x80)
+                       t61=1;
+#endif
                }
        if (t61) return(V_ASN1_T61STRING);
        if (ia5) return(V_ASN1_IA5STRING);