Exemple #1
0
func TestDovecot(t *testing.T) {
	if s, e := ks.Ssha512([]byte(hello), 6); e == nil {
		t.Logf("Please run: doveadm pw -t {SSHA512}%s -p \"%s\"", s, hello)
	} else {
		t.Errorf("bad in test dovecot: %v", e)
	}
}
Exemple #2
0
func TestSha(t *testing.T) {

	t.Logf("sha512: %s", ks.Sha512([]byte(hello)))

	if s, e := ks.Ssha512([]byte(hello), salt_len); e == nil {
		t.Logf("ssha512: %s", s)
		if b, e := ks.Csha512(s, []byte(hello)); e == nil {
			if !b {
				t.Errorf("csha512 error")
			}
		} else {
			t.Errorf("csha512 error: %v", e)
		}
	} else {
		t.Errorf("ssha512 error: %v", e)
	}
}