summaryrefslogtreecommitdiff
path: root/include/asterisk/utils.h
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2015-12-08 16:49:20 -0700
committerGeorge Joseph <george.joseph@fairview5.com>2015-12-08 18:04:33 -0600
commita9874345648dbcf66eefecc8fc2ccaba93fa216e (patch)
treebf31fa3ebc0c77116c6fafce1e3ddca1f836c175 /include/asterisk/utils.h
parent4cf470c70a7d6038355ce627918069f42a64fc22 (diff)
res_pjsip: Add existence and readablity checks for tls related files
Both transport and endpoint now check for the existence and readability of tls certificate and key files before passing them on to pjproject. This will cause the object to not load rather than waiting for pjproject to discover that there's a problem when a session is attempted. NOTE: chan_sip also uses ast_rtp_dtls_cfg_parse but it's located in build_peer which is gigantic and I didn't want to disturb it. Error messages will emit but it won't interrupt chan_sip loading. ASTERISK-25618 #close Change-Id: Ie43f2c1d653ac1fda6a6f6faecb7c2ebadaf47c9 Reported-by: George Joseph Tested-by: George Joseph
Diffstat (limited to 'include/asterisk/utils.h')
-rw-r--r--include/asterisk/utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index 664e347cf..832500c31 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -1089,4 +1089,14 @@ char *ast_crypt_encrypt(const char *key);
*/
int ast_crypt_validate(const char *key, const char *expected);
+/*
+ * \brief Test that a file exists and is readable by the effective user.
+ * \since 13.7.0
+ *
+ * \param filename File to test.
+ * \return True (non-zero) if the file exists and is readable.
+ * \return False (zero) if the file either doesn't exists or is not readable.
+ */
+int ast_file_is_readable(const char *filename);
+
#endif /* _ASTERISK_UTILS_H */