dtls: Add support for ephemeral DTLS certificates.

This mimics the behavior of Chrome and Firefox and creates an ephemeral
X.509 certificate for each DTLS session.

Currently, the only supported key type is ECDSA because of its faster
generation time, but other key types can be added in the future as
necessary.

ASTERISK-27395

Change-Id: I5122e5f4b83c6320cc17407a187fcf491daf30b4
This commit is contained in:
Sean Bright
2017-09-29 14:50:17 +00:00
committed by Joshua Colp
parent be5b7b2076
commit 04d3785a79
10 changed files with 409 additions and 81 deletions

View File

@@ -508,6 +508,7 @@ struct ast_rtp_dtls_cfg {
char *cipher; /*!< Cipher to use */
char *cafile; /*!< Certificate authority file */
char *capath; /*!< Path to certificate authority */
unsigned int ephemeral_cert:1; /*!< Whether to not to generate an ephemeral certificate - defaults to 0 (off) */
};
/*! \brief Structure that represents the optional DTLS SRTP support within an RTP engine */
@@ -2349,6 +2350,16 @@ struct ast_rtp_engine_dtls *ast_rtp_instance_get_dtls(struct ast_rtp_instance *i
*/
int ast_rtp_dtls_cfg_parse(struct ast_rtp_dtls_cfg *dtls_cfg, const char *name, const char *value);
/*!
* \brief Validates DTLS related configuration options
*
* \param dtls_cfg a DTLS configuration structure
*
* \retval 0 if valid
* \retval -1 if invalid
*/
int ast_rtp_dtls_cfg_validate(struct ast_rtp_dtls_cfg *dtls_cfg);
/*!
* \brief Copy contents of a DTLS configuration structure
*