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:33:00 +0200 |
commit | 87728c682995d0575b52a5a19d69405bb764e76e (patch) | |
tree | aad00755e8a3edd5cbc7662322113a8258ecc71b /crypto/asn1/charmap.pl | |
parent | cbacc6f7e96b2d6d6d2ae3c1984ca7df439fe4c5 (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>
(cherry picked from commit bc776510982b3768761d32c1160e79cb45a561c3)
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 25ebf2c205..6c6eb34ea2 100644 --- a/crypto/asn1/charmap.pl +++ b/crypto/asn1/charmap.pl @@ -18,6 +18,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) @@ -49,6 +50,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; @@ -71,7 +80,7 @@ print <<EOF; * Mask of various character properties */ -static unsigned char char_type[] = { +static unsigned short char_type[] = { EOF for($i = 0; $i < 128; $i++) { |