* epa.el (epa-sign-file): Save the output to *.p7s or *.p7m file if
authorueno <ueno>
Wed, 20 Dec 2006 05:29:43 +0000 (05:29 +0000)
committerueno <ueno>
Wed, 20 Dec 2006 05:29:43 +0000 (05:29 +0000)
epa-protocol is CMS.
(epa-encrypt-file): Ditto.

ChangeLog
epa.el

index 8a22aa1..75fc4f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 2006-12-20  Daiki Ueno  <ueno@unixuser.org>
 
        * epa.el (epa-list-keys): Abolished PROTOCOL arg.
+       (epa-sign-file): Save the output to *.p7s or *.p7m file if
+       epa-protocol is CMS.
+       (epa-encrypt-file): Ditto.
 
 2006-12-19  Daiki Ueno  <ueno@unixuser.org>
 
diff --git a/epa.el b/epa.el
index b6509db..a88f59b 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -651,12 +651,17 @@ d - Create a detached signature
                     (t
                      (throw 'done nil))))))))
   (let ((signature (concat file
-                          (if (or epa-armor
-                                  (not (memq mode '(nil t normal detached))))
-                              ".asc"
+                          (if (eq epa-protocol 'OpenPGP)
+                              (if (or epa-armor
+                                      (not (memq mode
+                                                 '(nil t normal detached))))
+                                  ".asc"
+                                (if (memq mode '(t detached))
+                                    ".sig"
+                                  ".gpg"))
                             (if (memq mode '(t detached))
-                                ".sig"
-                              ".gpg"))))
+                                ".p7s"
+                              ".p7m"))))
        (context (epg-make-context epa-protocol)))
     (epg-context-set-armor context epa-armor)
     (epg-context-set-textmode context epa-textmode)
@@ -678,7 +683,9 @@ d - Create a detached signature
         (epa-select-keys (epg-make-context epa-protocol)
                          "Select recipients for encryption.
 If no one is selected, symmetric encryption will be performed.  ")))
-  (let ((cipher (concat file (if epa-armor ".asc" ".gpg")))
+  (let ((cipher (concat file (if (eq epa-protocol 'OpenPGP)
+                                (if epa-armor ".asc" ".gpg")
+                              ".p7m")))
        (context (epg-make-context epa-protocol)))
     (epg-context-set-armor context epa-armor)
     (epg-context-set-textmode context epa-textmode)