MCPcopy Create free account
hub / github.com/secdev/scapy / sign

Method sign

scapy/layers/smb2.py:1962–1978  ·  view source on GitHub ↗

[MS-SMB2] 3.1.4.1 - Signing An Outgoing Message

(self, dialect, SigningSessionKey, SigningAlgorithmId=None, IsClient=None)

Source from the content-addressed store, hash-verified

1960 return sig
1961
1962 def sign(self, dialect, SigningSessionKey, SigningAlgorithmId=None, IsClient=None):
1963 """
1964 [MS-SMB2] 3.1.4.1 - Signing An Outgoing Message
1965 """
1966 # Set the current signature to nul
1967 self.SecuritySignature = b"\x00" * 16
1968 # Calculate the signature
1969 s = bytes(self)
1970 self.SecuritySignature = self._calc_signature(
1971 s,
1972 dialect=dialect,
1973 SigningSessionKey=SigningSessionKey,
1974 SigningAlgorithmId=SigningAlgorithmId,
1975 IsClient=IsClient,
1976 )
1977 # we make sure the payload is static
1978 self.payload = conf.raw_layer(load=s[64:])
1979
1980 def verify(
1981 self, dialect, SigningSessionKey, SigningAlgorithmId=None, IsClient=None

Callers 1

out_pktMethod · 0.45

Calls 1

_calc_signatureMethod · 0.95

Tested by

no test coverage detected