rpc.v1: gopkg.in/jcmturner/rpc.v1/mstypes Index | Files

package mstypes

import "gopkg.in/jcmturner/rpc.v1/mstypes"

Package mstypes implements representations of Microsoft types

Index

Package Files

claims.go common.go filetime.go group_membership.go kerb_sid_and_attributes.go reader.go rpc_unicode_string.go sid.go user_session_key.go

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

func SetFlag Uses

func SetFlag(a *uint32, i uint)

SetFlag sets a flag in a uint32 attribute value.

type ClaimEntry Uses

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 Uses

func (u ClaimEntry) SwitchFunc(_ interface{}) string

SwitchFunc is the ClaimEntry union field selection function

type ClaimTypeBoolean Uses

type ClaimTypeBoolean struct {
    ValueCount uint32
    Value      []bool `ndr:"pointer,conformant"`
}

ClaimTypeBoolean is a claim of type bool

type ClaimTypeInt64 Uses

type ClaimTypeInt64 struct {
    ValueCount uint32
    Value      []int64 `ndr:"pointer,conformant"`
}

ClaimTypeInt64 is a claim of type int64

type ClaimTypeString Uses

type ClaimTypeString struct {
    ValueCount uint32
    Value      []LPWSTR `ndr:"pointer,conformant"`
}

ClaimTypeString is a claim of type string

type ClaimTypeUInt64 Uses

type ClaimTypeUInt64 struct {
    ValueCount uint32
    Value      []uint64 `ndr:"pointer,conformant"`
}

ClaimTypeUInt64 is a claim of type uint64

type ClaimsArray Uses

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 Uses

type ClaimsBlob struct {
    Size        uint32
    EncodedBlob EncodedBlob
}

ClaimsBlob implements https://msdn.microsoft.com/en-us/library/hh554119.aspx

type ClaimsSet Uses

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 Uses

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 Uses

func (m *ClaimsSetMetadata) ClaimsSet() (c ClaimsSet, err error)

ClaimsSet reads the ClaimsSet type from the NDR encoded ClaimsSetBytes in the ClaimsSetMetadata

type CypherBlock Uses

type CypherBlock struct {
    Data [8]byte // size = 8
}

CypherBlock implements https://msdn.microsoft.com/en-us/library/cc237040.aspx

type DomainGroupMembership Uses

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 Uses

type EncodedBlob []byte

EncodedBlob are the bytes of the encoded Claims

func (EncodedBlob) Size Uses

func (b EncodedBlob) Size(c interface{}) int

Size returns the size of the bytes of the encoded Claims

type FileTime Uses

type FileTime struct {
    LowDateTime  uint32
    HighDateTime uint32
}

FileTime implements the Microsoft FILETIME type https://msdn.microsoft.com/en-us/library/cc230324.aspx

func GetFileTime Uses

func GetFileTime(t time.Time) FileTime

GetFileTime returns a FileTime type from the provided Golang Time type.

func (FileTime) MSEpoch Uses

func (ft FileTime) MSEpoch() int64

MSEpoch returns the FileTime as a Microsoft epoch, the number of 100 nano second periods elapsed from January 1, 1601 UTC.

func (FileTime) Time Uses

func (ft FileTime) Time() time.Time

Time return a golang Time type from the FileTime

func (FileTime) Unix Uses

func (ft FileTime) Unix() int64

Unix returns the FileTime as a Unix time, the number of seconds elapsed since January 1, 1970 UTC.

type GroupMembership Uses

type GroupMembership struct {
    RelativeID uint32
    Attributes uint32
}

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 Uses

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 Uses

type LPWSTR struct {
    Value string `ndr:"pointer,conformant,varying"`
}

LPWSTR implements https://msdn.microsoft.com/en-us/library/cc230355.aspx

func (*LPWSTR) String Uses

func (s *LPWSTR) String() string

type RPCSID Uses

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

func (*RPCSID) String Uses

func (s *RPCSID) String() string

String returns the string representation of the RPC_SID.

type RPCUnicodeString Uses

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 Uses

func (r *RPCUnicodeString) String() string

String returns the RPCUnicodeString string value

type Reader Uses

type Reader struct {
    // contains filtered or unexported fields
}

Reader reads simple byte stream data into a Go representations

func NewReader Uses

func NewReader(r io.Reader) *Reader

NewReader creates a new instance of a simple Reader.

func (*Reader) FileTime Uses

func (r *Reader) FileTime() (f FileTime, err error)

func (*Reader) Read Uses

func (r *Reader) Read(p []byte) (n int, err error)

func (*Reader) ReadBytes Uses

func (r *Reader) ReadBytes(n int) ([]byte, error)

readBytes returns a number of bytes from the NDR byte stream.

func (*Reader) UTF16String Uses

func (r *Reader) UTF16String(n int) (str string, err error)

UTF16String returns a string that is UTF16 encoded in a byte slice. n is the number of bytes representing the string

func (*Reader) Uint16 Uses

func (r *Reader) Uint16() (uint16, error)

func (*Reader) Uint32 Uses

func (r *Reader) Uint32() (uint32, error)

func (*Reader) Uint64 Uses

func (r *Reader) Uint64() (uint64, error)

func (*Reader) Uint8 Uses

func (r *Reader) Uint8() (uint8, error)

type UserSessionKey Uses

type UserSessionKey struct {
    CypherBlock [2]CypherBlock // size = 2
}

UserSessionKey implements https://msdn.microsoft.com/en-us/library/cc237080.aspx

Package mstypes imports 9 packages (graph) and is imported by 14 packages. Updated 2018-08-28. Refresh now. Tools for package owners.