diff options
author | Joshua Colp <jcolp@digium.com> | 2014-06-30 19:51:28 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2014-06-30 19:51:28 +0000 |
commit | 6e60f5d317d2bccaa556c98fbcc01d2db5796c1e (patch) | |
tree | 9d2e1bd2d26e584aa31e3b6b019ffe145784a2b2 /include/asterisk/rtp_engine.h | |
parent | 688bb204dc872aaec9f2b829fe85039c08091b55 (diff) |
Recorded merge of revisions 417677 from http://svn.asterisk.org/svn/asterisk/branches/11
........
res_rtp_asterisk: Add SHA-256 support for DTLS and perform DTLS negotiation on RTCP.
This change fixes up DTLS support in res_rtp_asterisk so it can accept and provide
a SHA-256 fingerprint, so it occurs on RTCP, and so it occurs after ICE negotiation
completes. Configuration options to chan_sip and chan_pjsip have also been added to
allow behavior to be tweaked (such as forcing the AVP type media transports in SDP).
ASTERISK-22961 #close
Reported by: Jay Jideliov
Review: https://reviewboard.asterisk.org/r/3679/
Review: https://reviewboard.asterisk.org/r/3686/
........
Merged revisions 417678 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/rtp_engine.h')
-rw-r--r-- | include/asterisk/rtp_engine.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h index 25a3a815f..81e530e85 100644 --- a/include/asterisk/rtp_engine.h +++ b/include/asterisk/rtp_engine.h @@ -390,6 +390,12 @@ enum ast_rtp_ice_component_type { AST_RTP_ICE_COMPONENT_RTCP = 2, }; +/*! \brief ICE role during negotiation */ +enum ast_rtp_ice_role { + AST_RTP_ICE_ROLE_CONTROLLED, + AST_RTP_ICE_ROLE_CONTROLLING, +}; + /*! \brief Structure for an ICE candidate */ struct ast_rtp_engine_ice_candidate { char *foundation; /*!< Foundation identifier */ @@ -419,6 +425,8 @@ struct ast_rtp_engine_ice { struct ao2_container *(*get_local_candidates)(struct ast_rtp_instance *instance); /*! Callback for telling the ICE support that it is talking to an ice-lite implementation */ void (*ice_lite)(struct ast_rtp_instance *instance); + /*! Callback for changing our role in negotiation */ + void (*set_role)(struct ast_rtp_instance *instance, enum ast_rtp_ice_role role); }; /*! \brief DTLS setup types */ @@ -431,22 +439,31 @@ enum ast_rtp_dtls_setup { /*! \brief DTLS connection states */ enum ast_rtp_dtls_connection { - AST_RTP_DTLS_CONNECTION_NEW, /*!< Endpoint wants to use a new connection */ + AST_RTP_DTLS_CONNECTION_NEW, /*!< Endpoint wants to use a new connection */ AST_RTP_DTLS_CONNECTION_EXISTING, /*!< Endpoint wishes to use existing connection */ }; /*! \brief DTLS fingerprint hashes */ enum ast_rtp_dtls_hash { - AST_RTP_DTLS_HASH_SHA1, /*!< SHA-1 fingerprint hash */ + AST_RTP_DTLS_HASH_SHA256, /*!< SHA-256 fingerprint hash */ + AST_RTP_DTLS_HASH_SHA1, /*!< SHA-1 fingerprint hash */ +}; + +/*! \brief DTLS verification settings */ +enum ast_rtp_dtls_verify { + AST_RTP_DTLS_VERIFY_NONE = 0, /*!< Don't verify anything */ + AST_RTP_DTLS_VERIFY_FINGERPRINT = (1 << 0), /*!< Verify the fingerprint */ + AST_RTP_DTLS_VERIFY_CERTIFICATE = (1 << 1), /*!< Verify the certificate */ }; /*! \brief DTLS configuration structure */ struct ast_rtp_dtls_cfg { unsigned int enabled:1; /*!< Whether DTLS support is enabled or not */ - unsigned int verify:1; /*!< Whether to request and verify a client certificate when acting as server */ unsigned int rekey; /*!< Interval at which to renegotiate and rekey - defaults to 0 (off) */ enum ast_rtp_dtls_setup default_setup; /*!< Default setup type to use for outgoing */ enum ast_srtp_suite suite; /*!< Crypto suite in use */ + enum ast_rtp_dtls_hash hash; /*!< Hash to use for fingerprint */ + enum ast_rtp_dtls_verify verify; /*!< What should be verified */ char *certfile; /*!< Certificate file */ char *pvtfile; /*!< Private key file */ char *cipher; /*!< Cipher to use */ @@ -472,8 +489,10 @@ struct ast_rtp_engine_dtls { void (*set_setup)(struct ast_rtp_instance *instance, enum ast_rtp_dtls_setup setup); /*! Set the remote fingerprint */ void (*set_fingerprint)(struct ast_rtp_instance *instance, enum ast_rtp_dtls_hash hash, const char *fingerprint); + /*! Get the local fingerprint hash type */ + enum ast_rtp_dtls_hash (*get_fingerprint_hash)(struct ast_rtp_instance *instance); /*! Get the local fingerprint */ - const char *(*get_fingerprint)(struct ast_rtp_instance *instance, enum ast_rtp_dtls_hash hash); + const char *(*get_fingerprint)(struct ast_rtp_instance *instance); }; /*! Structure that represents an RTP stack (engine) */ |