aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/asn1/a_strex.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-13 07:49:50 +0000
committermarha <marha@users.sourceforge.net>2011-04-13 07:49:50 +0000
commit7bcdd32ccff794b9a83a88ff9bc2d0b7b088bd06 (patch)
treed5d217cd4d21932fa490076d0dea9a259a9a8a31 /openssl/crypto/asn1/a_strex.c
parent125aba11ec484309e4dc5b2abf1b15ac98784159 (diff)
downloadvcxsrv-7bcdd32ccff794b9a83a88ff9bc2d0b7b088bd06.tar.gz
vcxsrv-7bcdd32ccff794b9a83a88ff9bc2d0b7b088bd06.tar.bz2
vcxsrv-7bcdd32ccff794b9a83a88ff9bc2d0b7b088bd06.zip
Updated to openssl-1.0.0d
Diffstat (limited to 'openssl/crypto/asn1/a_strex.c')
-rw-r--r--openssl/crypto/asn1/a_strex.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/openssl/crypto/asn1/a_strex.c b/openssl/crypto/asn1/a_strex.c
index 7fc14d329..264ebf239 100644
--- a/openssl/crypto/asn1/a_strex.c
+++ b/openssl/crypto/asn1/a_strex.c
@@ -74,6 +74,11 @@
#define CHARTYPE_BS_ESC (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253)
+#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \
+ ASN1_STRFLGS_ESC_QUOTE | \
+ ASN1_STRFLGS_ESC_CTRL | \
+ ASN1_STRFLGS_ESC_MSB)
+
/* Three IO functions for sending data to memory, a BIO and
* and a FILE pointer.
@@ -148,6 +153,13 @@ static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, ch
if(!io_ch(arg, tmphex, 3)) return -1;
return 3;
}
+ /* If we get this far and do any escaping at all must escape
+ * the escape character itself: backslash.
+ */
+ if (chtmp == '\\' && flags & ESC_FLAGS) {
+ if(!io_ch(arg, "\\\\", 2)) return -1;
+ return 2;
+ }
if(!io_ch(arg, &chtmp, 1)) return -1;
return 1;
}
@@ -292,11 +304,6 @@ static const signed char tag2nbyte[] = {
4, -1, 2 /* 28-30 */
};
-#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \
- ASN1_STRFLGS_ESC_QUOTE | \
- ASN1_STRFLGS_ESC_CTRL | \
- ASN1_STRFLGS_ESC_MSB)
-
/* This is the main function, print out an
* ASN1_STRING taking note of various escape
* and display options. Returns number of