stream_test.go
author Chris Jones <christian.jones@sri.com>
Fri, 28 Dec 2012 17:07:20 -0700
changeset 114 a058e33c1666
parent 11 48be1ae93fd4
permissions -rw-r--r--
Updated for the latest revision of the encoding/xml fixes: The context object owned by Encoder and Decoder isn't directly accessible. Also improved the output from the two assert functions to show the info of the caller rather than the assert function itself.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
     1
// Copyright 2011 The Go Authors.  All rights reserved.
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
     2
// Use of this source code is governed by a BSD-style
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
     3
// license that can be found in the LICENSE file.
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
     4
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
     5
package xmpp
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
import (
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
     8
	"testing"
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
     9
)
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
    10
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
    11
func TestSaslDigest(t *testing.T) {
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
    12
	// These values are from RFC2831, section 4.
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
    13
	obs := saslDigestResponse("chris", "elwood.innosoft.com",
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
    14
		"secret", "OA6MG9tEQGm2hh", "OA6MHXh6VqTrRk",
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
    15
		"AUTHENTICATE", "imap/elwood.innosoft.com",
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
    16
		"00000001")
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
    17
	exp := "d388dad90d4bbd760a152321f2143af7"
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
    18
	assertEquals(t, exp, obs)
48be1ae93fd4 Added SASL digest authentication.
Chris Jones <chris@cjones.org>
parents:
diff changeset
    19
}