aboutsummaryrefslogtreecommitdiffstats
path: root/apps/ts.c
diff options
context:
space:
mode:
authorPeiwei Hu <jlu.hpw@foxmail.com>2022-05-25 00:14:35 +0800
committerTomas Mraz <tomas@openssl.org>2022-06-23 12:42:25 +0200
commite22ea36fa8296b402348da8f5ab5e258be8402cf (patch)
tree773ea0121fe1c9393f5fbaa35bd79c6483dd1ab0 /apps/ts.c
parentc540a82767954a616934ba6caa6ddc736502c574 (diff)
downloadopenssl-e22ea36fa8296b402348da8f5ab5e258be8402cf.tar.gz
Fix the checks of X509_LOOKUP_* functions
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18400)
Diffstat (limited to 'apps/ts.c')
-rw-r--r--apps/ts.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/ts.c b/apps/ts.c
index 2cebaa8263..78c3aacced 100644
--- a/apps/ts.c
+++ b/apps/ts.c
@@ -991,7 +991,7 @@ static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,
BIO_printf(bio_err, "memory allocation failure\n");
goto err;
}
- if (!X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM)) {
+ if (X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM) <= 0) {
BIO_printf(bio_err, "Error loading directory %s\n", CApath);
goto err;
}
@@ -1003,8 +1003,8 @@ static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,
BIO_printf(bio_err, "memory allocation failure\n");
goto err;
}
- if (!X509_LOOKUP_load_file_ex(lookup, CAfile, X509_FILETYPE_PEM, libctx,
- propq)) {
+ if (X509_LOOKUP_load_file_ex(lookup, CAfile, X509_FILETYPE_PEM, libctx,
+ propq) <= 0) {
BIO_printf(bio_err, "Error loading file %s\n", CAfile);
goto err;
}
@@ -1016,7 +1016,7 @@ static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,
BIO_printf(bio_err, "memory allocation failure\n");
goto err;
}
- if (!X509_LOOKUP_load_store_ex(lookup, CAstore, libctx, propq)) {
+ if (X509_LOOKUP_load_store_ex(lookup, CAstore, libctx, propq) <= 0) {
BIO_printf(bio_err, "Error loading store URI %s\n", CAstore);
goto err;
}