Lines Matching refs:cache
80 X509_POLICY_CACHE *cache = x->policy_cache; in policy_cache_create() local
85 cache->data = sk_X509_POLICY_DATA_new(policy_data_cmp); in policy_cache_create()
86 if (!cache->data) in policy_cache_create()
96 sk_X509_POLICY_DATA_sort(cache->data); in policy_cache_create()
98 if (cache->anyPolicy) { in policy_cache_create()
102 cache->anyPolicy = data; in policy_cache_create()
103 } else if (sk_X509_POLICY_DATA_find(cache->data, NULL, data)) { in policy_cache_create()
106 } else if (!sk_X509_POLICY_DATA_push(cache->data, data)) in policy_cache_create()
118 sk_X509_POLICY_DATA_pop_free(cache->data, policy_data_free); in policy_cache_create()
119 cache->data = NULL; in policy_cache_create()
126 X509_POLICY_CACHE *cache; in policy_cache_new() local
132 cache = OPENSSL_malloc(sizeof(X509_POLICY_CACHE)); in policy_cache_new()
133 if (!cache) in policy_cache_new()
135 cache->anyPolicy = NULL; in policy_cache_new()
136 cache->data = NULL; in policy_cache_new()
137 cache->any_skip = -1; in policy_cache_new()
138 cache->explicit_skip = -1; in policy_cache_new()
139 cache->map_skip = -1; in policy_cache_new()
141 x->policy_cache = cache; in policy_cache_new()
156 if (!policy_cache_set_int(&cache->explicit_skip, in policy_cache_new()
159 if (!policy_cache_set_int(&cache->map_skip, in policy_cache_new()
202 } else if (!policy_cache_set_int(&cache->any_skip, ext_any)) in policy_cache_new()
220 void policy_cache_free(X509_POLICY_CACHE *cache) in policy_cache_free() argument
222 if (!cache) in policy_cache_free()
224 if (cache->anyPolicy) in policy_cache_free()
225 policy_data_free(cache->anyPolicy); in policy_cache_free()
226 if (cache->data) in policy_cache_free()
227 sk_X509_POLICY_DATA_pop_free(cache->data, policy_data_free); in policy_cache_free()
228 OPENSSL_free(cache); in policy_cache_free()
241 X509_POLICY_CACHE *cache; in policy_cache_set() local
244 cache = x->policy_cache; in policy_cache_set()
247 if (cache != NULL) in policy_cache_set()
248 return cache; in policy_cache_set()
253 cache = x->policy_cache; in policy_cache_set()
256 return cache; in policy_cache_set()
259 X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache, in policy_cache_find_data() argument
266 sk_X509_POLICY_DATA_sort(cache->data); in policy_cache_find_data()
267 if (!sk_X509_POLICY_DATA_find(cache->data, &idx, &tmp)) in policy_cache_find_data()
269 return sk_X509_POLICY_DATA_value(cache->data, idx); in policy_cache_find_data()