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

Method verify_mac

scapy/layers/tls/record.py:458–466  ·  view source on GitHub ↗

Verify integrity.

(hdr, cfrag, mac)

Source from the content-addressed store, hash-verified

456 return frag, mac
457
458 def verify_mac(hdr, cfrag, mac):
459 """Verify integrity."""
460 chdr = hdr[:3] + struct.pack('!H', len(cfrag))
461 is_mac_ok = self._tls_hmac_verify(chdr, cfrag, mac)
462 if not is_mac_ok:
463 pkt_info = self.firstlayer().summary()
464 log_runtime.info(
465 "TLS: record integrity check failed [%s]", pkt_info,
466 )
467
468 if cipher_type == 'block':
469 version = struct.unpack("!H", s[1:3])[0]

Callers

nothing calls this directly

Calls 3

_tls_hmac_verifyMethod · 0.95
firstlayerMethod · 0.80
summaryMethod · 0.45

Tested by

no test coverage detected