[MS-SMB2] 3.1.4.1 - Signing An Outgoing Message
(self, dialect, SigningSessionKey, SigningAlgorithmId=None, IsClient=None)
| 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 |
no test coverage detected