(defun epg-decode-quotedstring (string)
(let ((index 0))
- (while (string-match "\\\\\\(\\([,=+<>#;\\\"]\\)\\|x?\\([0-9A-Fa-f][0-9A-Fa-f]\\)\\)" string index)
+ (while (string-match "\\\\\\(\\([,=+<>#;\\\"]\\)\\|\
+\\([0-9A-Fa-f][0-9A-Fa-f]\\)\\|\\(.\\)\\)"
+ string index)
(if (match-beginning 2)
(setq string (replace-match "\\2" t nil string)
index (1+ index))
- (setq string (replace-match "\\x\\3" t nil string)
- index (+ index 4))))
+ (if (match-beginning 3)
+ (setq string (replace-match "\\x\\3" t nil string)
+ index (+ index 4))
+ (setq string (replace-match "\\\\\\\\\\4" t nil string)
+ index (+ index 4)))))
(car (read-from-string (concat "\"" string "\"")))))
(defun epg-dn-from-string (string)
(unless type
(error "Invalid type"))
(if (eq index (string-match
- "\\([^,=+<>#;\\\"]\\|\
-\\\\[,=+<>#;\\\"]\\|\\\\x?[0-9A-Fa-f][0-9A-Fa-f]\\)+"
+ "\\([^,=+<>#;\\\"]\\|\\\\.\\)+"
string index))
(setq index (match-end 0)
value (epg-decode-quotedstring (match-string 0 string)))
(if (eq index (string-match "#\\([0-9A-Fa-f]+\\)" string index))
(setq index (match-end 0)
value (epg-decode-hexstring (match-string 1 string)))
- (if (eq index (string-match "\"\\([^\\\"]\\|\
-\\(\\\\[,=+<>#;\\\"]\\|\\\\x?[0-9A-Fa-f][0-9A-Fa-f]\\)\\)*\""
+ (if (eq index (string-match "\"\\([^\\\"]\\|\\\\.\\)*\""
string index))
(setq index (match-end 0)
value (epg-decode-quotedstring (match-string 0 string))))))