diff options
Diffstat (limited to 'vpn')
-rw-r--r-- | vpn/plugins/ipsec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vpn/plugins/ipsec.c b/vpn/plugins/ipsec.c index b1a7ecd2..b5205f7e 100644 --- a/vpn/plugins/ipsec.c +++ b/vpn/plugins/ipsec.c @@ -248,6 +248,11 @@ static void read_der_file(const char *path, X509 **cert) DBG("der path %s\n", path); fp = fopen(path, "r"); + if (!fp) { + connman_error("fopen %s is failed\n", path); + return; + } + *cert = d2i_X509_fp(fp, NULL); fclose(fp); return; @@ -259,6 +264,11 @@ static void read_pem_file(const char *path, X509 **cert) DBG("pem path %s\n", path); fp = fopen(path, "r"); + if (!fp) { + connman_error("fopen %s is failed\n", path); + return; + } + *cert = PEM_read_X509(fp, cert, NULL, NULL); fclose(fp); return; |