* texi/gnus-ja.texi (Article Date): Update Japanese translation.
[elisp/gnus.git-] / lisp / smime.el
index 678042a..eb10aa7 100644 (file)
@@ -41,6 +41,9 @@
 ;; PKCSx or similar, it's intended to perform common operations
 ;; done on messages encoded in these formats.  The terminology chosen
 ;; reflect this.
+;;
+;; The home of this file is in Gnus CVS, but also available from
+;; http://josefsson.org/smime.html.
 
 ;;; Quick introduction:
 
@@ -93,7 +96,7 @@
 ;;
 ;; Suggestions and comments are appreciated, mail me at simon@josefsson.org.
 
-;; <rant>
+;; begin rant
 ;;
 ;; I would include pointers to introductory text on concepts used in
 ;; this library here, but the material I've read are so horrible I
 ;; Also, I'm not going to mention anything about the wonders of
 ;; cryptopolitics.  Oops, I just did.
 ;;
-;; </rant>
+;; end rant
 
 ;;; Revision history:
 
-;; version 0 not released
+;; 2000-06-05  initial version, committed to Gnus CVS contrib/
+;; 2000-10-28  retrieve certificates via DNS CERT RRs
+;; 2001-10-14  posted to gnu.emacs.sources
 
 ;;; Code:
 
@@ -189,6 +194,15 @@ If nil, use system defaults."
 
 (defvar smime-details-buffer "*OpenSSL output*")
 
+(eval-and-compile
+  (defalias 'smime-make-temp-file
+    (if (fboundp 'make-temp-file)
+       'make-temp-file
+      (lambda (prefix &optional dir-flag) ;; Simple implementation
+       (expand-file-name
+        (make-temp-name prefix)
+        temporary-file-directory)))))
+
 ;; Password dialog function
 
 (defun smime-ask-passphrase ()
@@ -229,7 +243,7 @@ to include in its caar."
        (certfiles (and (cdr keyfiles) (cadr keyfiles)))
        (buffer (generate-new-buffer (generate-new-buffer-name " *smime*")))
        (passphrase (smime-ask-passphrase))
-       (tmpfile (make-temp-file "smime")))
+       (tmpfile (smime-make-temp-file "smime")))
     (if passphrase
        (setenv "GNUS_SMIME_PASSPHRASE" passphrase))
     (prog1
@@ -263,7 +277,7 @@ have proper MIME tags.  CERTFILES is a list of filenames, each file
 is expected to contain of a PEM encoded certificate."
   (smime-new-details-buffer)
   (let ((buffer (generate-new-buffer (generate-new-buffer-name " *smime*")))
-       (tmpfile (make-temp-file "smime")))
+       (tmpfile (smime-make-temp-file "smime")))
     (prog1
        (when (prog1
                  (apply 'smime-call-openssl-region b e (list buffer tmpfile)
@@ -354,7 +368,7 @@ in the buffer specified by `smime-details-buffer'."
   (smime-new-details-buffer)
   (let ((buffer (generate-new-buffer (generate-new-buffer-name " *smime*")))
        CAs (passphrase (smime-ask-passphrase))
-       (tmpfile (make-temp-file "smime")))
+       (tmpfile (smime-make-temp-file "smime")))
     (if passphrase
        (setenv "GNUS_SMIME_PASSPHRASE" passphrase))
     (if (prog1
@@ -445,7 +459,7 @@ in the buffer specified by `smime-details-buffer'."
   "Get email addresses contained in certificate between points B and E.
 A string or a list of strings is returned."
   (smime-new-details-buffer)
-  (when (smime-call-openssl-region 
+  (when (smime-call-openssl-region
         b e smime-details-buffer "x509" "-email" "-noout")
     (delete-region b e)
     (insert-buffer-substring smime-details-buffer)
@@ -461,10 +475,11 @@ A string or a list of strings is returned."
            (caddr curkey)
          (smime-get-certfiles keyfile otherkeys)))))
 
-(defalias 'smime-point-at-eol
-  (if (fboundp 'point-at-eol)
-      'point-at-eol
-    'line-end-position))
+(eval-and-compile
+  (defalias 'smime-point-at-eol
+    (if (fboundp 'point-at-eol)
+       'point-at-eol
+      'line-end-position)))
 
 (defun smime-buffer-as-string-region (b e)
   "Return each line in region between B and E as a list of strings."