From 2b36abe554078301b501a27d0fbbda32179235ea Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 19 Nov 1999 13:16:22 +0000 Subject: [PATCH] (imap-cram-md5-auth): Specify the 4th arg to `md5' as `binary' if possible. (imap-log): Default to nil (synched with pgnus 0.99). (base64-decode-string): Autoload "mel" instead of "base64". (md5): Autoload "md5" without `eval-and-compile'. (cl): Enclose the requiring procedure with `eval-when-compile' instead of `eval-and-compile'. --- lisp/imap.el | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lisp/imap.el b/lisp/imap.el index f3cd50d..d46b383 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -132,18 +132,20 @@ ;;; Code: +(eval-when-compile (require 'cl)) + (eval-and-compile - (require 'cl) (autoload 'open-ssl-stream "ssl") - (autoload 'base64-decode-string "base64") + (autoload 'base64-decode-string "mel") (autoload 'base64-encode-string "mel") (autoload 'rfc2104-hash "rfc2104") - (autoload 'md5 "md5") (autoload 'utf7-encode "utf7") (autoload 'utf7-decode "utf7") (autoload 'format-spec "format-spec") (autoload 'format-spec-make "format-spec")) +(autoload 'md5 "md5") + ;; User variables. (defvar imap-imtest-program "imtest -kp %s %p" @@ -312,7 +314,7 @@ string).") "Non-nil indicates that the server emitted a continuation request. The actually value is really the text on the continuation line.") -(defvar imap-log "*imap-log*" +(defvar imap-log nil "Imap session trace.") (defvar imap-debug nil;"*imap-debug*" @@ -542,7 +544,12 @@ successful, nil otherwise." "AUTHENTICATE CRAM-MD5" (lambda (challenge) (let* ((decoded (base64-decode-string challenge)) - (hash (rfc2104-hash 'md5 64 16 passwd decoded)) + (hash-function (if (and (featurep 'xemacs) + (>= (function-max-args 'md5) 4)) + (lambda (object &optional start end) + (md5 object start end 'binary)) + 'md5)) + (hash (rfc2104-hash hash-function 64 16 passwd decoded)) (response (concat user " " hash)) (encoded (base64-encode-string response))) encoded)))))))) -- 1.7.10.4