diff options
-rw-r--r-- | pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java index 20c124dbc..c45798281 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java @@ -766,8 +766,21 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe if (c == ',' || c == '=' || c == '+' || c == '<' || c == '>' || c == '#' || c == ';' || c == '\r' || c == '\n' || c == '\\' || c == '"') { + if ((c == 0x5c) && ((i+1) < v.length())) { + int nextC = v.charAt(i+1); + if ((c == 0x5c) && (nextC == ',' || nextC == '=' || nextC == '+' || + nextC == '<' || nextC == '>' || nextC == '#' || + nextC == ';' || nextC == '\r' || nextC == '\n' || + nextC == '\\' || nextC == '"')) { + if (doubleEscape) result.append('\\'); + } else { result.append('\\'); if (doubleEscape) result.append('\\'); + } + } else { + result.append('\\'); + if (doubleEscape) result.append('\\'); + } } if (c == '\r') { result.append("0D"); |