Documentation
¶
Index ¶
- type SecurityFeatures
- type SecurityFeaturesConnectionlessTransport
- type SecurityFeaturesReserved
- type SecurityFeaturesSecuritySignature
- func (s *SecurityFeaturesSecuritySignature) GetSecuritySignature() [8]byte
- func (s *SecurityFeaturesSecuritySignature) Marshal() ([]byte, error)
- func (s *SecurityFeaturesSecuritySignature) SetSecuritySignature(signature [8]byte)
- func (s *SecurityFeaturesSecuritySignature) Unmarshal(data []byte) (int, error)
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 (s *SecurityFeaturesConnectionlessTransport) Marshal() ([]byte, 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)
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