X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=sasl-digest.el;h=e7610a1d71a5079c478a08a9acec155462c23275;hb=4727809b0b568e24ae94c1d6bdb4354b37959739;hp=87df5dbc2c023521309d64c2bd70e0acdf68db71;hpb=93fbe8430342dc3ab7f3926057d5c0234add7df9;p=elisp%2Fflim.git diff --git a/sasl-digest.el b/sasl-digest.el index 87df5db..e7610a1 100644 --- a/sasl-digest.el +++ b/sasl-digest.el @@ -1,9 +1,9 @@ ;;; sasl-digest.el --- DIGEST-MD5 module for the SASL client framework -;; Copyright (C) 2000 Daiki Ueno +;; Copyright (C) 2000 Free Software Foundation, Inc. -;; Author: Kenichi OKADA -;; Daiki Ueno +;; Author: Daiki Ueno +;; Kenichi OKADA ;; Keywords: SASL, DIGEST-MD5 ;; This file is part of FLIM (Faithful Library about Internet Message). @@ -20,8 +20,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; 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. ;; This program is implemented from draft-leach-digest-sasl-05.txt. ;; @@ -104,7 +104,7 @@ charset algorithm cipher-opts auth-param)." (encode-hex-string (md5-binary (concat "AUTHENTICATE:" digest-uri - (if (string-equal "auth-int" qop) + (if (member qop '("auth-int" "auth-conf")) ":00000000000000000000000000000000"))))))) (fillarray passphrase 0)))) @@ -117,6 +117,9 @@ charset algorithm cipher-opts auth-param)." (nonce-count (or (sasl-client-property client 'nonce-count) sasl-digest-md5-nonce-count)) + (qop + (or (sasl-client-property client 'qop) + "auth")) (digest-uri (sasl-digest-md5-digest-uri (sasl-client-service client)(sasl-client-server client))) @@ -124,6 +127,8 @@ charset algorithm cipher-opts auth-param)." (or (sasl-client-property client 'cnonce) (sasl-digest-md5-cnonce)))) (sasl-client-set-property client 'nonce-count (1+ nonce-count)) + (unless (string= qop "auth") + (sasl-error (format "Unsupported \"qop-value\": %s" qop))) (concat "username=\"" (sasl-client-name client) "\"," "realm=\"" realm "\"," @@ -131,27 +136,17 @@ charset algorithm cipher-opts auth-param)." "cnonce=\"" cnonce "\"," (format "nc=%08x," nonce-count) "digest-uri=\"" digest-uri "\"," - "response=\"" + "qop=" qop "," + "response=" (sasl-digest-md5-response-value (sasl-client-name client) realm (plist-get plist 'nonce) cnonce nonce-count - (or (plist-get plist 'qop) - "auth") + qop digest-uri - (plist-get plist 'authzid)) - "\"," - (mapconcat - #'identity - (delq nil - (mapcar (lambda (prop) - (let ((value (sasl-client-property client prop))) - (if value - (format "%s=%s" prop value)))) - '(maxbuf charset cipher authzid))) - ",")))) + (plist-get plist 'authzid))))) (put 'sasl-digest 'sasl-mechanism (sasl-make-mechanism "DIGEST-MD5" sasl-digest-md5-steps))