File: messageheader.go

package info (click to toggle)
golang-github-azure-go-ntlmssp 0.0~git20160412.e0b63eb-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 108 kB
  • ctags: 90
  • sloc: makefile: 5
file content (21 lines) | stat: -rw-r--r-- 416 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
package ntlmssp

import (
	"bytes"
)

var signature = [8]byte{'N', 'T', 'L', 'M', 'S', 'S', 'P', 0}

type messageHeader struct {
	Signature   [8]byte
	MessageType uint32
}

func (h messageHeader) IsValid() bool {
	return bytes.Equal(h.Signature[:], signature[:]) &&
		h.MessageType > 0 && h.MessageType < 4
}

func newMessageHeader(messageType uint32) messageHeader {
	return messageHeader{signature, messageType}
}