aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-03-03 02:11:04 +0000
committerGlenn Morris2008-03-03 02:11:04 +0000
commit0a4d4654f9d41828607491de58da58d46a0b7c2c (patch)
tree11b4ef3755b25db3bc3805874cf2c08203f8abc3
parent09fe06b74cc152536df8d3c3af5f106f556646ba (diff)
downloademacs-0a4d4654f9d41828607491de58da58d46a0b7c2c.tar.gz
emacs-0a4d4654f9d41828607491de58da58d46a0b7c2c.zip
(open-tls-stream): Restore the 2007-11-04 change accidentally removed
by the 2007-12-05 merge from Gnus.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/tls.el73
2 files changed, 50 insertions, 28 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index be67b888ada..a5a4ce7dcb5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-03-03 Glenn Morris <rgm@gnu.org>
2
3 * net/tls.el (open-tls-stream): Restore the 2007-11-04 change
4 accidentally removed by the 2007-12-05 merge from Gnus.
5
12008-03-02 Dan Nicolaescu <dann@ics.uci.edu> 62008-03-02 Dan Nicolaescu <dann@ics.uci.edu>
2 7
3 * progmodes/compile.el (compilation-menu-map): Add menu entries 8 * progmodes/compile.el (compilation-menu-map): Add menu entries
diff --git a/lisp/net/tls.el b/lisp/net/tls.el
index 40cc5f623db..9360a905861 100644
--- a/lisp/net/tls.el
+++ b/lisp/net/tls.el
@@ -239,38 +239,55 @@ Fourth arg PORT is an integer specifying a port to connect to."
239 (memq (process-status process) '(open run)) 239 (memq (process-status process) '(open run))
240 (progn 240 (progn
241 (goto-char (point-min)) 241 (goto-char (point-min))
242 (not (setq done (re-search-forward tls-success nil t))))) 242 (not (setq done (re-search-forward
243 tls-success nil t)))))
243 (unless (accept-process-output process 1) 244 (unless (accept-process-output process 1)
244 (sit-for 1))) 245 (sit-for 1)))
245 (message "Opening TLS connection with `%s'...%s" cmd 246 (message "Opening TLS connection with `%s'...%s" cmd
246 (if done "done" "failed")) 247 (if done "done" "failed"))
247 (if done 248 (if (not done)
248 (setq done process) 249 (delete-process process)
249 (delete-process process)))) 250 ;; advance point to after all informational messages that
250 (when done 251 ;; `openssl s_client' and `gnutls' print
251 (save-excursion 252 (let ((start-of-data nil))
252 (set-buffer buffer) 253 (while
253 (when 254 (not (setq start-of-data
254 (or 255 ;; the string matching `tls-end-of-info'
255 (and tls-checktrust 256 ;; might come in separate chunks from
256 (progn 257 ;; `accept-process-output', so start the
257 (goto-char (point-min)) 258 ;; search where `tls-success' ended
258 (re-search-forward tls-untrusted nil t)) 259 (save-excursion
259 (or 260 (if (re-search-forward tls-end-of-info nil t)
260 (and (not (eq tls-checktrust 'ask)) 261 (match-end 0)))))
261 (message "The certificate presented by `%s' is NOT trusted." host)) 262 (accept-process-output process 1))
262 (not (yes-or-no-p 263 (if start-of-data
263 (format "The certificate presented by `%s' is NOT trusted. Accept anyway? " host))))) 264 ;; move point to start of client data
264 (and tls-hostmismatch 265 (goto-char start-of-data)))
265 (progn 266 (setq done process))))
266 (goto-char (point-min)) 267 (when (and done
267 (re-search-forward tls-hostmismatch nil t)) 268 (or
268 (not (yes-or-no-p 269 (and tls-checktrust
269 (format "Host name in certificate doesn't match `%s'. Connect anyway? " host))))) 270 (save-excursion
270 (setq done nil) 271 (goto-char (point-min))
271 (delete-process process)))) 272 (re-search-forward tls-untrusted nil t))
272 (message "Opening TLS connection to `%s'...%s" 273 (or
273 host (if done "done" "failed"))) 274 (and (not (eq tls-checktrust 'ask))
275 (message "The certificate presented by `%s' is \
276NOT trusted." host))
277 (not (yes-or-no-p
278 (format "The certificate presented by `%s' is \
279NOT trusted. Accept anyway? " host)))))
280 (and tls-hostmismatch
281 (save-excursion
282 (goto-char (point-min))
283 (re-search-forward tls-hostmismatch nil t))
284 (not (yes-or-no-p
285 (format "Host name in certificate doesn't \
286match `%s'. Connect anyway? " host))))))
287 (setq done nil)
288 (delete-process process)))
289 (message "Opening TLS connection to `%s'...%s"
290 host (if done "done" "failed"))
274 (when use-temp-buffer 291 (when use-temp-buffer
275 (if done (set-process-buffer process nil)) 292 (if done (set-process-buffer process nil))
276 (kill-buffer buffer)) 293 (kill-buffer buffer))