| 226 | # SSLv2 fields |
| 227 | |
| 228 | class _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 | |
| 248 | class _SSLv2MACField(_TLSMACField): |
no outgoing calls
no test coverage detected
searching dependent graphs…