(mml2015-epg-verify): Simplified.
authorDaiki Ueno <ueno@unixuser.org>
Tue, 20 Feb 2007 02:32:44 +0000 (02:32 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Tue, 20 Feb 2007 02:32:44 +0000 (02:32 +0000)
lisp/ChangeLog
lisp/mml2015.el

index e0b82ea..82ae2be 100644 (file)
@@ -1,3 +1,7 @@
+2007-02-20  Daiki Ueno  <ueno@unixuser.org>
+
+       * mml2015.el (mml2015-epg-verify): Simplified.
+
 2007-02-19  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * mml.el (mml-content-disposition-alist): New user option.
index 71c4ee6..2644539 100644 (file)
@@ -1069,7 +1069,7 @@ Whether the passphrase is cached at all is controlled by
 (defun mml2015-epg-verify (handle ctl)
   (catch 'error
     (let ((inhibit-redisplay t)
-         context plain signature-file part signature (index 0))
+         context plain signature-file part signature)
       (when (or (null (setq part (mm-find-raw-part-by-type
                                  ctl (or (mm-handle-multipart-ctl-parameter
                                           ctl 'protocol)
@@ -1081,14 +1081,11 @@ Whether the passphrase is cached at all is controlled by
        (mm-set-handle-multipart-parameter
         mm-security-handle 'gnus-info "Corrupted")
        (throw 'error handle))
-      (while (string-match "\r?\n" part index)
-       (if (eq (aref part (match-beginning 0)) ?\r)
-           (setq index (match-end 0))
-         (setq part (replace-match "\r\n" t t part)
-               index (1+ (match-end 0)))))
-      (setq context (epg-make-context))
+      (setq part (mm-replace-in-string part "\n" "\r\n")
+           signature (mm-get-part signature)
+           context (epg-make-context))
       (condition-case error
-         (setq plain (epg-verify-string context (mm-get-part signature) part))
+         (setq plain (epg-verify-string context signature part))
        (error
         (mm-set-handle-multipart-parameter
          mm-security-handle 'gnus-info "Failed")