summaryrefslogtreecommitdiff
path: root/main/rtp_engine.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-12-17 12:25:47 -0400
committerJoshua Colp <jcolp@digium.com>2015-12-17 12:25:47 -0400
commit0cefcabd589bf8ecf33988d7c710932ab01037e5 (patch)
tree9e0b515a9863ff0ccb1987c9cd0379e63060787c /main/rtp_engine.c
parent280adca0a55f5fa75dc562ded5a2daf9df6a6184 (diff)
rtp_engine: Ignore empty filenames in DTLS configuration.
When applying an empty DTLS configuration the filenames in the configuration will be empty. This is actually valid to do and each filename should simply be ignored. Change-Id: Ib761dc235638a3fb701df337952f831fc3e69539
Diffstat (limited to 'main/rtp_engine.c')
-rw-r--r--main/rtp_engine.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index beda8cd74..7c5ef311a 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -1634,14 +1634,14 @@ int ast_rtp_dtls_cfg_parse(struct ast_rtp_dtls_cfg *dtls_cfg, const char *name,
}
} else if (!strcasecmp(name, "dtlscertfile")) {
ast_free(dtls_cfg->certfile);
- if (!ast_file_is_readable(value)) {
+ if (!ast_strlen_zero(value) && !ast_file_is_readable(value)) {
ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);
return -1;
}
dtls_cfg->certfile = ast_strdup(value);
} else if (!strcasecmp(name, "dtlsprivatekey")) {
ast_free(dtls_cfg->pvtfile);
- if (!ast_file_is_readable(value)) {
+ if (!ast_strlen_zero(value) && !ast_file_is_readable(value)) {
ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);
return -1;
}
@@ -1651,14 +1651,14 @@ int ast_rtp_dtls_cfg_parse(struct ast_rtp_dtls_cfg *dtls_cfg, const char *name,
dtls_cfg->cipher = ast_strdup(value);
} else if (!strcasecmp(name, "dtlscafile")) {
ast_free(dtls_cfg->cafile);
- if (!ast_file_is_readable(value)) {
+ if (!ast_strlen_zero(value) && !ast_file_is_readable(value)) {
ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);
return -1;
}
dtls_cfg->cafile = ast_strdup(value);
} else if (!strcasecmp(name, "dtlscapath") || !strcasecmp(name, "dtlscadir")) {
ast_free(dtls_cfg->capath);
- if (!ast_file_is_readable(value)) {
+ if (!ast_strlen_zero(value) && !ast_file_is_readable(value)) {
ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);
return -1;
}