Fix loads of warnings in policy code.
I'll remember to try to compile this with warnings enabled next time :-)
This commit is contained in:
parent
69d1d5e6ce
commit
b79c82eaab
@ -441,7 +441,7 @@ X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level, int i);
|
|||||||
|
|
||||||
const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
|
const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
|
||||||
|
|
||||||
STACK_OF(POLICYQUALIFIER) *
|
STACK_OF(POLICYQUALINFO) *
|
||||||
X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node);
|
X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node);
|
||||||
const X509_POLICY_NODE *
|
const X509_POLICY_NODE *
|
||||||
X509_policy_node_get0_parent(const X509_POLICY_NODE *node);
|
X509_policy_node_get0_parent(const X509_POLICY_NODE *node);
|
||||||
|
@ -62,7 +62,8 @@
|
|||||||
|
|
||||||
#include "pcy_int.h"
|
#include "pcy_int.h"
|
||||||
|
|
||||||
static int policy_data_cmp(void *pa, void *pb);
|
static int policy_data_cmp(const X509_POLICY_DATA * const *a,
|
||||||
|
const X509_POLICY_DATA * const *b);
|
||||||
static int policy_cache_set_int(long *out, ASN1_INTEGER *value);
|
static int policy_cache_set_int(long *out, ASN1_INTEGER *value);
|
||||||
|
|
||||||
/* Set cache entry according to CertificatePolicies extension.
|
/* Set cache entry according to CertificatePolicies extension.
|
||||||
@ -269,9 +270,9 @@ X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache,
|
|||||||
return sk_X509_POLICY_DATA_value(cache->data, idx);
|
return sk_X509_POLICY_DATA_value(cache->data, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int policy_data_cmp(void *pa, void *pb)
|
static int policy_data_cmp(const X509_POLICY_DATA * const *a,
|
||||||
|
const X509_POLICY_DATA * const *b)
|
||||||
{
|
{
|
||||||
X509_POLICY_DATA **a = pa; X509_POLICY_DATA **b = pb;
|
|
||||||
return OBJ_cmp((*a)->valid_policy, (*b)->valid_policy);
|
return OBJ_cmp((*a)->valid_policy, (*b)->valid_policy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ void policy_data_free(X509_POLICY_DATA *data)
|
|||||||
ASN1_OBJECT_free(data->valid_policy);
|
ASN1_OBJECT_free(data->valid_policy);
|
||||||
/* Don't free qualifiers if shared */
|
/* Don't free qualifiers if shared */
|
||||||
if (!(data->flags & POLICY_DATA_FLAG_SHARED_QUALIFIERS))
|
if (!(data->flags & POLICY_DATA_FLAG_SHARED_QUALIFIERS))
|
||||||
sk_POLICYINFO_pop_free(data->qualifier_set,
|
sk_POLICYQUALINFO_pop_free(data->qualifier_set,
|
||||||
POLICYQUALINFO_free);
|
POLICYQUALINFO_free);
|
||||||
sk_ASN1_OBJECT_pop_free(data->expected_policy_set, ASN1_OBJECT_free);
|
sk_ASN1_OBJECT_pop_free(data->expected_policy_set, ASN1_OBJECT_free);
|
||||||
OPENSSL_free(data);
|
OPENSSL_free(data);
|
||||||
|
@ -76,7 +76,7 @@ struct X509_POLICY_DATA_st
|
|||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
/* Policy OID and qualifiers for this data */
|
/* Policy OID and qualifiers for this data */
|
||||||
ASN1_OBJECT *valid_policy;
|
ASN1_OBJECT *valid_policy;
|
||||||
STACK_OF(POLICYQUALIFIER) *qualifier_set;
|
STACK_OF(POLICYQUALINFO) *qualifier_set;
|
||||||
STACK_OF(ASN1_OBJECT) *expected_policy_set;
|
STACK_OF(ASN1_OBJECT) *expected_policy_set;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ struct X509_POLICY_CACHE_st {
|
|||||||
/* other policy data */
|
/* other policy data */
|
||||||
STACK_OF(X509_POLICY_DATA) *data;
|
STACK_OF(X509_POLICY_DATA) *data;
|
||||||
/* If policyMappings extension present a table of mapped policies */
|
/* If policyMappings extension present a table of mapped policies */
|
||||||
STACK_OF(POLICY_REF) *maps;
|
STACK_OF(X509_POLICY_REF) *maps;
|
||||||
/* If InhibitAnyPolicy present this is its value or -1 if absent. */
|
/* If InhibitAnyPolicy present this is its value or -1 if absent. */
|
||||||
long any_skip;
|
long any_skip;
|
||||||
/* If policyConstraints and requireExplicitPolicy present this is its
|
/* If policyConstraints and requireExplicitPolicy present this is its
|
||||||
@ -210,11 +210,11 @@ void policy_cache_free(X509_POLICY_CACHE *cache);
|
|||||||
X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level,
|
X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level,
|
||||||
const ASN1_OBJECT *id);
|
const ASN1_OBJECT *id);
|
||||||
|
|
||||||
X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_TREE) *sk,
|
X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *sk,
|
||||||
const ASN1_OBJECT *id);
|
const ASN1_OBJECT *id);
|
||||||
|
|
||||||
X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
|
X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
|
||||||
const X509_POLICY_DATA *data,
|
X509_POLICY_DATA *data,
|
||||||
X509_POLICY_NODE *parent,
|
X509_POLICY_NODE *parent,
|
||||||
X509_POLICY_TREE *tree);
|
X509_POLICY_TREE *tree);
|
||||||
void policy_node_free(X509_POLICY_NODE *node);
|
void policy_node_free(X509_POLICY_NODE *node);
|
||||||
|
@ -148,7 +148,7 @@ int X509_policy_node_get_critical(const X509_POLICY_NODE *node)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STACK_OF(POLICYQUALIFIER) *
|
STACK_OF(POLICYQUALINFO) *
|
||||||
X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node)
|
X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node)
|
||||||
{
|
{
|
||||||
if (!node)
|
if (!node)
|
||||||
|
@ -62,9 +62,9 @@
|
|||||||
|
|
||||||
#include "pcy_int.h"
|
#include "pcy_int.h"
|
||||||
|
|
||||||
static int ref_cmp(void *pa, void *pb)
|
static int ref_cmp(const X509_POLICY_REF * const *a,
|
||||||
|
const X509_POLICY_REF * const *b)
|
||||||
{
|
{
|
||||||
X509_POLICY_REF **a = pa; X509_POLICY_REF **b = pb;
|
|
||||||
return OBJ_cmp((*a)->subjectDomainPolicy, (*b)->subjectDomainPolicy);
|
return OBJ_cmp((*a)->subjectDomainPolicy, (*b)->subjectDomainPolicy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,9 +63,9 @@
|
|||||||
|
|
||||||
#include "pcy_int.h"
|
#include "pcy_int.h"
|
||||||
|
|
||||||
static int node_cmp(void *pa, void *pb)
|
static int node_cmp(const X509_POLICY_NODE * const *a,
|
||||||
|
const X509_POLICY_NODE * const *b)
|
||||||
{
|
{
|
||||||
X509_POLICY_NODE **a = pa, **b = pb;
|
|
||||||
return OBJ_cmp((*a)->data->valid_policy, (*b)->data->valid_policy);
|
return OBJ_cmp((*a)->data->valid_policy, (*b)->data->valid_policy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level,
|
|||||||
}
|
}
|
||||||
|
|
||||||
X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
|
X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
|
||||||
const X509_POLICY_DATA *data,
|
X509_POLICY_DATA *data,
|
||||||
X509_POLICY_NODE *parent,
|
X509_POLICY_NODE *parent,
|
||||||
X509_POLICY_TREE *tree)
|
X509_POLICY_TREE *tree)
|
||||||
{
|
{
|
||||||
|
@ -410,11 +410,11 @@ static int tree_add_auth_node(STACK_OF(X509_POLICY_NODE) **pnodes,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int tree_calculate_authority_set(X509_POLICY_TREE *tree,
|
static int tree_calculate_authority_set(X509_POLICY_TREE *tree,
|
||||||
STACK_OF(X509_POLICY_NODES) **pnodes)
|
STACK_OF(X509_POLICY_NODE) **pnodes)
|
||||||
{
|
{
|
||||||
X509_POLICY_LEVEL *curr;
|
X509_POLICY_LEVEL *curr;
|
||||||
X509_POLICY_NODE *node, *anyptr;
|
X509_POLICY_NODE *node, *anyptr;
|
||||||
STACK_OF(X509_POLICY_NODES) **addnodes;
|
STACK_OF(X509_POLICY_NODE) **addnodes;
|
||||||
int i, j;
|
int i, j;
|
||||||
curr = tree->levels + tree->nlevel - 1;
|
curr = tree->levels + tree->nlevel - 1;
|
||||||
|
|
||||||
@ -596,7 +596,7 @@ int X509_policy_check(X509_POLICY_TREE **ptree, int *explicit,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
X509_POLICY_TREE *tree = NULL;
|
X509_POLICY_TREE *tree = NULL;
|
||||||
STACK_OF(X509_NODE) *nodes, *auth_nodes = NULL;
|
STACK_OF(X509_POLICY_NODE) *nodes, *auth_nodes = NULL;
|
||||||
*ptree = NULL;
|
*ptree = NULL;
|
||||||
|
|
||||||
*explicit = 0;
|
*explicit = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user