X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fstarttls.el;h=d4ee7ecbe5c00373c0758684dda02b5bc2d3ff9e;hb=4cacb5f23eb830e6950dba987063f413977708d7;hp=16f34c6967fc63f1ada4c68fe2db49a58d9bc2ed;hpb=da60f31d1a48e54250807cb3e2cbfec2e539a6a9;p=elisp%2Fgnus.git- diff --git a/lisp/starttls.el b/lisp/starttls.el index 16f34c6..d4ee7ec 100644 --- a/lisp/starttls.el +++ b/lisp/starttls.el @@ -1,6 +1,7 @@ ;;; starttls.el --- STARTTLS functions -;; Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2002, 2003, 2004, +;; 2005 Free Software Foundation, Inc. ;; Author: Daiki Ueno ;; Author: Simon Josefsson @@ -21,8 +22,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -37,9 +38,11 @@ ;; and the second one is Simon Josefsson's starttls.el which uses ;; "gnutls-cli" from GNUTLS. ;; -;; If "gnutls-cli" is available, it is prefered by the code over -;; "starttls". Use `starttls-use-gnutls' to toggle between -;; implementations if you have both tools installed. +;; If "starttls" is available, it is prefered by the code over +;; "gnutls-cli", for backwards compatibility. Use +;; `starttls-use-gnutls' to toggle between implementations if you have +;; both tools installed. It is recommended to use GNUTLS, though, as +;; it performs more verification of the certificates. ;; The GNUTLS support require GNUTLS 0.9.90 (released 2003-10-08) or ;; later, from , or "starttls" @@ -124,6 +127,7 @@ "Name of GNUTLS command line tool. This program is used when GNUTLS is used, i.e. when `starttls-use-gnutls' is non-nil." + :version "22.1" :type 'string :group 'starttls) @@ -136,6 +140,7 @@ i.e. when `starttls-use-gnutls' is nil." (defcustom starttls-use-gnutls (not (executable-find starttls-program)) "*Whether to use GNUTLS instead of the `starttls' command." + :version "22.1" :type 'boolean :group 'starttls) @@ -154,11 +159,13 @@ This program is used when GNUTLS is used, i.e. when For example, non-TLS compliant servers may require '(\"--protocols\" \"ssl3\"). Invoke \"gnutls-cli --help\" to find out which parameters are available." + :version "22.1" :type '(repeat string) :group 'starttls) (defcustom starttls-process-connection-type nil "*Value for `process-connection-type' to use when starting STARTTLS process." + :version "22.1" :type 'boolean :group 'starttls) @@ -168,6 +175,7 @@ The default is what GNUTLS's \"gnutls-cli\" outputs." ;; GNUTLS cli.c:main() print this string when it is starting to run ;; in the application read/write phase. If the logic, or the string ;; itself, is modified, this must be updated. + :version "22.1" :type 'regexp :group 'starttls) @@ -176,6 +184,7 @@ The default is what GNUTLS's \"gnutls-cli\" outputs." The default is what GNUTLS's \"gnutls-cli\" outputs." ;; GNUTLS cli.c:do_handshake() print this string on failure. If the ;; logic, or the string itself, is modified, this must be updated. + :version "22.1" :type 'regexp :group 'starttls) @@ -186,6 +195,7 @@ The default is what GNUTLS's \"gnutls-cli\" outputs." ;; common.c:print_info(), that unconditionally print this string ;; last. If that logic, or the string itself, is modified, this ;; must be updated. + :version "22.1" :type 'regexp :group 'starttls) @@ -226,6 +236,13 @@ handshake, or NIL on failure." (starttls-negotiate-gnutls process) (signal-process (process-id process) 'SIGALRM))) +(eval-and-compile + (if (fboundp 'set-process-query-on-exit-flag) + (defalias 'starttls-set-process-query-on-exit-flag + 'set-process-query-on-exit-flag) + (defalias 'starttls-set-process-query-on-exit-flag + 'process-kill-without-query))) + (defun starttls-open-stream-gnutls (name buffer host service) (message "Opening STARTTLS connection to `%s'..." host) (let* (done @@ -237,7 +254,7 @@ handshake, or NIL on failure." (int-to-string service) service) starttls-extra-arguments))) - (process-kill-without-query process) + (starttls-set-process-query-on-exit-flag process nil) (while (and (processp process) (eq (process-status process) 'run) (save-excursion @@ -277,7 +294,7 @@ specifying a port number to connect to." name buffer starttls-program host (format "%s" service) starttls-extra-args))) - (process-kill-without-query process) + (starttls-set-process-query-on-exit-flag process nil) process))) (defun starttls-open-ssl-stream (name buffer host service)