[asterisk-commits] rtp engine: Ignore empty filenames in DTLS configuration. (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 17 12:50:01 CST 2015


Joshua Colp has submitted this change and it was merged.

Change subject: rtp_engine: Ignore empty filenames in DTLS configuration.
......................................................................


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
---
M main/rtp_engine.c
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index beda8cd..7c5ef31 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -1634,14 +1634,14 @@
 		}
 	} 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 @@
 		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;
 		}

-- 
To view, visit https://gerrit.asterisk.org/1833
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib761dc235638a3fb701df337952f831fc3e69539
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-commits mailing list