Beispiel #1
0
func init() {
	var err error
	PackageInfo, err = sspi.QueryPackageInfo(sspi.NTLMSP_NAME)
	if err != nil {
		panic("failed to fetch NTLM package info: " + err.Error())
	}
}
Beispiel #2
0
func TestQueryPackageInfo(t *testing.T) {
	pkgnames := []string{
		sspi.NTLMSP_NAME,
		sspi.MICROSOFT_KERBEROS_NAME,
		sspi.NEGOSSP_NAME,
		sspi.UNISP_NAME,
	}
	for _, name := range pkgnames {
		pi, err := sspi.QueryPackageInfo(name)
		if err != nil {
			t.Error(err)
			continue
		}
		if pi.Name != name {
			t.Errorf("unexpected package name %q returned for %q package: package info is %#v", pi.Name, name, pi)
			continue
		}
	}
}