diff options
author | defanor <defanor@uberspace.net> | 2021-10-13 22:03:49 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2021-10-13 22:52:44 +0300 |
commit | 2e667698024e85fe1a9ae44181af9e38141176eb (patch) | |
tree | 0ed19b48b792fdf7f5ac14d569e5f7cd978adbd6 /src/rexmpp_tls.c | |
parent | f2ef0cf34d32e26c45004a5f2bd57380c15c720d (diff) |
Implement Jingle RTP sessions with ICE-UDP and DTLS-SRTP
Works with Dino and Conversations, but currently relying on external
players and streamers for actual audio playback and capture.
For now requiring GnuTLS and libnice for calls; OpenSSL should be
supported as an alternative to the former, and the latter should be
made optional, maybe with libjuice as an alternative.
Diffstat (limited to 'src/rexmpp_tls.c')
-rw-r--r-- | src/rexmpp_tls.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rexmpp_tls.c b/src/rexmpp_tls.c index 4881647..7919556 100644 --- a/src/rexmpp_tls.c +++ b/src/rexmpp_tls.c @@ -60,6 +60,15 @@ int rexmpp_tls_init (rexmpp_t *s) { gnutls_strerror(err)); return 1; } +#ifdef ENABLE_CALLS + err = gnutls_certificate_allocate_credentials(&(s->jingle.dtls_cred)); + if (err) { + gnutls_certificate_free_credentials(s->tls.gnutls_cred); + rexmpp_log(s, LOG_CRIT, "gnutls credentials allocation error: %s", + gnutls_strerror(err)); + return 1; + } +#endif return 0; #elif defined(USE_OPENSSL) SSL_library_init(); @@ -110,6 +119,9 @@ void rexmpp_tls_deinit (rexmpp_t *s) { free(s->tls.tls_session_data); s->tls.tls_session_data = NULL; } +#ifdef ENABLE_CALLS + gnutls_certificate_free_credentials(s->jingle.dtls_cred); +#endif #elif defined(USE_OPENSSL) if (s->tls.openssl_ctx != NULL) { SSL_CTX_free(s->tls.openssl_ctx); @@ -396,6 +408,12 @@ rexmpp_tls_set_x509_key_file (rexmpp_t *s, cert_file, key_file, GNUTLS_X509_FMT_PEM); +#ifdef ENABLE_CALLS + gnutls_certificate_set_x509_key_file(s->jingle.dtls_cred, + cert_file, + key_file, + GNUTLS_X509_FMT_PEM); +#endif if (ret == 0) { return REXMPP_TLS_SUCCESS; } else { |