kbandla / dpkt

fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
Other
1.09k stars 270 forks source link

Fix #587 #588

Closed obormot closed 3 years ago

obormot commented 3 years ago

Improvements to TLS ClientHello and ServerHello parsing:

  1. return an "Unknown" ciphersuite instead of raising an exception;
  2. add codes for RFC8701, GREASE ciphersutes;
  3. CipherSuite __repr__ now includes the numerical code;
  4. rename a couple attributes to align between ClientHello and ServerHello classes, original names still supported.

Examples:

ciphersuites=[
      CipherSuite(0x4a4a, GREASE),                     # old behavior: raise an exception, issue #587
      CipherSuite(0x1301, TLS_AES_128_GCM_SHA256),    # old behavior: CipherSuite(TLS_AES_128_GCM_SHA256)
      CipherSuite(0x001c, Unknown),                  # old behavior: raise an exception
      ...
]
coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.0001%) to 99.815% when pulling 438acca6fd82fe13c875ea1a5d5bb81785a7e279 on fix-#587 into 0746d4814163ff9310de740b6f3730407d092ea0 on master.

obormot commented 3 years ago

Trying to summon @c0r0n3r to review these changes as I'm modifying his code here