securityfeatures

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecurityFeatures

type SecurityFeatures interface {
	// Marshal serializes the security features into a byte slice
	Marshal() ([]byte, error)

	// Unmarshal deserializes a byte slice into the security features
	Unmarshal([]byte) (int, error)
}

SecurityFeatures is an interface that represents the 8-byte security features field in the SMB header This interface allows for different implementations of the security features field based on the context: - SecurityFeaturesSecuritySignature: Used when SMB signing has been negotiated - SecurityFeaturesConnectionlessTransport: Used for connectionless transports - SecurityFeaturesReserved: Used when neither of the above applies Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/69a29f73-de0c-45a6-a1aa-8ceeea42217f

type SecurityFeaturesConnectionlessTransport

type SecurityFeaturesConnectionlessTransport struct {
	// Key (4 bytes): An encryption key used for validating messages over connectionless transports.
	Key uint32
	// CID (2 bytes): A connection identifier (CID).
	CID uint16
	// SequenceNumber (2 bytes): A number used to identify the sequence of a message over connectionless transports.
	SequenceNumber uint16
}

SecurityFeatures represents the 8-byte security features field in the SMB header Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/69a29f73-de0c-45a6-a1aa-8ceeea42217f

func NewSecurityFeaturesConnectionlessTransport

func NewSecurityFeaturesConnectionlessTransport() *SecurityFeaturesConnectionlessTransport

func (*SecurityFeaturesConnectionlessTransport) Marshal

func (*SecurityFeaturesConnectionlessTransport) Unmarshal

func (s *SecurityFeaturesConnectionlessTransport) Unmarshal(data []byte) (int, error)

type SecurityFeaturesReserved

type SecurityFeaturesReserved struct {
	// Finally, if neither of the above two cases applies,the SecurityFeatures field is treated as a reserved field,
	// which MUST be set to zero by the client and MUST be ignored by the server.
	Reserved [8]byte
}

SecurityFeaturesReserved represents the 8-byte security features field in the SMB header Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/69a29f73-de0c-45a6-a1aa-8ceeea42217f

func NewSecurityFeaturesReserved

func NewSecurityFeaturesReserved() *SecurityFeaturesReserved

func (*SecurityFeaturesReserved) Marshal

func (s *SecurityFeaturesReserved) Marshal() ([]byte, error)

func (*SecurityFeaturesReserved) Unmarshal

func (s *SecurityFeaturesReserved) Unmarshal(data []byte) (int, error)

type SecurityFeaturesSecuritySignature

type SecurityFeaturesSecuritySignature struct {
	// SecuritySignature (8 bytes): If SMB signing has been negotiated, this field MUST contain an
	// 8-byte cryptographic message signature that can be used to detect whether the message was modified
	// while in transit. The use of message signing is mutually exclusive with connectionless transport.
	SecuritySignature [8]byte
}

SecurityFeaturesSecuritySignature represents the 8-byte security features field in the SMB header Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/69a29f73-de0c-45a6-a1aa-8ceeea42217f

func NewSecurityFeaturesSecuritySignature

func NewSecurityFeaturesSecuritySignature() *SecurityFeaturesSecuritySignature

NewSecurityFeaturesSecuritySignature creates a new SecurityFeaturesSecuritySignature with a zeroed 8-byte security signature

func (*SecurityFeaturesSecuritySignature) GetSecuritySignature

func (s *SecurityFeaturesSecuritySignature) GetSecuritySignature() [8]byte

GetSecuritySignature returns the 8-byte security signature

func (*SecurityFeaturesSecuritySignature) Marshal

func (s *SecurityFeaturesSecuritySignature) Marshal() ([]byte, error)

Marshal marshals the 8-byte security signature into a byte slice

func (*SecurityFeaturesSecuritySignature) SetSecuritySignature

func (s *SecurityFeaturesSecuritySignature) SetSecuritySignature(signature [8]byte)

SetSecuritySignature sets the 8-byte security signature

func (*SecurityFeaturesSecuritySignature) Unmarshal

func (s *SecurityFeaturesSecuritySignature) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals the 8-byte security signature from the given data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL