altcp_tls: some fixes

- added `altcp_tls_free_config()`.
- added `altcp_tls_context()` function to allow mbedtls parameter tweak.

  Since state structure isn't exported, this allow application to get
  internal context (port dependent) to tweak it.

- free altcp_pcb when lower error callback called.
This commit is contained in:
David Girault
2017-08-07 15:45:11 +02:00
committed by goldsimon
parent ee89d906ec
commit 0486100a2b
2 changed files with 35 additions and 2 deletions

View File

@@ -72,11 +72,22 @@ struct altcp_tls_config *altcp_tls_create_config_server_privkey_cert(const u8_t
*/
struct altcp_tls_config *altcp_tls_create_config_client(const u8_t *cert, size_t cert_len);
/** @ingroup altcp_tls
* Free an ALTCP_TLS configuration handle
*/
void altcp_tls_free_config(struct altcp_tls_config *conf);
/** @ingroup altcp_tls
* Create new ALTCP_TLS layer
*/
struct altcp_pcb *altcp_tls_new(struct altcp_tls_config* config, struct altcp_pcb *inner_pcb);
/** @ingroup altcp_tls
* Return pointer to internal TLS context so application can tweak it.
* Real type depends on port (e.g. mbedtls)
*/
void *altcp_tls_context (struct altcp_pcb *conn);
#ifdef __cplusplus
}
#endif