Documentation ¶
Overview ¶
Package mstypes implements representations of Microsoft types
Index ¶
- Constants
- func SetFlag(a *uint32, i uint)
- type ClaimEntry
- type ClaimTypeBoolean
- type ClaimTypeInt64
- type ClaimTypeString
- type ClaimTypeUInt64
- type ClaimsArray
- type ClaimsBlob
- type ClaimsSet
- type ClaimsSetMetadata
- type CypherBlock
- type DomainGroupMembership
- type EncodedBlob
- type FileTime
- type GroupMembership
- type KerbSidAndAttributes
- type LPWSTR
- type RPCSID
- type RPCUnicodeString
- type Reader
- func (r *Reader) FileTime() (f FileTime, err error)
- func (r *Reader) Read(p []byte) (n int, err error)
- func (r *Reader) ReadBytes(n int) ([]byte, error)
- func (r *Reader) UTF16String(n int) (str string, err error)
- func (r *Reader) Uint16() (uint16, error)
- func (r *Reader) Uint32() (uint32, error)
- func (r *Reader) Uint64() (uint64, error)
- func (r *Reader) Uint8() (uint8, error)
- type UserSessionKey
Constants ¶
const ( CompressionFormatNone uint16 = 0 CompressionFormatLZNT1 uint16 = 2 CompressionFormatXPress uint16 = 3 CompressionFormatXPressHuff uint16 = 4 )
Compression format assigned numbers.
const ( ClaimTypeIDInt64 uint16 = 1 ClaimTypeIDUInt64 uint16 = 2 ClaimTypeIDString uint16 = 3 ClaimsTypeIDBoolean uint16 = 6 )
Claim Type assigned numbers
const ( SEGroupMandatory = 31 SEGroupEnabledByDefault = 30 SEGroupEnabled = 29 SEGroupOwner = 28 SEGroupResource = 2 )
Attributes of a security group membership and can be combined by using the bitwise OR operation. They are used by an access check mechanism to specify whether the membership is to be used in an access check decision.
const ( SizeBool = 1 SizeChar = 1 SizeUint8 = 1 SizeUint16 = 2 SizeUint32 = 4 SizeUint64 = 8 SizeEnum = 2 SizeSingle = 4 SizeDouble = 8 SizePtr = 4 )
Byte sizes of primitive types
const ClaimsSourceTypeAD uint16 = 1
ClaimsSourceTypeAD https://msdn.microsoft.com/en-us/library/hh553809.aspx
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClaimEntry ¶
type ClaimEntry struct { ID string `ndr:"pointer,conformant,varying"` Type uint16 `ndr:"unionTag"` TypeInt64 ClaimTypeInt64 `ndr:"unionField"` TypeUInt64 ClaimTypeUInt64 `ndr:"unionField"` TypeString ClaimTypeString `ndr:"unionField"` TypeBool ClaimTypeBoolean `ndr:"unionField"` }
ClaimEntry is a NDR union that implements https://msdn.microsoft.com/en-us/library/hh536374.aspx
func (ClaimEntry) SwitchFunc ¶
func (u ClaimEntry) SwitchFunc(_ interface{}) string
SwitchFunc is the ClaimEntry union field selection function
type ClaimTypeBoolean ¶
ClaimTypeBoolean is a claim of type bool
type ClaimTypeInt64 ¶
ClaimTypeInt64 is a claim of type int64
type ClaimTypeString ¶
ClaimTypeString is a claim of type string
type ClaimTypeUInt64 ¶
ClaimTypeUInt64 is a claim of type uint64
type ClaimsArray ¶
type ClaimsArray struct { ClaimsSourceType uint16 ClaimsCount uint32 ClaimEntries []ClaimEntry `ndr:"pointer,conformant"` }
ClaimsArray implements https://msdn.microsoft.com/en-us/library/hh536458.aspx
type ClaimsBlob ¶
type ClaimsBlob struct { Size uint32 EncodedBlob EncodedBlob }
ClaimsBlob implements https://msdn.microsoft.com/en-us/library/hh554119.aspx
type ClaimsSet ¶
type ClaimsSet struct { ClaimsArrayCount uint32 ClaimsArrays []ClaimsArray `ndr:"pointer,conformant"` ReservedType uint16 ReservedFieldSize uint32 ReservedField []byte `ndr:"pointer,conformant"` }
ClaimsSet implements https://msdn.microsoft.com/en-us/library/hh554122.aspx
type ClaimsSetMetadata ¶
type ClaimsSetMetadata struct { ClaimsSetSize uint32 ClaimsSetBytes []byte `ndr:"pointer,conformant"` CompressionFormat uint16 // Enum see constants for options UncompressedClaimsSetSize uint32 ReservedType uint16 ReservedFieldSize uint32 ReservedField []byte `ndr:"pointer,conformant"` }
ClaimsSetMetadata implements https://msdn.microsoft.com/en-us/library/hh554073.aspx
func (*ClaimsSetMetadata) ClaimsSet ¶
func (m *ClaimsSetMetadata) ClaimsSet() (c ClaimsSet, err error)
ClaimsSet reads the ClaimsSet type from the NDR encoded ClaimsSetBytes in the ClaimsSetMetadata
type CypherBlock ¶
type CypherBlock struct {
Data [8]byte // size = 8
}
CypherBlock implements https://msdn.microsoft.com/en-us/library/cc237040.aspx
type DomainGroupMembership ¶
type DomainGroupMembership struct { DomainID RPCSID `ndr:"pointer"` GroupCount uint32 GroupIDs []GroupMembership `ndr:"pointer,conformant"` // Size is value of GroupCount }
DomainGroupMembership implements https://msdn.microsoft.com/en-us/library/hh536344.aspx DomainId: A SID structure that contains the SID for the domain.This member is used in conjunction with the GroupIds members to create group SIDs for the device. GroupCount: A 32-bit unsigned integer that contains the number of groups within the domain to which the account belongs. GroupIds: A pointer to a list of GROUP_MEMBERSHIP structures that contain the groups to which the account belongs in the domain. The number of groups in this list MUST be equal to GroupCount.
type EncodedBlob ¶
type EncodedBlob []byte
EncodedBlob are the bytes of the encoded Claims
func (EncodedBlob) Size ¶
func (b EncodedBlob) Size(c interface{}) int
Size returns the size of the bytes of the encoded Claims
type FileTime ¶
FileTime implements the Microsoft FILETIME type https://msdn.microsoft.com/en-us/library/cc230324.aspx
func GetFileTime ¶
GetFileTime returns a FileTime type from the provided Golang Time type.
func (FileTime) MSEpoch ¶
MSEpoch returns the FileTime as a Microsoft epoch, the number of 100 nano second periods elapsed from January 1, 1601 UTC.
type GroupMembership ¶
GroupMembership implements https://msdn.microsoft.com/en-us/library/cc237945.aspx RelativeID : A 32-bit unsigned integer that contains the RID of a particular group. The possible values for the Attributes flags are identical to those specified in KERB_SID_AND_ATTRIBUTES
type KerbSidAndAttributes ¶
type KerbSidAndAttributes struct { SID RPCSID `ndr:"pointer"` // A pointer to an RPC_SID structure. Attributes uint32 }
KerbSidAndAttributes implements https://msdn.microsoft.com/en-us/library/cc237947.aspx
type LPWSTR ¶
type LPWSTR struct {
Value string `ndr:"pointer,conformant,varying"`
}
LPWSTR implements https://msdn.microsoft.com/en-us/library/cc230355.aspx
type RPCSID ¶
type RPCSID struct { Revision uint8 // An 8-bit unsigned integer that specifies the revision level of the SID. This value MUST be set to 0x01. SubAuthorityCount uint8 // An 8-bit unsigned integer that specifies the number of elements in the SubAuthority array. The maximum number of elements allowed is 15. IdentifierAuthority [6]byte // An RPC_SID_IDENTIFIER_AUTHORITY structure that indicates the authority under which the SID was created. It describes the entity that created the SID. The Identifier Authority value {0,0,0,0,0,5} denotes SIDs created by the NT SID authority. SubAuthority []uint32 `ndr:"conformant"` // A variable length array of unsigned 32-bit integers that uniquely identifies a principal relative to the IdentifierAuthority. Its length is determined by SubAuthorityCount. }
RPCSID implements https://msdn.microsoft.com/en-us/library/cc230364.aspx
type RPCUnicodeString ¶
type RPCUnicodeString struct { Length uint16 // The length, in bytes, of the string pointed to by the Buffer member, not including the terminating null character if any. The length MUST be a multiple of 2. The length SHOULD equal the entire size of the Buffer, in which case there is no terminating null character. Any method that accesses this structure MUST use the Length specified instead of relying on the presence or absence of a null character. MaximumLength uint16 // The maximum size, in bytes, of the string pointed to by Buffer. The size MUST be a multiple of 2. If not, the size MUST be decremented by 1 prior to use. This value MUST not be less than Length. Value string `ndr:"pointer,conformant,varying"` }
RPCUnicodeString implements https://msdn.microsoft.com/en-us/library/cc230365.aspx
func (*RPCUnicodeString) String ¶
func (r *RPCUnicodeString) String() string
String returns the RPCUnicodeString string value
type Reader ¶ added in v1.1.0
type Reader struct {
// contains filtered or unexported fields
}
Reader reads simple byte stream data into a Go representations
func (*Reader) ReadBytes ¶ added in v1.1.0
readBytes returns a number of bytes from the NDR byte stream.
func (*Reader) UTF16String ¶ added in v1.1.0
UTF16String returns a string that is UTF16 encoded in a byte slice. n is the number of bytes representing the string
type UserSessionKey ¶
type UserSessionKey struct {
CypherBlock [2]CypherBlock // size = 2
}
UserSessionKey implements https://msdn.microsoft.com/en-us/library/cc237080.aspx