Import Gnus v5.10.3.
[elisp/gnus.git-] / lisp / smime.el
1 ;;; smime.el --- S/MIME support library
2 ;; Copyright (c) 2000, 2001, 2003 Free Software Foundation, Inc.
3
4 ;; Author: Simon Josefsson <simon@josefsson.org>
5 ;; Keywords: SMIME X.509 PEM OpenSSL
6
7 ;; This file is part of GNU Emacs.
8
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published
11 ;; by the Free Software Foundation; either version 2, or (at your
12 ;; option) any later version.
13
14 ;; GNU Emacs is distributed in the hope that it will be useful, but
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 ;; General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
23
24 ;;; Commentary:
25
26 ;; This library perform S/MIME operations from within Emacs.
27 ;;
28 ;; Functions for fetching certificates from public repositories are
29 ;; provided, currently only from DNS.  LDAP support (via EUDC) is planned.
30 ;;
31 ;; It uses OpenSSL (tested with version 0.9.5a and 0.9.6) for signing,
32 ;; encryption and decryption.
33 ;;
34 ;; Some general knowledge of S/MIME, X.509, PKCS#12, PEM etc is
35 ;; probably required to use this library in any useful way.
36 ;; Especially, don't expect this library to buy security for you.  If
37 ;; you don't understand what you are doing, you're as likely to lose
38 ;; security than gain any by using this library.
39 ;;
40 ;; This library is not intended to provide a "raw" API for S/MIME,
41 ;; PKCSx or similar, it's intended to perform common operations
42 ;; done on messages encoded in these formats.  The terminology chosen
43 ;; reflect this.
44 ;;
45 ;; The home of this file is in Gnus CVS, but also available from
46 ;; http://josefsson.org/smime.html.
47
48 ;;; Quick introduction:
49
50 ;; Get your S/MIME certificate from VeriSign or someplace.  I used
51 ;; Netscape to generate the key and certificate request and stuff, and
52 ;; Netscape can export the key into PKCS#12 format.
53 ;;
54 ;; Enter OpenSSL.  To be able to use this library, it need to have the
55 ;; SMIME key readable in PEM format.  OpenSSL is used to convert the
56 ;; key:
57 ;;
58 ;; $ openssl pkcs12 -in mykey.p12 -clcerts -nodes > mykey.pem
59 ;; ...
60 ;;
61 ;; Now, use M-x customize-variable smime-keys and add mykey.pem as
62 ;; a key.
63 ;;
64 ;; Now you should be able to sign messages!  Create a buffer and write
65 ;; something and run M-x smime-sign-buffer RET RET and you should see
66 ;; your message MIME armoured and a signature.  Encryption, M-x
67 ;; smime-encrypt-buffer, should also work.
68 ;;
69 ;; To be able to verify messages you need to build up trust with
70 ;; someone.  Perhaps you trust the CA that issued your certificate, at
71 ;; least I did, so I export it's certificates from my PKCS#12
72 ;; certificate with:
73 ;;
74 ;; $ openssl pkcs12 -in mykey.p12 -cacerts -nodes > cacert.pem
75 ;; ...
76 ;;
77 ;; Now, use M-x customize-variable smime-CAs and add cacert.pem as a
78 ;; CA certificate.
79 ;;
80 ;; You should now be able to sign messages, and even verify messages
81 ;; sent by others that use the same CA as you.
82
83 ;; Bugs:
84 ;;
85 ;; Don't complain that this package doesn't do encrypted PEM files,
86 ;; submit a patch instead.  I store my keys in a safe place, so I
87 ;; didn't need the encryption.  Also, programming was made easier by
88 ;; that decision.  One might think that this even influenced were I
89 ;; store my keys, and one would probably be right. :-)
90 ;;
91 ;; Update: Mathias Herberts sent the patch.  However, it uses
92 ;; environment variables to pass the password to OpenSSL, which is
93 ;; slightly insecure. Hence a new todo: use a better -passin method.
94 ;;
95 ;; Cache password for e.g. 1h
96 ;;
97 ;; Suggestions and comments are appreciated, mail me at simon@josefsson.org.
98
99 ;; begin rant
100 ;;
101 ;; I would include pointers to introductory text on concepts used in
102 ;; this library here, but the material I've read are so horrible I
103 ;; don't want to recomend them.
104 ;;
105 ;; Why can't someone write a simple introduction to all this stuff?
106 ;; Until then, much of this resemble security by obscurity.
107 ;;
108 ;; Also, I'm not going to mention anything about the wonders of
109 ;; cryptopolitics.  Oops, I just did.
110 ;;
111 ;; end rant
112
113 ;;; Revision history:
114
115 ;; 2000-06-05  initial version, committed to Gnus CVS contrib/
116 ;; 2000-10-28  retrieve certificates via DNS CERT RRs
117 ;; 2001-10-14  posted to gnu.emacs.sources
118
119 ;;; Code:
120
121 (require 'dig)
122 (eval-when-compile (require 'cl))
123
124 (defgroup smime nil
125   "S/MIME configuration.")
126
127 (defcustom smime-keys nil
128   "*Map mail addresses to a file containing Certificate (and private key).
129 The file is assumed to be in PEM format. You can also associate additional
130 certificates to be sent with every message to each address."
131   :type '(repeat (list (string :tag "Mail address")
132                        (file :tag "File name")
133                        (repeat :tag "Additional certificate files"
134                                (file :tag "File name"))))
135   :group 'smime)
136
137 (defcustom smime-CA-directory nil
138   "*Directory containing certificates for CAs you trust.
139 Directory should contain files (in PEM format) named to the X.509
140 hash of the certificate.  This can be done using OpenSSL such as:
141
142 $ ln -s ca.pem `openssl x509 -noout -hash -in ca.pem`.0
143
144 where `ca.pem' is the file containing a PEM encoded X.509 CA
145 certificate."
146   :type '(choice (const :tag "none" nil)
147                  directory)
148   :group 'smime)
149
150 (defcustom smime-CA-file nil
151   "*Files containing certificates for CAs you trust.
152 File should contain certificates in PEM format."
153   :type '(choice (const :tag "none" nil)
154                  file)
155   :group 'smime)
156
157 (defcustom smime-certificate-directory "~/Mail/certs/"
158   "*Directory containing other people's certificates.
159 It should contain files named to the X.509 hash of the certificate,
160 and the files themself should be in PEM format."
161 ;The S/MIME library provide simple functionality for fetching
162 ;certificates into this directory, so there is no need to populate it
163 ;manually.
164   :type 'directory
165   :group 'smime)
166
167 (defcustom smime-openssl-program
168   (and (condition-case ()
169            (eq 0 (call-process "openssl" nil nil nil "version"))
170          (error nil))
171        "openssl")
172   "*Name of OpenSSL binary."
173   :type 'string
174   :group 'smime)
175
176 ;; OpenSSL option to select the encryption cipher
177
178 (defcustom smime-encrypt-cipher "-des3"
179   "*Cipher algorithm used for encryption."
180   :type '(choice (const :tag "Triple DES" "-des3")
181                  (const :tag "DES"  "-des")
182                  (const :tag "RC2 40 bits" "-rc2-40")
183                  (const :tag "RC2 64 bits" "-rc2-64")
184                  (const :tag "RC2 128 bits" "-rc2-128"))
185   :group 'smime)
186
187 (defcustom smime-dns-server nil
188   "*DNS server to query certificates from.
189 If nil, use system defaults."
190   :type '(choice (const :tag "System defaults")
191                  string)
192   :group 'smime)
193
194 (defvar smime-details-buffer "*OpenSSL output*")
195
196 ;; Use mm-util?
197 (eval-and-compile
198   (defalias 'smime-make-temp-file
199     (if (fboundp 'make-temp-file)
200         'make-temp-file
201       (lambda (prefix &optional dir-flag) ;; Simple implementation
202         (expand-file-name
203          (make-temp-name prefix)
204          (if (fboundp 'temp-directory)
205              (temp-directory)
206            temporary-file-directory))))))
207
208 ;; Password dialog function
209
210 (defun smime-ask-passphrase ()
211   "Asks the passphrase to unlock the secret key."
212   (let ((passphrase
213          (read-passwd
214           "Passphrase for secret key (RET for no passphrase): ")))
215     (if (string= passphrase "")
216         nil
217       passphrase)))
218
219 ;; OpenSSL wrappers.
220
221 (defun smime-call-openssl-region (b e buf &rest args)
222   (case (apply 'call-process-region b e smime-openssl-program nil buf nil args)
223     (0 t)
224     (1 (message "OpenSSL: An error occurred parsing the command options.") nil)
225     (2 (message "OpenSSL: One of the input files could not be read.") nil)
226     (3 (message "OpenSSL: An error occurred creating the PKCS#7 file or when reading the MIME message.") nil)
227     (4 (message "OpenSSL: An error occurred decrypting or verifying the message.") nil)
228     (t (error "Unknown OpenSSL exitcode") nil)))
229
230 (defun smime-make-certfiles (certfiles)
231   (if certfiles
232       (append (list "-certfile" (expand-file-name (car certfiles)))
233               (smime-make-certfiles (cdr certfiles)))))
234
235 ;; Sign+encrypt region
236
237 (defun smime-sign-region (b e keyfile)
238   "Sign region with certified key in KEYFILE.
239 If signing fails, the buffer is not modified.  Region is assumed to
240 have proper MIME tags.  KEYFILE is expected to contain a PEM encoded
241 private key and certificate as its car, and a list of additional
242 certificates to include in its caar.  If no additional certificates is
243 included, KEYFILE may be the file containing the PEM encoded private
244 key and certificate itself."
245   (smime-new-details-buffer)
246   (let ((keyfile (or (car-safe keyfile) keyfile))
247         (certfiles (and (cdr-safe keyfile) (cadr keyfile)))
248         (buffer (generate-new-buffer (generate-new-buffer-name " *smime*")))
249         (passphrase (smime-ask-passphrase))
250         (tmpfile (smime-make-temp-file "smime")))
251     (if passphrase
252         (setenv "GNUS_SMIME_PASSPHRASE" passphrase))
253     (prog1
254         (when (prog1
255                   (apply 'smime-call-openssl-region b e (list buffer tmpfile)
256                          "smime" "-sign" "-signer" (expand-file-name keyfile)
257                          (append
258                           (smime-make-certfiles certfiles)
259                           (if passphrase
260                               (list "-passin" "env:GNUS_SMIME_PASSPHRASE"))))
261                 (if passphrase
262                     (setenv "GNUS_SMIME_PASSPHRASE" "" t))
263                 (with-current-buffer smime-details-buffer
264                   (insert-file-contents tmpfile)
265                   (delete-file tmpfile)))
266           (delete-region b e)
267           (insert-buffer-substring buffer)
268           (goto-char b)
269           (when (looking-at "^MIME-Version: 1.0$")
270             (delete-region (point) (progn (forward-line 1) (point))))
271           t)
272       (with-current-buffer smime-details-buffer
273         (goto-char (point-max))
274         (insert-buffer-substring buffer))
275       (kill-buffer buffer))))
276
277 (defun smime-encrypt-region (b e certfiles)
278   "Encrypt region for recipients specified in CERTFILES.
279 If encryption fails, the buffer is not modified.  Region is assumed to
280 have proper MIME tags.  CERTFILES is a list of filenames, each file
281 is expected to contain of a PEM encoded certificate."
282   (smime-new-details-buffer)
283   (let ((buffer (generate-new-buffer (generate-new-buffer-name " *smime*")))
284         (tmpfile (smime-make-temp-file "smime")))
285     (prog1
286         (when (prog1
287                   (apply 'smime-call-openssl-region b e (list buffer tmpfile)
288                          "smime" "-encrypt" smime-encrypt-cipher
289                          (mapcar 'expand-file-name certfiles))
290                 (with-current-buffer smime-details-buffer
291                   (insert-file-contents tmpfile)
292                   (delete-file tmpfile)))
293           (delete-region b e)
294           (insert-buffer-substring buffer)
295           (goto-char b)
296           (when (looking-at "^MIME-Version: 1.0$")
297             (delete-region (point) (progn (forward-line 1) (point))))
298           t)
299       (with-current-buffer smime-details-buffer
300         (goto-char (point-max))
301         (insert-buffer-substring buffer))
302       (kill-buffer buffer))))
303
304 ;; Sign+encrypt buffer
305
306 (defun smime-sign-buffer (&optional keyfile buffer)
307   "S/MIME sign BUFFER with key in KEYFILE.
308 KEYFILE should contain a PEM encoded key and certificate."
309   (interactive)
310   (with-current-buffer (or buffer (current-buffer))
311     (smime-sign-region
312      (point-min) (point-max)
313      (if keyfile
314          keyfile
315        (smime-get-key-with-certs-by-email
316         (completing-read
317          (concat "Sign using which key? "
318                  (if smime-keys (concat "(default " (caar smime-keys) ") ")
319                    ""))
320          smime-keys nil nil (car-safe (car-safe smime-keys))))))))
321
322 (defun smime-encrypt-buffer (&optional certfiles buffer)
323   "S/MIME encrypt BUFFER for recipients specified in CERTFILES.
324 CERTFILES is a list of filenames, each file is expected to consist of
325 a PEM encoded key and certificate.  Uses current buffer if BUFFER is
326 nil."
327   (interactive)
328   (with-current-buffer (or buffer (current-buffer))
329     (smime-encrypt-region
330      (point-min) (point-max)
331      (or certfiles
332          (list (read-file-name "Recipient's S/MIME certificate: "
333                                smime-certificate-directory nil))))))
334
335 ;; Verify+decrypt region
336
337 (defun smime-verify-region (b e)
338   "Verify S/MIME message in region between B and E.
339 Returns non-nil on success.
340 Any details (stdout and stderr) are left in the buffer specified by
341 `smime-details-buffer'."
342   (smime-new-details-buffer)
343   (let ((CAs (append (if smime-CA-file
344                          (list "-CAfile"
345                                (expand-file-name smime-CA-file)))
346                      (if smime-CA-directory
347                          (list "-CApath"
348                                (expand-file-name smime-CA-directory))))))
349     (unless CAs
350       (error "No CA configured"))
351     (if (apply 'smime-call-openssl-region b e (list smime-details-buffer t)
352                "smime" "-verify" "-out" "/dev/null" CAs)
353         t
354       (insert-buffer-substring smime-details-buffer)
355       nil)))
356
357 (defun smime-noverify-region (b e)
358   "Verify integrity of S/MIME message in region between B and E.
359 Returns non-nil on success.
360 Any details (stdout and stderr) are left in the buffer specified by
361 `smime-details-buffer'."
362   (smime-new-details-buffer)
363   (if (apply 'smime-call-openssl-region b e (list smime-details-buffer t)
364              "smime" "-verify" "-noverify" "-out" '("/dev/null"))
365       t
366     (insert-buffer-substring smime-details-buffer)
367     nil))
368
369 (eval-when-compile
370   (defvar from))
371
372 (defun smime-decrypt-region (b e keyfile)
373   "Decrypt S/MIME message in region between B and E with key in KEYFILE.
374 On success, replaces region with decrypted data and return non-nil.
375 Any details (stderr on success, stdout and stderr on error) are left
376 in the buffer specified by `smime-details-buffer'."
377   (smime-new-details-buffer)
378   (let ((buffer (generate-new-buffer (generate-new-buffer-name " *smime*")))
379         CAs (passphrase (smime-ask-passphrase))
380         (tmpfile (smime-make-temp-file "smime")))
381     (if passphrase
382         (setenv "GNUS_SMIME_PASSPHRASE" passphrase))
383     (if (prog1
384             (apply 'smime-call-openssl-region b e
385                    (list buffer tmpfile)
386                    "smime" "-decrypt" "-recip" (expand-file-name keyfile)
387                    (if passphrase
388                        (list "-passin" "env:GNUS_SMIME_PASSPHRASE")))
389           (if passphrase
390               (setenv "GNUS_SMIME_PASSPHRASE" "" t))
391           (with-current-buffer smime-details-buffer
392             (insert-file-contents tmpfile)
393             (delete-file tmpfile)))
394         (progn
395           (delete-region b e)
396           (when (boundp 'from)
397             ;; `from' is dynamically bound in mm-dissect.
398             (insert "From: " from "\n"))
399           (insert-buffer-substring buffer)
400           (kill-buffer buffer)
401           t)
402       (with-current-buffer smime-details-buffer
403         (insert-buffer-substring buffer))
404       (kill-buffer buffer)
405       (delete-region b e)
406       (insert-buffer-substring smime-details-buffer)
407       nil)))
408
409 ;; Verify+Decrypt buffer
410
411 (defun smime-verify-buffer (&optional buffer)
412   "Verify integrity of S/MIME message in BUFFER.
413 Uses current buffer if BUFFER is nil. Returns non-nil on success.
414 Any details (stdout and stderr) are left in the buffer specified by
415 `smime-details-buffer'."
416   (interactive)
417   (with-current-buffer (or buffer (current-buffer))
418     (smime-verify-region (point-min) (point-max))))
419
420 (defun smime-noverify-buffer (&optional buffer)
421   "Verify integrity of S/MIME message in BUFFER.
422 Does NOT verify validity of certificate (only message integrity).
423 Uses current buffer if BUFFER is nil. Returns non-nil on success.
424 Any details (stdout and stderr) are left in the buffer specified by
425 `smime-details-buffer'."
426   (interactive)
427   (with-current-buffer (or buffer (current-buffer))
428     (smime-noverify-region (point-min) (point-max))))
429
430 (defun smime-decrypt-buffer (&optional buffer keyfile)
431   "Decrypt S/MIME message in BUFFER using KEYFILE.
432 Uses current buffer if BUFFER is nil, and query user of KEYFILE if it's nil.
433 On success, replaces data in buffer and return non-nil.
434 Any details (stderr on success, stdout and stderr on error) are left
435 in the buffer specified by `smime-details-buffer'."
436   (interactive)
437   (with-current-buffer (or buffer (current-buffer))
438     (smime-decrypt-region
439      (point-min) (point-max)
440      (expand-file-name
441       (or keyfile
442           (smime-get-key-by-email
443            (completing-read
444             (concat "Decipher using which key? "
445                     (if smime-keys (concat "(default " (caar smime-keys) ") ")
446                       ""))
447             smime-keys nil nil (car-safe (car-safe smime-keys)))))))))
448
449 ;; Various operations
450
451 (defun smime-new-details-buffer ()
452   (with-current-buffer (get-buffer-create smime-details-buffer)
453     (erase-buffer)))
454
455 (defun smime-pkcs7-region (b e)
456   "Convert S/MIME message between points B and E into a PKCS7 message."
457   (smime-new-details-buffer)
458   (when (smime-call-openssl-region b e smime-details-buffer "smime" "-pk7out")
459     (delete-region b e)
460     (insert-buffer-substring smime-details-buffer)
461     t))
462
463 (defun smime-pkcs7-certificates-region (b e)
464   "Extract any certificates enclosed in PKCS7 message between points B and E."
465   (smime-new-details-buffer)
466   (when (smime-call-openssl-region
467          b e smime-details-buffer "pkcs7" "-print_certs" "-text")
468     (delete-region b e)
469     (insert-buffer-substring smime-details-buffer)
470     t))
471
472 (defun smime-pkcs7-email-region (b e)
473   "Get email addresses contained in certificate between points B and E.
474 A string or a list of strings is returned."
475   (smime-new-details-buffer)
476   (when (smime-call-openssl-region
477          b e smime-details-buffer "x509" "-email" "-noout")
478     (delete-region b e)
479     (insert-buffer-substring smime-details-buffer)
480     t))
481
482 ;; Utility functions
483
484 (defun smime-get-certfiles (keyfile keys)
485   (if keys
486       (let ((curkey (car keys))
487             (otherkeys (cdr keys)))
488         (if (string= keyfile (cadr curkey))
489             (caddr curkey)
490           (smime-get-certfiles keyfile otherkeys)))))
491
492 ;; Use mm-util?
493 (eval-and-compile
494   (defalias 'smime-point-at-eol
495     (if (fboundp 'point-at-eol)
496         'point-at-eol
497       'line-end-position)))
498
499 (defun smime-buffer-as-string-region (b e)
500   "Return each line in region between B and E as a list of strings."
501   (save-excursion
502     (goto-char b)
503     (let (res)
504       (while (< (point) e)
505         (let ((str (buffer-substring (point) (smime-point-at-eol))))
506           (unless (string= "" str)
507             (push str res)))
508         (forward-line))
509       res)))
510
511 ;; Find certificates
512
513 (defun smime-mail-to-domain (mailaddr)
514   (if (string-match "@" mailaddr)
515       (replace-match "." 'fixedcase 'literal mailaddr)
516     mailaddr))
517
518 (defun smime-cert-by-dns (mail)
519   (let* ((dig-dns-server smime-dns-server)
520          (digbuf (dig-invoke (smime-mail-to-domain mail) "cert" nil nil "+vc"))
521          (retbuf (generate-new-buffer (format "*certificate for %s*" mail)))
522          (certrr (with-current-buffer digbuf
523                    (dig-extract-rr (smime-mail-to-domain mail) "cert")))
524          (cert (and certrr (dig-rr-get-pkix-cert certrr))))
525       (if cert
526           (with-current-buffer retbuf
527             (insert "-----BEGIN CERTIFICATE-----\n")
528             (let ((i 0) (len (length cert)))
529               (while (> (- len 64) i)
530                 (insert (substring cert i (+ i 64)) "\n")
531                 (setq i (+ i 64)))
532               (insert (substring cert i len) "\n"))
533             (insert "-----END CERTIFICATE-----\n"))
534         (kill-buffer retbuf)
535         (setq retbuf nil))
536       (kill-buffer digbuf)
537       retbuf))
538
539 ;; User interface.
540
541 (defvar smime-buffer "*SMIME*")
542
543 (defvar smime-mode-map nil)
544 (put 'smime-mode 'mode-class 'special)
545
546 (unless smime-mode-map
547   (setq smime-mode-map (make-sparse-keymap))
548   (suppress-keymap smime-mode-map)
549
550   (define-key smime-mode-map "q" 'smime-exit)
551   (define-key smime-mode-map "f" 'smime-certificate-info))
552
553 (defun smime-mode ()
554   "Major mode for browsing, viewing and fetching certificates.
555
556 All normal editing commands are switched off.
557 \\<smime-mode-map>
558
559 The following commands are available:
560
561 \\{smime-mode-map}"
562   (interactive)
563   (kill-all-local-variables)
564   (setq major-mode 'smime-mode)
565   (setq mode-name "SMIME")
566   (setq mode-line-process nil)
567   (use-local-map smime-mode-map)
568   (buffer-disable-undo)
569   (setq truncate-lines t)
570   (setq buffer-read-only t))
571
572 (defun smime-certificate-info (certfile)
573   (interactive "fCertificate file: ")
574   (let ((buffer (get-buffer-create (format "*certificate %s*" certfile))))
575     (switch-to-buffer buffer)
576     (erase-buffer)
577     (call-process smime-openssl-program nil buffer 'display
578                   "x509" "-in" (expand-file-name certfile) "-text")
579     (fundamental-mode)
580     (set-buffer-modified-p nil)
581     (toggle-read-only t)
582     (goto-char (point-min))))
583
584 (defun smime-draw-buffer ()
585   (with-current-buffer smime-buffer
586     (let (buffer-read-only)
587       (erase-buffer)
588       (insert "\nYour keys:\n")
589       (dolist (key smime-keys)
590         (insert
591          (format "\t\t%s: %s\n" (car key) (cadr key))))
592       (insert "\nTrusted Certificate Authoritys:\n")
593       (insert "\nKnown Certificates:\n"))))
594
595 (defun smime ()
596   "Go to the SMIME buffer."
597   (interactive)
598   (unless (get-buffer smime-buffer)
599     (save-excursion
600       (set-buffer (get-buffer-create smime-buffer))
601       (smime-mode)))
602   (smime-draw-buffer)
603   (switch-to-buffer smime-buffer))
604
605 (defun smime-exit ()
606   "Quit the S/MIME buffer."
607   (interactive)
608   (kill-buffer (current-buffer)))
609
610 ;; Other functions
611
612 (defun smime-get-key-by-email (email)
613   (cadr (assoc email smime-keys)))
614
615 (defun smime-get-key-with-certs-by-email (email)
616   (cdr (assoc email smime-keys)))
617
618 (provide 'smime)
619
620 ;;; smime.el ends here