Documentation
¶
Overview ¶
Package ntlm provides a very basic implementation of the NTLMv2 protocol. It provides everything needed to authenticate a SMTP authentication request. This package is not feature complete and is intented to only provide the means required for go-mail to perform NTLM via SMTP authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNTLMInvalidChallengeMessage is returned when the challenge message is invalid ErrNTLMInvalidChallengeMessage = errors.New("invalid challenge message") // ErrNTLMInvalidSignature is returned when the NTLM message signature is invalid ErrNTLMInvalidSignature = errors.New("invalid NTLM signature") // ErrNTLMInvalidMessageType is returned when the NTLM message type is invalid ErrNTLMInvalidMessageType = errors.New("invalid NTLM message type") )
var ErrNTLMInvalidAVPair = errors.New("invalid NTLM attribute-value pair")
ErrNTLMInvalidAVPair indicates that an invalid NTLM attribute-value pair was encountered
var ErrNTLMInvalidPayload = errors.New("invalid NTLM payload")
ErrNTLMInvalidPayload is returned when the payload is invalid
Functions ¶
Types ¶
type AuthenticateMessage ¶
type AuthenticateMessage struct {
// contains filtered or unexported fields
}
AuthenticateMessage represents the Type 3 message in the NTLM authentication process.
func (*AuthenticateMessage) Bytes ¶
func (a *AuthenticateMessage) Bytes() []byte
Bytes returns the byte representation of the AuthenticateMessage type (Type 3 message)
type ChallengeMessage ¶
type ChallengeMessage struct {
// contains filtered or unexported fields
}
ChallengeMessage represents an NTLM challenge message (Type 2 message)
type NTLMv2Session ¶
type NTLMv2Session struct {
// contains filtered or unexported fields
}
NTLMv2Session represents a session using the NTLMv2 protocol.
func NewNTLMv2Session ¶
func NewNTLMv2Session() *NTLMv2Session
NewNTLMv2Session returns a new NTLMv2Session.
func (*NTLMv2Session) GenerateAuthenticateMessage ¶
func (s *NTLMv2Session) GenerateAuthenticateMessage() (*AuthenticateMessage, error)
GenerateAuthenticateMessage generates an NTLMv2 AuthenticateMessage (Type 3 message).
func (*NTLMv2Session) GenerateNegotiateMessage ¶
func (s *NTLMv2Session) GenerateNegotiateMessage() (*NegotiateMessage, error)
GenerateNegotiateMessage generates a NTLMv2 negotiation message (Type 1 message).
func (*NTLMv2Session) ParseChallengeMessage ¶
func (s *NTLMv2Session) ParseChallengeMessage(body []byte) error
ParseChallengeMessage parses an NTLM challenge message (Type 2 message) from the given body
func (*NTLMv2Session) SetUserInfo ¶
func (s *NTLMv2Session) SetUserInfo(username, password, domain string)
SetUserInfo sets the user information for the NTLMv2Session.
type NegotiateMessage ¶
type NegotiateMessage struct {
// contains filtered or unexported fields
}
NegotiateMessage represents a NTLMv2 negotiate message (Type 1 message).
func (*NegotiateMessage) Bytes ¶
func (nm *NegotiateMessage) Bytes() ([]byte, error)
Bytes returns the byte representation of the NTLMv2 negotiate message (Type 1 message).