go-ntlm/utils/decode_auth.go
Russ Cox 7b9c9198d5 utils: make repo safe for "go build ./..."
This directory contains two separate helper programs
that can be run with "go run". It's not possible to cd into
the directory and run "go build", because there are two
different Go source files defining main.main.

The canonical way to indicate this is to put a "// +build ignore"
build tag at the top of such helper programs.
Then they can still be run by

	go run decode_auth.go
	go run test_auth.go

but will not be considered by "cd utils; go build" nor by
commands like "go build ./..." or "go test ./..." in the
root of the repo.
2018-05-24 22:55:54 -04:00

23 lines
509 B
Go

// +build ignore
package main
import (
"encoding/base64"
"flag"
"fmt"
"github.com/ThomsonReutersEikon/go-ntlm/ntlm"
)
func main() {
var ntlmVersion = flag.Int("ntlm", 2, "NTLM version to try: 1 or 2")
flag.Parse()
var data string
fmt.Println("Paste the base64 encoded Authenticate message (with no line breaks):")
fmt.Scanf("%s", &data)
authenticateData, _ := base64.StdEncoding.DecodeString(data)
a, _ := ntlm.ParseAuthenticateMessage(authenticateData, *ntlmVersion)
fmt.Printf(a.String())
}