Update of /cvsroot/emacs-jabber/emacs-jabber
In directory sc8-pr-cvs17:/tmp/cvs-serv14418
Modified Files:
jabber-conn.el jabber-core.el jabber-sasl.el jabber-logon.el
Log Message:
Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-409
Creator: Magnus Henoch <ma...@fr...>
Replace *jabber-encrypted* with per-account variable
Index: jabber-sasl.el
===================================================================
RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-sasl.el,v
retrieving revision 2.12
retrieving revision 2.13
diff -u -d -r2.12 -r2.13
--- jabber-sasl.el 29 Aug 2007 01:45:36 -0000 2.12
+++ jabber-sasl.el 14 Sep 2007 22:08:28 -0000 2.13
@@ -60,7 +60,7 @@
(fsm-send jc :authentication-failure)))
;; Watch for plaintext logins over unencrypted connections
- (if (and (not *jabber-encrypted*)
+ (if (and (not (plist-get (fsm-get-state-data jc) :encrypted))
(member (sasl-mechanism-name mechanism)
'("PLAIN" "LOGIN"))
(not (yes-or-no-p "Jabber server only allows cleartext password transmission! Continue? ")))
Index: jabber-conn.el
===================================================================
RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-conn.el,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -d -r2.10 -r2.11
--- jabber-conn.el 29 Aug 2007 12:58:28 -0000 2.10
+++ jabber-conn.el 14 Sep 2007 22:08:28 -0000 2.11
@@ -175,7 +175,6 @@
'open-ssl-stream)
(t
(error "Neither TLS nor SSL connect functions available")))))
- (setq *jabber-encrypted* t)
(let ((connection
(funcall connect-function
"jabber"
Index: jabber-logon.el
===================================================================
RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-logon.el,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- jabber-logon.el 29 Aug 2007 01:45:36 -0000 1.15
+++ jabber-logon.el 14 Sep 2007 22:08:28 -0000 1.16
@@ -45,7 +45,7 @@
(if passwd
(setq auth `(digest () ,(sha1 (concat session-id passwd))))))
;; Plaintext passwords - allow on encrypted connections
- (if (or *jabber-encrypted*
+ (if (or (plist-get (fsm-get-state-data jc) :encrypted)
(yes-or-no-p "Jabber server only allows cleartext password transmission! Continue? "))
(let ((passwd (jabber-read-password (jabber-connection-bare-jid jc))))
(when passwd
Index: jabber-core.el
===================================================================
RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- jabber-core.el 3 Sep 2007 17:17:34 -0000 1.69
+++ jabber-core.el 14 Sep 2007 22:08:28 -0000 1.70
@@ -46,9 +46,6 @@
(defvar *jabber-authenticated* nil
"boolean - are we authenticated")
-(defvar *jabber-encrypted* nil
- "boolean - is the connection encrypted")
-
(defvar *jabber-disconnecting* nil
"boolean - are we in the process of disconnecting by free will")
@@ -241,7 +238,8 @@
:resource resource
:password password
:registerp registerp
- :connection-type connection-type)))))
+ :connection-type connection-type
+ :encrypted (eq connection-type 'ssl))))))
(define-enter-state jabber-connection nil
(fsm state-data)
@@ -415,8 +413,7 @@
(:stanza
(if (jabber-starttls-process-input fsm (cadr event))
;; Connection is encrypted. Send a stream tag again.
- ;; XXX: note encryptedness of connection.
- (list :connected state-data)
+ (list :connected (plist-put state-data :encrypted t))
(message "STARTTLS negotiation failed")
(list nil state-data)))
@@ -698,7 +695,6 @@
(setq *jabber-connection* nil)
(jabber-clear-roster)
(setq *jabber-authenticated* nil)
- (setq *jabber-encrypted* nil)
(setq *jabber-connected* nil)
(setq *jabber-active-groupchats* nil)
(run-hooks 'jabber-post-disconnect-hook))
|