*
*/
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
#include <openssl/x509.h>
#include <openssl/x509v3.h>
}
/* If we get this far initialize the tree */
-
- tree = OPENSSL_malloc(sizeof(*tree));
-
+ tree = OPENSSL_zalloc(sizeof(*tree));
if (!tree)
return 0;
-
- tree->flags = 0;
- tree->levels = OPENSSL_malloc(sizeof(*tree->levels) * n);
- tree->nlevel = 0;
- tree->extra_data = NULL;
- tree->auth_policies = NULL;
- tree->user_policies = NULL;
-
+ tree->levels = OPENSSL_zalloc(sizeof(*tree->levels) * n);
if (!tree->levels) {
OPENSSL_free(tree);
return 0;
}
-
- memset(tree->levels, 0, sizeof(*tree->levels) * n);
tree->nlevel = n;
level = tree->levels;
level++;
x = sk_X509_value(certs, i);
cache = policy_cache_set(x);
- CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);
+ X509_up_ref(x);
level->cert = x;
if (!cache->anyPolicy)