tintinweb / scapy-ssl_tls

SSL/TLS layers for scapy the interactive packet manipulation tool
GNU General Public License v2.0
419 stars 156 forks source link

XBLenField class has unexpected keyword argument 'length_from' #1

Closed rpp0 closed 10 years ago

rpp0 commented 10 years ago

A length_from argument is passed to XBLenField, where it is not declared. Example output:

Traceback (most recent call last):
  File "example.py", line 8, in <module>
    from scapy.layers.ssl_tls import *
  File "/usr/lib/python2.7/site-packages/scapy/layers/ssl_tls.py", line 206, in <module>
    class TLSHandshake(Packet):
  File "/usr/lib/python2.7/site-packages/scapy/layers/ssl_tls.py", line 209, in TLSHandshake
    XBLenField("length",None, fmt="!I", numbytes=3, length_from=lambda x:x.payload),]
TypeError: __init__() got an unexpected keyword argument 'length_from'

If you want I can take a look at it tomorrow :)?

jonaslejon commented 10 years ago

Yes. Please fix

tintinweb commented 10 years ago

I'm sorry for the delay, should be fixed with f757f74431fc4ba255cc5c1c83e3e5173ca4d26b

tintinweb commented 10 years ago

also fixed example.py with b250d236385dd5c96da814000cbe2e3bfcda7819 (too many items for ByteEnumField) and renamed it to reflect that it intentionally sends an invalid handshake.

also added an example that sends a valid client_hello.