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

Class _SSLv2LengthField

scapy/layers/tls/basefields.py:228–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226# SSLv2 fields
227
228class _SSLv2LengthField(_TLSLengthField):
229 def i2repr(self, pkt, x):
230 s = super(_SSLv2LengthField, self).i2repr(pkt, x)
231 if pkt.with_padding:
232 x |= 0x8000
233 # elif pkt.with_escape: #XXX no complete support for 'escape' yet
234 # x |= 0x4000
235 s += " [with padding: %s]" % hex(x)
236 return s
237
238 def getfield(self, pkt, s):
239 msglen = struct.unpack('!H', s[:2])[0]
240 pkt.with_padding = (msglen & 0x8000) == 0
241 if pkt.with_padding:
242 msglen_clean = msglen & 0x3fff
243 else:
244 msglen_clean = msglen & 0x7fff
245 return s[2:], msglen_clean
246
247
248class _SSLv2MACField(_TLSMACField):

Callers 1

SSLv2Class · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…