def _verify_signature(self, message, signature):
if self.negotiate_flags &NegotiateFlags.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY:<EOL><INDENT>actual_checksum = signature[<NUM_LIT:4>:<NUM_LIT:12>]<EOL>actual_seq_num = struct.unpack("<STR_LIT>", signature[<NUM_LIT:12>:<NUM_LIT:16>])[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>actual_checksum = signature[<NUM_LIT:8>:<NUM_LIT:12>]<EOL>actual_seq_num = struct.unpack("<STR_LIT>", signature[<NUM_LIT:12>:<NUM_LIT:16>])[<NUM_LIT:0>]<EOL><DEDENT>expected_signature = calc_signature(message, self.negotiate_flags,<EOL>self.incoming_signing_key,<EOL>self.incoming_seq_num,<EOL>self.incoming_handle)<EOL>expected_checksum = expected_signature.checksum<EOL>expected_seq_num = struct.unpack("<STR_LIT>", expected_signature.seq_num)[<NUM_LIT:0>]<EOL>if actual_checksum != expected_checksum:<EOL><INDENT>raise Exception("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if actual_seq_num != expected_seq_num:<EOL><INDENT>raise Exception("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>self.incoming_seq_num += <NUM_LIT:1><EOL>
Will verify that the signature received from the server matches up with
the expected signature computed locally. Will throw an exception if
they do not match

:param message: The message data that is received from the server
:param signature: The signature of the message received from the server