From: Magnus H. <leg...@us...> - 2013-04-02 02:24:53
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "emacs-jabber". The branch, master has been updated via 5c7d80f3aa92cc5a27e3fb553ca291173516b763 (commit) via 28e10a0f4e0fcb281c110f6c6c285720b5af98ee (commit) from 2ac3550da736bdcced248887a0c90a74423d98a6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5c7d80f3aa92cc5a27e3fb553ca291173516b763 Author: Magnus Henoch <mag...@gm...> Date: Tue Apr 2 03:23:21 2013 +0100 Use auth-source to read passwords from .netrc/.authinfo files Specify a line like: machine example.com login username password s3cret port xmpp (port should always be xmpp, regardless of the actual port) diff --git a/NEWS b/NEWS index 53d5113..2207a1e 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ -*- mode: outline -*- * New features in jabber.el latest git +** Support for reading passwords from netrc/authinfo files +Use "machine example.com login username password s3cret port xmpp". + ** Support for roster's groups roll state saving ** Full support for XEP-0012 diff --git a/jabber-util.el b/jabber-util.el index c7ceabb..822ef60 100644 --- a/jabber-util.el +++ b/jabber-util.el @@ -25,6 +25,9 @@ (condition-case nil (require 'password) (error nil)) +(condition-case nil + (require 'auth-source) + (error nil)) (defvar jabber-jid-history nil "History of entered JIDs") @@ -304,12 +307,25 @@ If FULLJIDS is non-nil, complete jids with resources." (defun jabber-read-password (bare-jid) "Read Jabber password from minibuffer." - (let ((prompt (format "Jabber password for %s: " bare-jid))) - (if (require 'password-cache nil t) - ;; Need to copy the password, as sasl.el wants to erase it. - (copy-sequence - (password-read prompt (jabber-password-key bare-jid))) - (read-passwd prompt)))) + (let ((found + (and (fboundp 'auth-source-search) + (nth 0 (auth-source-search + :user (jabber-jid-username bare-jid) + :host (jabber-jid-server bare-jid) + :port "xmpp" + :max 1 + :require '(:secret)))))) + (if found + (let ((secret (plist-get found :secret))) + (if (functionp secret) + (funcall secret) + secret)) + (let ((prompt (format "Jabber password for %s: " bare-jid))) + (if (require 'password-cache nil t) + ;; Need to copy the password, as sasl.el wants to erase it. + (copy-sequence + (password-read prompt (jabber-password-key bare-jid))) + (read-passwd prompt)))))) (defun jabber-cache-password (bare-jid password) "Cache PASSWORD for BARE-JID." commit 28e10a0f4e0fcb281c110f6c6c285720b5af98ee Author: Magnus Henoch <mag...@gm...> Date: Sat Mar 9 16:13:59 2013 +0000 Update TLS/SSL section in README; rename to "Encrypted connections" diff --git a/README b/README index 2efdeb2..127d45c 100644 --- a/README +++ b/README @@ -27,24 +27,37 @@ net-utils and mule-ucs packages. jabber.el basically works on XEmacs, but some features are missing (in particular mouse support). Testing and patches are very welcome. -TLS/SSL -======= -To get an encrypted connection, the most convenient option is to use -starttls.el (from Emacs 22 or Gnus 5.10). This requires GnuTLS (in -particular the command line tool gnutls-cli) to be installed, but -requires no configuration at all. - -You can also use either tls.el (from Emacs 22 or Gnus 5.10) or ssl.el. -These are interfaces to GnuTLS and OpenSSL, respectively; use the -appropriate one. Recent versions of tls.el support both programs, -though. The version of ssl.el distributed with Gnus is outdated; use -the one from W3 CVS instead: -http://cvs.savannah.gnu.org/viewcvs/w3/lisp/ssl.el?root=w3 +Encrypted connections +===================== +Many Jabber servers require encrypted connections, and even if yours +doesn't it may be good idea. To get an encrypted connection, the most +convenient option is to use GNU Emacs 24 with GnuTLS support compiled +in. You can check whether you have that by typing: + +M-: (gnutls-available-p) + +If that commands shows `t' in the echo area, then you have working +GnuTLS support. If it shows `nil' or signals an error, then you +don't. + +Failing that, jabber.el will use the starttls.el library, which +requires that the GnuTLS command line tool "gnutls-cli" is installed. +In Debian-based distributions, "gnutls-cli" is in the "gnutls-bin" +package. + +The above applies to STARTTLS connections, the most common way to +encrypt a Jabber connection and the only one specified in the +standards. STARTTLS connections start out unencrypted, but switch to +encrypted after negotiation. jabber.el also supports connections that +are encrypted from start. For this it uses the tls.el library, which +requires either "gnutls-cli" or the OpenSSL command line tool +"openssl" to be installed. To use the latter form of encryption, customize jabber-account-list. Note that only the connection from you to the server is encrypted; -there is no guarantee of other connections being encrypted. +there is no guarantee of connections from your server to your +contacts' server being encrypted. Installation ============ ----------------------------------------------------------------------- Summary of changes: NEWS | 3 +++ README | 41 +++++++++++++++++++++++++++-------------- jabber-util.el | 28 ++++++++++++++++++++++------ 3 files changed, 52 insertions(+), 20 deletions(-) hooks/post-receive -- emacs-jabber |