* mm-view.el (mm-view-pkcs7-verify): New function. A bogus
authorShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 1 Mar 2002 14:01:26 +0000 (14:01 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 1 Mar 2002 14:01:26 +0000 (14:01 +0000)
implementation of PKCS#7, which just allows users read the
message.
(mm-view-pkcs7): Use it.

lisp/ChangeLog
lisp/mm-view.el

index 0948d48..9276908 100644 (file)
@@ -1,3 +1,10 @@
+2002-03-01  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * mm-view.el (mm-view-pkcs7-verify): New function. A bogus
+       implementation of PKCS#7, which just allows users read the
+       message.
+       (mm-view-pkcs7): Use it.
+
 2002-02-27  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus.el (large-newsgroup-initial): New parameter.
index 7ba9115..4461376 100644 (file)
@@ -572,8 +572,25 @@ will not be substituted.")
 (defun mm-view-pkcs7 (handle)
   (case (mm-view-pkcs7-get-type handle)
     (enveloped (mm-view-pkcs7-decrypt handle))
+    (signed (mm-view-pkcs7-verify handle))
     (otherwise (error "Unknown or unimplemented PKCS#7 type"))))
 
+(defun mm-view-pkcs7-verify (handle)
+  ;; A bogus implementation of PKCS#7. FIXME::
+  (mm-insert-part handle)
+  (goto-char (point-min))
+  (if (search-forward "Content-Type: " nil t)
+      (delete-region (point-min) (match-beginning 0)))
+  (goto-char (point-max))
+  (if (re-search-backward "--\r?\n?" nil t)
+      (delete-region (match-end 0) (point-max)))
+  (goto-char (point-min))
+  (while (search-forward "\r\n" nil t)
+    (replace-match "\n"))
+  (message "Verify signed PKCS#7 message is unimplemented.")
+  (sit-for 1)
+  t)
+
 (defun mm-view-pkcs7-decrypt (handle)
   (insert-buffer (mm-handle-buffer handle))
   (goto-char (point-min))