From cd6db47c64f3c0eb04fea0c5622b11ad7116b75f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 4 Nov 2007 01:26:09 +0000 Subject: [PATCH] Don't require rx when compiling. (tls-end-of-info): Rewrite without using rx. (open-tls-stream)): Use with-current-buffer. --- lisp/ChangeLog | 13 +++++++++++++ lisp/net/tls.el | 43 +++++++++++++++---------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dcd4733eb3..97cb6f7425 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2007-11-04 Glenn Morris + + * net/tls.el: Don't require rx when compiling. + (tls-end-of-info): Rewrite without using rx. + (open-tls-stream): Use with-current-buffer. + +2007-11-04 Riccardo Murri + + * net/tls.el: Require rx when compiling. + (tls-end-of-info): New variable. + (open-tls-stream): Keep reading input until `tls-end-of-info' is + matched. + 2007-11-03 Sean O'Rourke * register.el (append-to-register, prepend-to-register): diff --git a/lisp/net/tls.el b/lisp/net/tls.el index 789e4bbc34..6beb8680c6 100644 --- a/lisp/net/tls.el +++ b/lisp/net/tls.el @@ -51,37 +51,25 @@ (autoload 'format-spec "format-spec") (autoload 'format-spec-make "format-spec")) -(eval-when-compile - (require 'rx)) - (defgroup tls nil "Transport Layer Security (TLS) parameters." :group 'comm) (defcustom tls-end-of-info - (rx - (or - ;; `openssl s_client` regexp - (sequence - ;; see ssl/ssl_txt.c lines 219--220 - line-start - " Verify return code: " - (one-or-more not-newline) - "\n" - ;; according to apps/s_client.c line 1515 this is always the last - ;; line that is printed by s_client before the real data - "---\n") - ;; `gnutls` regexp - (sequence - ;; see src/cli.c lines 721-- - (sequence line-start "- Simple Client Mode:\n") - (zero-or-more - (or - "\n" ; ignore blank lines - ;; XXX: we have no way of knowing if the STARTTLS handshake - ;; sequence has completed successfully, because `gnutls` will - ;; only report failure. - (sequence line-start "\*\*\* Starting TLS handshake\n")))))) + (concat + "\\(" + ;; `openssl s_client' regexp. See ssl/ssl_txt.c lines 219-220. + ;; According to apps/s_client.c line 1515 `---' is always the last + ;; line that is printed by s_client before the real data. + "^ Verify return code: .+\n---\n\\|" + ;; `gnutls' regexp. See src/cli.c lines 721-. + "^- Simple Client Mode:\n" + "\\(\n\\|" ; ignore blank lines + ;; XXX: We have no way of knowing if the STARTTLS handshake sequence + ;; has completed successfully, because `gnutls' will only report + ;; failure. + "^\\*\\*\\* Starting TLS handshake\n\\)*" + "\\)") "Regexp matching end of TLS client informational messages. Client data stream begins after the last character matched by this. The default matches `openssl s_client' (version 0.9.8c) @@ -165,8 +153,7 @@ Fourth arg PORT is an integer specifying a port to connect to." process cmd done) (if use-temp-buffer (setq buffer (generate-new-buffer " TLS"))) - (save-excursion - (set-buffer buffer) + (with-current-buffer buffer (message "Opening TLS connection to `%s'..." host) (while (and (not done) (setq cmd (pop cmds))) (message "Opening TLS connection with `%s'..." cmd) -- 2.20.1