[Mew-dist 16709] Re: b111

Ryutaroh Matsumoto ryutaroh at example.com
2001年 3月 3日 (土) 19:34:43 JST


From: Kazu Yamamoto (山本和彦) <kazu at example.com>
Subject: [Mew-dist 16708] b111
> * S/MIME 関係のパッチを、だれかまとめてもらえませんか?

Mew-distに報告されてb111に入っていないパッチは以下の通りです。

[Mew-dist 16672] content-type: application/x-pkcs7-mimeでsmime-typeパ
		 ラメータが指定されていない署名を署名として処理するよ
		 うにするパッチ。元のパッチはインデントをつけ直してい
		 ませんでしたが、以下のものはインデントをつけ直してい
		 ます。

[Mew-dist 16692] 間違ったパスフレーズもキャッシュに入れてしまうバグを
		 直すパッチ

[Mew-dist 16701] signatureのスペルミスの修正

--
松本  隆太郎
-------------- next part --------------
--- mew-1.95b111/mew-smime.el.org	Wed Feb 21 17:07:13 2001
+++ mew-1.95b111/mew-smime.el	Sat Mar  3 19:21:27 2001
@@ -48,6 +48,8 @@
 
 (defvar mew-smime-sign-error nil)
 
+(defconst mew-smime-passtag "S/MIME")
+
 ;; The following variables are used only in the variable
 ;; mew-decode-multipart-signed-switch in mew-decode.el.
 (defvar mew-smime-ver 0)
@@ -55,7 +57,7 @@
 (defvar mew-prog-smime "openssl")
 
 (defun mew-smime-passphrase ()
-  (mew-input-passwd mew-smime-prompt-enter-pass "S/MIME"))
+  (mew-input-passwd mew-smime-prompt-enter-pass mew-smime-passtag))
 
 (defun mew-smime-process-filter1 (process string)
   ;; sign or decrypt, not verify
@@ -72,6 +74,7 @@
 	(setq mew-smime-running nil)
 	(setq mew-smime-sign-error nil))
     (setq mew-smime-running nil)
+    (mew-passwd-set-passwd mew-smime-passtag nil)
     (setq mew-smime-sign-error (mew-chop event))))
 
 (defun mew-smime-sign (file1)
@@ -119,7 +122,7 @@
 		    "smime" "-verify" "-inform" "DER" "-in" file2
 		    "-content" file1
 		    "-CAfile" mew-smime-CA-file "-signer" pubkey-file))
-	  (concat "valid S/MIME digital signatuer signed by " 
+	  (concat "valid S/MIME digital signature by " 
 		  (mew-smime-move-pubkey-and-extract-email pubkey-file))
 	"S/MIME signature verification failed"))))
 
@@ -150,6 +153,8 @@
     email-addr))
 
 ;; The followin function is based on mew-decode-multipart-encrypted.
+;; A major problem is that we cannot distinguish failure of signature
+;; verification from that of decryption.
 
 (defun mew-smime-decrypt-or-verify (syntax cnt ctl cte)
   ;; called in narrowed region
@@ -168,22 +173,16 @@
        (write-region (mew-syntax-get-begin syntax)
 		     (point-max)
 		     encrypted-file nil 'no-msg))
-      (if (and (mew-syntax-get-param ctl "smime-type")
-	       (string-match "signed-data"
-			     (mew-syntax-get-param ctl "smime-type")))
-	  ;; signature verification
-	  (progn
-	    (message "S/MIME verifying ... ")
-	    (if (equal 0 (mew-call-process-lang
-			  "openssl" nil nil nil
-			  "smime" "-verify" "-inform" "DER"
-			  "-in" encrypted-file
-			  "-CAfile" mew-smime-CA-file
-			  "-signer" pubkey-file "-out" decrypted-file))
-		(setq result (concat "valid S/MIME digital signatuer signed by " 
-				     (mew-smime-move-pubkey-and-extract-email pubkey-file)))
-	      (setq mew-decode-not-decrypted t))
-	    (message "S/MIME verifying ... done"))
+      ;; signature verification
+      (message "S/MIME verifying ... ")
+      (if (equal 0 (mew-call-process-lang
+		    "openssl" nil nil nil
+		    "smime" "-verify" "-inform" "DER"
+		    "-in" encrypted-file
+		    "-CAfile" mew-smime-CA-file
+		    "-signer" pubkey-file "-out" decrypted-file))
+	  (setq result (concat "valid S/MIME digital signature by " 
+			       (mew-smime-move-pubkey-and-extract-email pubkey-file)))
 	;; decryption
 	(message "S/MIME decrypting ...")
 	(setq mew-smime-running 'decrypt)
-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: 無し
型:         application/x-pkcs7-signature
サイズ:     3207 バイト
説明:       attachment; filename="smime.p7s"
URL:        <http://www.mew.org/pipermail/mew-dist/attachments/20010303/5585bb81/attachment.bin>


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