net: sockets: tls: Support for DER cert chain and NOCOPY optimisation
Add TLS socket option "TLS_CERT_NOCOPY" to prevent the copy of certificates to mbedTLS heap if possible. Add support to provide a chain of DER certificates by registering them with multiple tags. Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
This commit is contained in:
parent
2fe6127425
commit
4e103bcb20
2 changed files with 118 additions and 29 deletions
|
@ -139,6 +139,12 @@ struct zsock_pollfd {
|
|||
#define TLS_DTLS_HANDSHAKE_TIMEOUT_MIN 8
|
||||
#define TLS_DTLS_HANDSHAKE_TIMEOUT_MAX 9
|
||||
|
||||
/** Socket option for preventing certificates from being copied to the mbedTLS
|
||||
* heap if possible. The option is only effective for DER certificates and is
|
||||
* ignored for PEM certificates.
|
||||
*/
|
||||
#define TLS_CERT_NOCOPY 10
|
||||
|
||||
/** @} */
|
||||
|
||||
/* Valid values for TLS_PEER_VERIFY option */
|
||||
|
@ -150,6 +156,10 @@ struct zsock_pollfd {
|
|||
#define TLS_DTLS_ROLE_CLIENT 0 /**< Client role in a DTLS session. */
|
||||
#define TLS_DTLS_ROLE_SERVER 1 /**< Server role in a DTLS session. */
|
||||
|
||||
/* Valid values for TLS_CERT_NOCOPY option */
|
||||
#define TLS_CERT_NOCOPY_NONE 0 /**< Cert duplicated in heap */
|
||||
#define TLS_CERT_NOCOPY_OPTIONAL 1 /**< Cert not copied in heap if DER */
|
||||
|
||||
struct zsock_addrinfo {
|
||||
struct zsock_addrinfo *ai_next;
|
||||
int ai_flags;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue