securityfeatures
import "github.com/TheManticoreProject/Manticore/network/smb/smb_v10/message/securityfeatures"
Index
- type SecurityFeatures
- type SecurityFeaturesConnectionlessTransport
- type SecurityFeaturesReserved
- type SecurityFeaturesSecuritySignature
- func NewSecurityFeaturesSecuritySignature() *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)
type SecurityFeatures
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 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)
}
type SecurityFeaturesConnectionlessTransport
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
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
}
func NewSecurityFeaturesConnectionlessTransport
func NewSecurityFeaturesConnectionlessTransport() *SecurityFeaturesConnectionlessTransport
func (*SecurityFeaturesConnectionlessTransport) Marshal
func (s *SecurityFeaturesConnectionlessTransport) Marshal() ([]byte, error)
func (*SecurityFeaturesConnectionlessTransport) Unmarshal
func (s *SecurityFeaturesConnectionlessTransport) Unmarshal(data []byte) (int, error)
type SecurityFeaturesReserved
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
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
}
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
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
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
}
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