diff --git a/hkexauth.go b/hkexauth.go index 7806512..c5018f6 100644 --- a/hkexauth.go +++ b/hkexauth.go @@ -94,8 +94,8 @@ func AuthUserByToken(username string, connhostname string, auth string) (valid b } record[0] = strings.TrimSpace(record[0]) record[1] = strings.TrimSpace(record[1]) - fmt.Println("auth:", auth, "record:", - strings.Join([]string{record[0], record[1]}, ":")) + //fmt.Println("auth:", auth, "record:", + // strings.Join([]string{record[0], record[1]}, ":")) if (connhostname == record[0]) && (auth == strings.Join([]string{record[0], record[1]}, ":")) { diff --git a/hkexsh/hkexsh.go b/hkexsh/hkexsh.go index b4862c4..4427e06 100755 --- a/hkexsh/hkexsh.go +++ b/hkexsh/hkexsh.go @@ -482,21 +482,20 @@ func main() { idx := strings.Index(string(ab), remoteHost) if idx >= 0 { ab = ab[idx:] + entries := strings.SplitN(string(ab), "\n", -1) + //if len(entries) > 0 { + //fmt.Println("entries[0]:", entries[0]) + authCookie = strings.TrimSpace(entries[0]) + //} else { + // fmt.Fprintln(os.Stderr, "ERROR: no matching authtoken") + // os.Exit(1) + //} + // Security scrub + ab = nil + runtime.GC() } else { fmt.Fprintln(os.Stderr, "ERROR: no matching authtoken") - os.Exit(1) } - entries := strings.SplitN(string(ab), "\n", -1) - //if len(entries) > 0 { - //fmt.Println("entries[0]:", entries[0]) - authCookie = strings.TrimSpace(entries[0]) - //} else { - // fmt.Fprintln(os.Stderr, "ERROR: no matching authtoken") - // os.Exit(1) - //} - // Security scrub - ab = nil - runtime.GC() } }