author | Chris Jones <christian.jones@sri.com> |
Sun, 15 Sep 2013 12:00:17 -0600 | |
changeset 143 | 62166e57800e |
parent 142 | xmpp/stream_test.go@0ff033eed887 |
permissions | -rw-r--r-- |
11
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
1 |
package xmpp |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
2 |
|
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
3 |
import ( |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
4 |
"testing" |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
5 |
) |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
6 |
|
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
7 |
func TestSaslDigest(t *testing.T) { |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
8 |
// These values are from RFC2831, section 4. |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
9 |
obs := saslDigestResponse("chris", "elwood.innosoft.com", |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
10 |
"secret", "OA6MG9tEQGm2hh", "OA6MHXh6VqTrRk", |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
11 |
"AUTHENTICATE", "imap/elwood.innosoft.com", |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
12 |
"00000001") |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
13 |
exp := "d388dad90d4bbd760a152321f2143af7" |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
14 |
assertEquals(t, exp, obs) |
48be1ae93fd4
Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff
changeset
|
15 |
} |