* lunit.el (lunit-test-printer): Simplify messages.
[elisp/flim.git] / sasl.el
diff --git a/sasl.el b/sasl.el
index 3d884e5..86187c9 100644 (file)
--- a/sasl.el
+++ b/sasl.el
@@ -100,7 +100,7 @@ The second argument PLIST is the new property list."
 ;;;
 
 (defun sasl-make-mechanism (name steps)
-  "Make an authenticator.
+  "Make an authentication mechanism.
 NAME is a IANA registered SASL mechanism name.
 STEPS is list of continuation function."
   (vector name
@@ -138,14 +138,11 @@ STEPS is list of continuation function."
 
 (defun sasl-step-data (step)
   "Return the data which STEP holds, a string."
-  (if (vectorp step)
-      (aref step 1)))
+  (aref step 1))
 
 (defun sasl-step-set-data (step data)
   "Store DATA string to STEP."
-  (if (vectorp step)
-      (aset step 1 data)
-    (vector nil data)))
+  (aset step 1 data))
 
 (defun sasl-next-step (client step)
   "Evaluate the challenge and prepare an appropriate next response.
@@ -238,12 +235,12 @@ It contain at least 64 bits of entropy."
     sasl-login-response-2))
 
 (defun sasl-login-response-1 (client step)
-  (unless (string= (sasl-step-data step) "Username:")
+  (unless (string-match "^user ?name." (sasl-step-data step)) ;; XXX
     (sasl-error (format "Unexpected response: %s" (sasl-step-data step))))
   (sasl-client-name client))
 
 (defun sasl-login-response-2 (client step)
-  (unless (string= (sasl-step-data step) "Password:")
+  (unless (string-match "^password." (sasl-step-data step))  ;; XXX
     (sasl-error (format "Unexpected response: %s" (sasl-step-data step))))
   (sasl-read-passphrase
    (format "LOGIN passphrase for %s: " (sasl-client-name client))))