[Mew-dist 16248] Re: S/MIME patch

Ryutaroh Matsumoto ryutaroh at example.com
2001年 2月 8日 (木) 16:04:29 JST


パッチを添付するの忘れてました。すみません。

> 昨日私が投稿したS/MIME電子署名のパッチですが、opensslコマンドが常に実
> 行可能だと仮定していて、実行できないときに動作が変なので訂正させてくだ
> さい。

--
松本  隆太郎
-------------- next part --------------
--- mew-smime.el-1	Wed Feb  7 22:49:25 2001
+++ mew-smime.el	Thu Feb  8 15:43:52 2001
@@ -1,6 +1,6 @@
 ; This file is based on mew-pgp.el in Mew 1.94.2, whose copyright also 
 ; applies to this file. This file is originally written by Ryutaroh
-; Matsumoto <ryutaroh at example.com>, February 7, 2000.
+; Matsumoto <ryutaroh at example.com>, February 7, 2001.
 
 (provide 'mew-smime)
 
@@ -48,10 +48,13 @@
   (setq mew-smime-sign-error nil)))
 (if (string-match "exited abnormally" event) (progn
   (setq mew-smime-running nil)
-  (setq mew-smime-sign-error "openssl exit abnormally."))))
+  (setq mew-smime-sign-error "openssl exited abnormally."))))
 
 
 (defun mew-smime-sign (file1)
+  (if (not (and (mew-which-exec "openssl") (file-executable-p (mew-which-exec "openssl"))))
+   (list nil nil nil "cannot run the S/MIME signing program.")
+  (progn 
   (message "S/MIME signing ... ")
   (setq mew-smime-running 'signing)
   (let ((process-connection-type mew-connection-type2)
@@ -79,7 +82,7 @@
     (message "S/MIME signing ... done")
     (list file2 mew-b64 "sha1" mew-smime-sign-error
      (list "application/x-pkcs7-signature" (list "name" "smime.p7s"))
-     (list "attachment" (list "filename" "smime.p7s"))))) ;; return
+     (list "attachment" (list "filename" "smime.p7s"))))))) ;; return
 
 
 
@@ -90,9 +93,11 @@
 
 
 (defun mew-smime-verify (file1 file2)
-  (message "PGP verifying ... ")
-  (if (= 0 (mew-call-process-lang "openssl" nil nil nil
-    "smime" "-verify" "-inform" "DER" "-in" file2 "-content" file1
-    "-CAfile" mew-smime-CA-file))
-  "S/MIME signature verification succeeded"
-  "S/MIME signature verification failed"))
+  (message "S/MIME verifying ... ")
+  (if (not (and (mew-which-exec "openssl") (file-executable-p (mew-which-exec "openssl"))))
+   "cannot run the S/MIME signature verification program"
+   (if (equal 0 (mew-call-process-lang "openssl" nil nil nil
+     "smime" "-verify" "-inform" "DER" "-in" file2 "-content" file1
+     "-CAfile" mew-smime-CA-file))
+    "S/MIME signature verification succeeded"
+    "S/MIME signature verification failed")))
-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: 無し
型:         application/x-pkcs7-signature
サイズ:     1800 バイト
説明:       attachment; filename="smime.p7s"
URL:        <http://www.mew.org/pipermail/mew-dist/attachments/20010208/71e34ec7/attachment.bin>


Mew-dist メーリングリストの案内