Report an error from X509_STORE_load_locations
when X509_LOOKUP_load_file or X509_LOOKUP_add_dir failed.
This commit is contained in:
@@ -89,13 +89,15 @@ int X509_STORE_load_locations(X509_STORE *ctx, const char *file,
|
|||||||
{
|
{
|
||||||
lookup=X509_STORE_add_lookup(ctx,X509_LOOKUP_file());
|
lookup=X509_STORE_add_lookup(ctx,X509_LOOKUP_file());
|
||||||
if (lookup == NULL) return(0);
|
if (lookup == NULL) return(0);
|
||||||
X509_LOOKUP_load_file(lookup,file,X509_FILETYPE_PEM);
|
if (X509_LOOKUP_load_file(lookup,file,X509_FILETYPE_PEM) != 1)
|
||||||
|
return(0);
|
||||||
}
|
}
|
||||||
if (path != NULL)
|
if (path != NULL)
|
||||||
{
|
{
|
||||||
lookup=X509_STORE_add_lookup(ctx,X509_LOOKUP_hash_dir());
|
lookup=X509_STORE_add_lookup(ctx,X509_LOOKUP_hash_dir());
|
||||||
if (lookup == NULL) return(0);
|
if (lookup == NULL) return(0);
|
||||||
X509_LOOKUP_add_dir(lookup,path,X509_FILETYPE_PEM);
|
if (X509_LOOKUP_add_dir(lookup,path,X509_FILETYPE_PEM) != 1)
|
||||||
|
return(0);
|
||||||
}
|
}
|
||||||
if ((path == NULL) && (file == NULL))
|
if ((path == NULL) && (file == NULL))
|
||||||
return(0);
|
return(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user