summaryrefslogtreecommitdiff
path: root/crypto/x509v3/pcy_tree.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-07-13 14:25:36 +0000
committerDr. Stephen Henson <steve@openssl.org>2008-07-13 14:25:36 +0000
commitdb50661fce82a8f32bccaa7454be4041cbfad6d0 (patch)
tree761d5622052f34f9e45f906bff544792af5efc75 /crypto/x509v3/pcy_tree.c
parentf9afd9f861bc7b5fc1ae32ceff15572ef73cbbec (diff)
downloadopenssl-new-db50661fce82a8f32bccaa7454be4041cbfad6d0.tar.gz
X509 verification fixes.
Ignore self issued certificates when checking path length constraints. Duplicate OIDs in policy tree in case they are allocated. Use anyPolicy from certificate cache and not current tree level.
Diffstat (limited to 'crypto/x509v3/pcy_tree.c')
-rw-r--r--crypto/x509v3/pcy_tree.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/x509v3/pcy_tree.c b/crypto/x509v3/pcy_tree.c
index 4fda1d419a..aed0155c2a 100644
--- a/crypto/x509v3/pcy_tree.c
+++ b/crypto/x509v3/pcy_tree.c
@@ -131,7 +131,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
if (explicit_policy > 0)
{
explicit_policy--;
- if (!(x->ex_flags & EXFLAG_SS)
+ if (!(x->ex_flags & EXFLAG_SI)
&& (cache->explicit_skip != -1)
&& (cache->explicit_skip < explicit_policy))
explicit_policy = cache->explicit_skip;
@@ -197,7 +197,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
/* Any matching allowed if certificate is self
* issued and not the last in the chain.
*/
- if (!(x->ex_flags & EXFLAG_SS) || (i == 0))
+ if (!(x->ex_flags & EXFLAG_SI) || (i == 0))
level->flags |= X509_V_FLAG_INHIBIT_ANY;
}
else
@@ -310,7 +310,8 @@ static int tree_link_any(X509_POLICY_LEVEL *curr,
if (data == NULL)
return 0;
- data->qualifier_set = curr->anyPolicy->data->qualifier_set;
+ /* Curr may not have anyPolicy */
+ data->qualifier_set = cache->anyPolicy->qualifier_set;
data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS;
if (!level_add_node(curr, data, node, tree))
{