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

Function phantom_decorate

scapy/layers/tls/keyexchange.py:82–95  ·  view source on GitHub ↗

Decorator for version-dependent fields. If get_or_add is True (means get), we return s, self.phantom_value. If it is False (means add), we return s.

(f, get_or_add)

Source from the content-addressed store, hash-verified

80
81
82def phantom_decorate(f, get_or_add):
83 """
84 Decorator for version-dependent fields.
85 If get_or_add is True (means get), we return s, self.phantom_value.
86 If it is False (means add), we return s.
87 """
88 def wrapper(*args):
89 self, pkt, s = args[:3]
90 if phantom_mode(pkt):
91 if get_or_add:
92 return s, self.phantom_value
93 return s
94 return f(*args)
95 return wrapper
96
97
98class SigAndHashAlgField(EnumField):

Callers 3

SigAndHashAlgFieldClass · 0.85
SigAndHashAlgsFieldClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…