summaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
authorDavid Weber <dave@veryflatcat.com>2014-11-14 14:49:24 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-11-14 21:18:06 +0100
commit657cf665a1b5c664aca00188533b4c8a880dea07 (patch)
tree9e00b503e321b02d5171ea89e67de9f97212ff53 /src/cli.c
parentec7a8bd9d77d35dc740fe5c9618d2ebee34a12e2 (diff)
downloadgnutls-657cf665a1b5c664aca00188533b4c8a880dea07.tar.gz
Fixed SRTP profile configuration in cli.c and serv.c.
I have tested the fix in 3.3.10. This commit is UNTESTED as i am unable to compile gnutls (./configure complains about gl_INIT and ggl_INIT). Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/cli.c b/src/cli.c
index dc6d99542a..8fec68b78c 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -687,20 +687,24 @@ static gnutls_session_t init_tls_session(const char *host)
GNUTLS_HB_PEER_ALLOWED_TO_SEND);
#ifdef ENABLE_DTLS_SRTP
- if (HAVE_OPT(SRTP_PROFILES)) {
- ret =
- gnutls_srtp_set_profile_direct(session,
- OPT_ARG(SRTP_PROFILES),
- &err);
- if (ret == GNUTLS_E_INVALID_REQUEST)
- fprintf(stderr, "Syntax error at: %s\n", err);
- else
- fprintf(stderr, "Error in profiles: %s\n",
- gnutls_strerror(ret));
- exit(1);
- }
+ if (HAVE_OPT(SRTP_PROFILES)) {
+ ret =
+ gnutls_srtp_set_profile_direct(session,
+ OPT_ARG(SRTP_PROFILES),
+ &err);
+ if (ret == GNUTLS_E_INVALID_REQUEST)
+ fprintf(stderr, "Syntax error at: %s\n", err);
+ else if (ret != 0)
+ fprintf(stderr, "Error in profiles: %s\n",
+ gnutls_strerror(ret));
+ else fprintf(stderr,"DTLS profile set to %s\n",
+ OPT_ARG(SRTP_PROFILES));
+
+ if (ret != 0) exit(1);
+ }
#endif
+
return session;
}