symbol for each continuation.
* sasl.el, sasl-cram.el, sasl-digest.el: Don't check
`sasl-authenticator' property.
2000-11-02 Daiki Ueno <ueno@unixuser.org>
+ * sasl.el (sasl-make-authenticator): Allocate a freshly generated
+ symbol for each continuation.
+
+2000-11-02 Daiki Ueno <ueno@unixuser.org>
+
* sasl-digest.el (sasl-digest-md5-response-1): Rename from
`sasl-digest-md5-digest-response'.
(sasl-digest-md5-response-2): New alias.
'(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
(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
(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
;;;
'(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
(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)
(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))
(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
(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)