-
Pierre Lorinquer authored
The default values of the "value_size" field is None. This can trigger an issue when computing the "len" field. Test: str(EAP_MD5()) In order to fix this issue, the default value of the "value_size" field has been set to 0. Tests have been added in "regression.uts". Added regression tests for EAP_TLS and EAP_FAST. Use XStrLenField in EAP_MD5, EAP_TLS and EAP_FAST packets instead of StrLenField. Delete blank lines before the class description (EAPOL, EAP, EAP_MD5, EAP_TLS and EAP_FAST packet classes). "registered_options" dictionary was renamed "registered_methods" (EAP-MD5, EAP-TLS etc are not options, but authentication methods). EAP getlayer() and haslayer() methods have been overloaded in order to allow access to a given "EAP layer" (such as EAP_TLS, for instance) by providing the parent class name ("EAP"). For example, this is now possible: >>> eap_tls = EAP_TLS() >>> EAP_TLS in eap_tls True >>> EAP in eap_tls True >>> eap_tls[EAP_TLS] <EAP_TLS |> >>> eap_tls[EAP] <EAP_TLS |> Regression tests have been added.
2cd6d334