source: EcnlProtoTool/trunk/openssl-1.1.0e/crypto/x509v3/pcy_lib.c@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc
File size: 2.7 KB
Line 
1/*
2 * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
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
8 */
9
10#include "internal/cryptlib.h"
11#include <openssl/x509.h>
12#include <openssl/x509v3.h>
13
14#include "pcy_int.h"
15
16/* accessor functions */
17
18/* X509_POLICY_TREE stuff */
19
20int X509_policy_tree_level_count(const X509_POLICY_TREE *tree)
21{
22 if (!tree)
23 return 0;
24 return tree->nlevel;
25}
26
27X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree,
28 int i)
29{
30 if (!tree || (i < 0) || (i >= tree->nlevel))
31 return NULL;
32 return tree->levels + i;
33}
34
35STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const
36 X509_POLICY_TREE
37 *tree)
38{
39 if (!tree)
40 return NULL;
41 return tree->auth_policies;
42}
43
44STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const
45 X509_POLICY_TREE
46 *tree)
47{
48 if (!tree)
49 return NULL;
50 if (tree->flags & POLICY_FLAG_ANY_POLICY)
51 return tree->auth_policies;
52 else
53 return tree->user_policies;
54}
55
56/* X509_POLICY_LEVEL stuff */
57
58int X509_policy_level_node_count(X509_POLICY_LEVEL *level)
59{
60 int n;
61 if (!level)
62 return 0;
63 if (level->anyPolicy)
64 n = 1;
65 else
66 n = 0;
67 if (level->nodes)
68 n += sk_X509_POLICY_NODE_num(level->nodes);
69 return n;
70}
71
72X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level, int i)
73{
74 if (!level)
75 return NULL;
76 if (level->anyPolicy) {
77 if (i == 0)
78 return level->anyPolicy;
79 i--;
80 }
81 return sk_X509_POLICY_NODE_value(level->nodes, i);
82}
83
84/* X509_POLICY_NODE stuff */
85
86const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node)
87{
88 if (!node)
89 return NULL;
90 return node->data->valid_policy;
91}
92
93STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const
94 X509_POLICY_NODE
95 *node)
96{
97 if (!node)
98 return NULL;
99 return node->data->qualifier_set;
100}
101
102const X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE
103 *node)
104{
105 if (!node)
106 return NULL;
107 return node->parent;
108}
Note: See TracBrowser for help on using the repository browser.