File: README.md

package info (click to toggle)
golang-github-thomsonreuterseikon-go-ntlm 0.0~git20151030.0.b00ec39-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, buster-backports
  • size: 248 kB
  • ctags: 296
  • sloc: makefile: 3
file content (61 lines) | stat: -rw-r--r-- 2,050 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# NTLM Implementation for Go

This is a native implementation of NTLM for Go that was implemented using the Microsoft MS-NLMP documentation available at http://msdn.microsoft.com/en-us/library/cc236621.aspx.
The library is currently in use and has been tested with connectionless NTLMv1 and v2 with and without extended session security.

## Usage Notes

Currently the implementation only supports connectionless (datagram) oriented NTLM. We did not need connection oriented NTLM for our usage
and so it is not implemented. However it should be extremely straightforward to implement connection oriented NTLM as all
the operations required are present in the library. The major missing piece is the negotiation of capabilities between
the client and the server, for our use we hardcoded a supported set of negotiation flags.

## Sample Usage as NTLM Client

```go
import "github.com/ThomsonReutersEikon/go-ntlm/ntlm"

session, err = ntlm.CreateClientSession(ntlm.Version2, ntlm.ConnectionlessMode)
session.SetUserInfo("someuser","somepassword","somedomain")

negotiate := session.GenerateNegotiateMessage()

<send negotiate to server>

challenge, err := ntlm.ParseChallengeMessage(challengeBytes)
session.ProcessChallengeMessage(challenge)

authenticate := session.GenerateAuthenticateMessage()

<send authenticate message to server>
```

## Sample Usage as NTLM Server

```go
session, err := ntlm.CreateServerSession(ntlm.Version1, ntlm.ConnectionlessMode)
session.SetUserInfo("someuser","somepassword","somedomain")

challenge := session.GenerateChallengeMessage()

<send challenge to client>

<receive authentication bytes>

auth, err := ntlm.ParseAuthenticateMessage(authenticateBytes)
session.ProcessAuthenticateMessage(auth)
```

## Generating a message MAC

Once a session is created you can generate the Mac for a message using:

```go
message := "this is some message to sign"
sequenceNumber := 100
signature, err := session.Mac([]byte(message), sequenceNumber)
```

## License
Copyright Thomson Reuters Global Resources 2013
Apache License