aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2018-05-29 16:24:45 +1000
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2018-05-29 16:24:45 +1000
commit5e42a7bb99188bc6a54b7f0de8c2eb55845c5b13 (patch)
tree91aaa703101ac949c7ce91e5b2c0c41690184ae6 /src
parentbf7138e1e587670e63aa1023f3a81694031b55f8 (diff)
downloadluaossl-5e42a7bb99188bc6a54b7f0de8c2eb55845c5b13.tar.gz
luaossl-5e42a7bb99188bc6a54b7f0de8c2eb55845c5b13.tar.bz2
luaossl-5e42a7bb99188bc6a54b7f0de8c2eb55845c5b13.zip
src/openssl.c: Only throw if X509_STORE_load_locations set an error
Diffstat (limited to 'src')
-rw-r--r--src/openssl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 2601077..973a659 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -7870,8 +7870,13 @@ static int xs_add(lua_State *L) {
if (S_ISDIR(st.st_mode))
ok = X509_STORE_load_locations(store, NULL, path);
- else
+ else {
+ /* X509_STORE_load_locations on a file returns 0 if no certs were found */
+ ERR_clear_error();
ok = X509_STORE_load_locations(store, path, NULL);
+ if (ok == 0 && !ERR_peek_error())
+ ok = 1;
+ }
if (!ok)
return auxL_error(L, auxL_EOPENSSL, "x509.store:add");