mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-10 06:49:40 +00:00
Merge "rtp_engine: Ignore empty filenames in DTLS configuration." into 13
This commit is contained in:
@@ -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")) {
|
} else if (!strcasecmp(name, "dtlscertfile")) {
|
||||||
ast_free(dtls_cfg->certfile);
|
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);
|
ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
dtls_cfg->certfile = ast_strdup(value);
|
dtls_cfg->certfile = ast_strdup(value);
|
||||||
} else if (!strcasecmp(name, "dtlsprivatekey")) {
|
} else if (!strcasecmp(name, "dtlsprivatekey")) {
|
||||||
ast_free(dtls_cfg->pvtfile);
|
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);
|
ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);
|
||||||
return -1;
|
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);
|
dtls_cfg->cipher = ast_strdup(value);
|
||||||
} else if (!strcasecmp(name, "dtlscafile")) {
|
} else if (!strcasecmp(name, "dtlscafile")) {
|
||||||
ast_free(dtls_cfg->cafile);
|
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);
|
ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
dtls_cfg->cafile = ast_strdup(value);
|
dtls_cfg->cafile = ast_strdup(value);
|
||||||
} else if (!strcasecmp(name, "dtlscapath") || !strcasecmp(name, "dtlscadir")) {
|
} else if (!strcasecmp(name, "dtlscapath") || !strcasecmp(name, "dtlscadir")) {
|
||||||
ast_free(dtls_cfg->capath);
|
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);
|
ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user