Correct PKCS7 regexps to match messages with 0x0a bytes.
authorRoy Hashimoto <roy.hashimoto@gmail.com>
Sun, 9 Jun 2013 17:37:15 +0000 (17:37 +0000)
committerDaiki Ueno <ueno@gnu.org>
Mon, 10 Jun 2013 04:55:35 +0000 (13:55 +0900)
Signed-off-by: Roy Hashimoto <roy.hashimoto@gmail.com>
lisp/ChangeLog
lisp/mm-view.el

index ec2e7db..02a13e1 100644 (file)
@@ -1,3 +1,9 @@
+2013-06-10  Roy Hashimoto <roy.hashimoto@gmail.com>  (tiny change)
+
+       * mm-view.el (mm-pkcs7-signed-magic): Allow newline in the regexp and
+       make it easier to read.
+       (mm-pkcs7-enveloped-magic): Ditto.
+
 2013-06-06  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus-ems.el (gnus-image-type-available-p): Test `display-images-p'
index ac6170a..b1cba27 100644 (file)
@@ -660,14 +660,26 @@ If MODE is not set, try to find mode automatically."
 ;;      id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
 ;;          us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
 (defvar mm-pkcs7-signed-magic
-  "\x30\x5c\x28\x80\x5c\x7c\x81\x2e\x5c\x7c\x82\x2e\x2e\x5c\x7c\x83\x2e\x2e\
-\x2e\x5c\x29\x06\x09\x5c\x2a\x86\x48\x86\xf7\x0d\x01\x07\x02")
+  (concat
+    "0"
+    "\\(\\(\x80\\)"
+    "\\|\\(\x81\\(.\\|\n\\)\\{1\\}\\)"
+    "\\|\\(\x82\\(.\\|\n\\)\\{2\\}\\)"
+    "\\|\\(\x83\\(.\\|\n\\)\\{3\\}\\)"
+    "\\)"
+    "\x06\x09\\*\x86H\x86\xf7\x0d\x01\x07\x02"))
 
 ;;      id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
 ;;          us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 }
 (defvar mm-pkcs7-enveloped-magic
-  "\x30\x5c\x28\x80\x5c\x7c\x81\x2e\x5c\x7c\x82\x2e\x2e\x5c\x7c\x83\x2e\x2e\
-\x2e\x5c\x29\x06\x09\x5c\x2a\x86\x48\x86\xf7\x0d\x01\x07\x03")
+  (concat
+    "0"
+    "\\(\\(\x80\\)"
+    "\\|\\(\x81\\(.\\|\n\\)\\{1\\}\\)"
+    "\\|\\(\x82\\(.\\|\n\\)\\{2\\}\\)"
+    "\\|\\(\x83\\(.\\|\n\\)\\{3\\}\\)"
+    "\\)"
+    "\x06\x09\\*\x86H\x86\xf7\x0d\x01\x07\x03"))
 
 (defun mm-view-pkcs7-get-type (handle)
   (mm-with-unibyte-buffer