From: ueno Date: Thu, 2 Nov 2000 09:24:01 +0000 (+0000) Subject: * sasl.el (sasl-make-authenticator): Allocate a freshly generated X-Git-Tag: deisui-1_14_0-1~20 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=901cea5eb2d3c6ab5a5be26dbf97b222d9127d77;p=elisp%2Fflim.git * sasl.el (sasl-make-authenticator): Allocate a freshly generated symbol for each continuation. * sasl.el, sasl-cram.el, sasl-digest.el: Don't check `sasl-authenticator' property. --- diff --git a/ChangeLog b/ChangeLog index e1e6469..e635381 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2000-11-02 Daiki Ueno + * sasl.el (sasl-make-authenticator): Allocate a freshly generated + symbol for each continuation. + +2000-11-02 Daiki Ueno + * sasl-digest.el (sasl-digest-md5-response-1): Rename from `sasl-digest-md5-digest-response'. (sasl-digest-md5-response-2): New alias. diff --git a/sasl-cram.el b/sasl-cram.el index 233b05a..70ee239 100644 --- a/sasl-cram.el +++ b/sasl-cram.el @@ -34,10 +34,6 @@ '(ignore ;no initial response sasl-cram-md5-response)) -(unless (get 'sasl-cram 'sasl-authenticator) - (put 'sasl-cram 'sasl-authenticator - (sasl-make-authenticator "CRAM-MD5" sasl-cram-md5-continuations))) - (defun sasl-cram-md5-response (principal challenge) (let ((passphrase (sasl-read-passphrase @@ -49,6 +45,9 @@ (hmac-md5 (nth 1 challenge) passphrase))) (fillarray passphrase 0)))) +(put 'sasl-cram 'sasl-authenticator + (sasl-make-authenticator "CRAM-MD5" sasl-cram-md5-continuations)) + (provide 'sasl-cram) ;;; sasl-cram.el ends here diff --git a/sasl-digest.el b/sasl-digest.el index f625acd..409ff08 100644 --- a/sasl-digest.el +++ b/sasl-digest.el @@ -51,12 +51,8 @@ (defconst sasl-digest-md5-continuations '(ignore ;no initial response - sasl-digest-md5-response-1 - sasl-digest-md5-response-2)) ;"" - -(unless (get 'sasl-digest 'sasl-authenticator) - (put 'sasl-digest 'sasl-authenticator - (sasl-make-authenticator "DIGEST-MD5" sasl-digest-md5-continuations))) + sasl-digest-md5-response + ignore)) ;"" ;;; @ low level functions ;;; @@ -151,7 +147,7 @@ charset algorithm cipher-opts auth-param)." '(charset qop maxbuf cipher authzid))) ","))) -(defun sasl-digest-md5-response-1 (principal challenge) +(defun sasl-digest-md5-response (principal challenge) (sasl-digest-md5-parse-digest-challenge (nth 1 challenge)) (let ((passphrase (sasl-read-passphrase @@ -171,7 +167,8 @@ charset algorithm cipher-opts auth-param)." (sasl-principal-server-internal principal))) (fillarray passphrase 0)))) -(defalias 'sasl-digest-md5-response-2 'ignore) +(put 'sasl-digest 'sasl-authenticator + (sasl-make-authenticator "DIGEST-MD5" sasl-digest-md5-continuations)) (provide 'sasl-digest) diff --git a/sasl.el b/sasl.el index eb46668..d2e6a4e 100644 --- a/sasl.el +++ b/sasl.el @@ -36,8 +36,14 @@ (defvar sasl-unique-id-function #'sasl-unique-id-function) -(defmacro sasl-make-authenticator (mechanism continuations) - `(vector ,mechanism ,continuations)) +(defun sasl-make-authenticator (mechanism continuations) + (vector mechanism + (mapcar + (lambda (continuation) + (let ((symbol (make-symbol (symbol-name continuation)))) + (fset symbol (symbol-function continuation)) + symbol)) + continuations))) (defmacro sasl-authenticator-mechanism-internal (authenticator) `(aref ,authenticator 0)) @@ -136,10 +142,6 @@ It contain at least 64 bits of entropy." (defconst sasl-plain-continuations '(sasl-plain-response)) -(unless (get 'sasl-plain 'sasl-authenticator) - (put 'sasl-plain 'sasl-authenticator - (sasl-make-authenticator "PLAIN" sasl-plain-continuations))) - (defun sasl-plain-response (principal challenge) (let ((passphrase (sasl-read-passphrase @@ -149,6 +151,9 @@ It contain at least 64 bits of entropy." (concat "\0" (sasl-principal-name-internal principal) "\0" passphrase) (fillarray passphrase 0)))) +(put 'sasl-plain 'sasl-authenticator + (sasl-make-authenticator "PLAIN" sasl-plain-continuations)) + (provide 'sasl-plain) (provide 'sasl)