;; 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:
;;
;; 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:
(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 ()
(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
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)
(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
"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)
(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."