trevp/tlslite — pull request #33 by tomato42 (2014-12-18 14:57:14+00:00)
Title: Change implementation of extensions in ClientHello to a list

As the name suggests, the extensions mechanism should be extensible this patch series makes it so.

Implements:
- generic `TLSExtension` class (e.g. for use when the extension doesn't require a payload)
- `SNIExtension` for handling server_name extension in full of its potential (support for more than one name and names different than domain names)
- `NPNExtension` for handling the next protocol extension
- `SRPExtension` for handling secure remote password
- `ClntCertTypeExtension` for handling the cert_type extension (ClientHello variant)

Makes parsing and serializing extensions generic, moves it out of `ClientHello` class.

As a side effect, `ClientHello` now preserves the order of extensions, doesn't drop additional names from SNI and can also send and receive arbitrary extensions without any additional changes. Fully preserves old API using property mechanism.

Includes extension-specific test coverage for the introduced classes and some extra documentation for `ClientHello` class.