New test case.
authorokada <okada>
Tue, 20 Feb 2001 05:05:54 +0000 (05:05 +0000)
committerokada <okada>
Tue, 20 Feb 2001 05:05:54 +0000 (05:05 +0000)
ChangeLog
tests/test-sasl.el

index 1d40a06..464535f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-02-20  Kenichi OKADA <okada@opaopa.org>
+
+       * tests/test-sasl.el(test-sasl-ntlm-imap): Change name.
+       Delete wrong lines.
+
+2001-02-20  Taro Kawagishi <taro.kawagishi@nokia.com>
+
+       * tests/test-sasl.el(test-sasl-digest-ntlm-imap): New test.
+
 2001-02-17  Kenichi OKADA <okada@opaopa.org>
 
        * sasl-ntlm.el(sasl-ntlm-response): self-Hash.
index 327a266..1503182 100644 (file)
@@ -83,3 +83,37 @@ algorithm=md5-sess,charset=utf-8")
     (lunit-assert
      (string= (sasl-step-data step)
            (base64-decode-string "AQAAAMg9jU8CeB4KOfk7sUhSQPs=")))))
+
+(luna-define-method test-sasl-ntlm-imap ((case test-sasl))
+  (let* ((sasl-mechanisms '("NTLM"))
+        (mechanism
+         (sasl-find-mechanism '("NTLM")))
+        (client
+         (sasl-make-client mechanism "kawagish@nokiaseap" "imap" "xxx.yyy.com"))
+        (sasl-read-passphrase
+         '(lambda (passphrase)
+            (ntlm-get-password-hashes
+             "!\"#456secret")))
+        step
+        response)
+    ;; init
+    (setq step (sasl-next-step client nil))
+    ;; generate authentication request
+    (sasl-step-set-data step "")
+    (setq step (sasl-next-step client step))
+    (sasl-step-data step)
+    ;; (base64-encode-string (sasl-step-data step) t) is sent to server
+    ;; generate response to challenge
+    (sasl-step-set-data
+     step
+     (string-as-unibyte
+      (base64-decode-string
+       "TlRMTVNTUAACAAAADAAMADAAAAAFggEApmEjGvh9M8YAAAAAAAAAAAAAAAA8AAAATgBPAEsARQBYAEMA")))
+    (setq step (sasl-next-step client step))
+    (sasl-step-data step)
+    (setq response (base64-encode-string (sasl-step-data step) t))
+    (lunit-assert
+     (string=
+      response "TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAABIAEgBwAAAAEAAQAIIAAAAQABAAkgAAAAAAAABiAAAABYIBAIwN9i7qK/9Y31dIDR6JQTaBbjcLJm8Sc6VogMe7fnHP96+eQ5Yf3ys2nIY4rx+iQG4AbwBrAGkAYQBzAGUAYQBwAGsAYQB3AGEAZwBpAHMAaABrAGEAdwBhAGcAaQBzAGgA"))
+;;response
+))