diff options
author | Richard Levitte <levitte@openssl.org> | 2016-05-18 17:14:19 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-05-18 18:30:00 +0200 |
commit | bc776510982b3768761d32c1160e79cb45a561c3 (patch) | |
tree | f8df91513d99c083b1666196b99b3b3b4f8efbc6 /crypto/asn1/charmap.pl | |
parent | 52832e470f5fe8c222249ae5b539aeb3c74cdb25 (diff) |
Make it possible to have RFC2254 escapes with ASN1_STRING_print_ex()
Also adds 'esc_2254' to the possible command line name options
RT#1466
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/asn1/charmap.pl')
-rw-r--r-- | crypto/asn1/charmap.pl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crypto/asn1/charmap.pl b/crypto/asn1/charmap.pl index db150217c5..a3511da072 100644 --- a/crypto/asn1/charmap.pl +++ b/crypto/asn1/charmap.pl @@ -21,6 +21,7 @@ my $NOESC_QUOTE = 8; # Not escaped if quoted my $PSTRING_CHAR = 0x10; # Valid PrintableString character my $RFC2253_FIRST_ESC = 0x20; # Escaped with \ if first character my $RFC2253_LAST_ESC = 0x40; # Escaped with \ if last character +my $RFC2254_ESC = 0x400; # Character escaped \XX for($i = 0; $i < 128; $i++) { # Set the RFC2253 escape characters (control) @@ -52,6 +53,14 @@ $arr[ord("<")] |= $NOESC_QUOTE | $RFC2253_ESC; $arr[ord(">")] |= $NOESC_QUOTE | $RFC2253_ESC; $arr[ord(";")] |= $NOESC_QUOTE | $RFC2253_ESC; +# Remaining RFC2254 characters + +$arr[0] |= $RFC2254_ESC; +$arr[ord("(")] |= $RFC2254_ESC; +$arr[ord(")")] |= $RFC2254_ESC; +$arr[ord("*")] |= $RFC2254_ESC; +$arr[ord("\\")] |= $RFC2254_ESC; + # Remaining PrintableString characters $arr[ord(" ")] |= $PSTRING_CHAR; @@ -86,7 +95,7 @@ print <<EOF; * Mask of various character properties */ -static const unsigned char char_type[] = { +static const unsigned short char_type[] = { EOF print " "; |