2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
11 #include "internal/cryptlib.h"
12 #include <openssl/crypto.h>
13 #include <openssl/x509.h>
15 int X509_STORE_set_default_paths(X509_STORE *ctx)
19 lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file());
22 X509_LOOKUP_load_file(lookup, NULL, X509_FILETYPE_DEFAULT);
24 lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_hash_dir());
27 X509_LOOKUP_add_dir(lookup, NULL, X509_FILETYPE_DEFAULT);
29 /* clear any errors */
35 int X509_STORE_load_locations(X509_STORE *ctx, const char *file,
41 lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file());
44 if (X509_LOOKUP_load_file(lookup, file, X509_FILETYPE_PEM) != 1)
48 lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_hash_dir());
51 if (X509_LOOKUP_add_dir(lookup, path, X509_FILETYPE_PEM) != 1)
54 if ((path == NULL) && (file == NULL))