diff options
author | Bodo Möller <bodo@openssl.org> | 2000-02-17 21:04:40 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2000-02-17 21:04:40 +0000 |
commit | 5c2ec54f120270d1edc5ec7caa6384355a670355 (patch) | |
tree | 37a4ca1974cc9861f45259c7bf6da904d7ec0d3f /crypto/x509 | |
parent | 73c55919443640e0856d4e80be9b7123fc270b02 (diff) | |
download | openssl-5c2ec54f120270d1edc5ec7caa6384355a670355.tar.gz |
Make sure the return value of by_file_ctrl(..., X509_L_FILE_LOAD, ...)
aka X509_LOOKUP_load_file(...) is always 0 or 1, not the counter
returned from the recently introduced function X509_load_cert_crl_file.
X509_STORE_load_locations expects X509_LOOKUP_load_file to return 1 on
success, and possibly there's other software that relies on this too.
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/by_file.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c index 78b4c47751..78e9240a8d 100644 --- a/crypto/x509/by_file.c +++ b/crypto/x509/by_file.c @@ -100,8 +100,8 @@ static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, case X509_L_FILE_LOAD: if (argl == X509_FILETYPE_DEFAULT) { - ok=X509_load_cert_crl_file(ctx,X509_get_default_cert_file(), - X509_FILETYPE_PEM); + ok = (X509_load_cert_crl_file(ctx,X509_get_default_cert_file(), + X509_FILETYPE_PEM) != 0); if (!ok) { X509err(X509_F_BY_FILE_CTRL,X509_R_LOADING_DEFAULTS); @@ -109,16 +109,17 @@ static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, else { file=(char *)Getenv(X509_get_default_cert_file_env()); - ok=X509_load_cert_crl_file(ctx,file, - X509_FILETYPE_PEM); + ok = (X509_load_cert_crl_file(ctx,file, + X509_FILETYPE_PEM) != 0); } } else { if(argl == X509_FILETYPE_PEM) - ok=X509_load_cert_crl_file(ctx,argp, - X509_FILETYPE_PEM); - else ok=X509_load_cert_file(ctx,argp,(int)argl); + ok = (X509_load_cert_crl_file(ctx,argp, + X509_FILETYPE_PEM) != 0); + else + ok = (X509_load_cert_file(ctx,argp,(int)argl) != 0); } break; } |