source: azure_iot_hub_f767zi/trunk/wolfssl-4.7.0/wolfssl/openssl/x509v3.h@ 464

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

WolfSSLとAzure IoT SDKを更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 4.8 KB
Line 
1/* x509v3.h
2 *
3 * Copyright (C) 2006-2020 wolfSSL Inc.
4 *
5 * This file is part of wolfSSL.
6 *
7 * wolfSSL is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * wolfSSL is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20 */
21
22/* x509v3.h for openSSL */
23
24#ifndef WOLFSSL_x509v3_H
25#define WOLFSSL_x509v3_H
26
27#include <wolfssl/openssl/conf.h>
28#include <wolfssl/openssl/bio.h>
29
30#ifdef __cplusplus
31 extern "C" {
32#endif
33
34#define X509_PURPOSE_SSL_CLIENT 0
35#define X509_PURPOSE_SSL_SERVER 1
36
37#define NS_SSL_CLIENT 0
38#define NS_SSL_SERVER 1
39
40/* Forward reference */
41
42typedef void *(*X509V3_EXT_D2I)(void *, const unsigned char **, long);
43typedef int (*X509V3_EXT_I2D) (void *, unsigned char **);
44typedef STACK_OF(CONF_VALUE) *(*X509V3_EXT_I2V) (
45 struct WOLFSSL_v3_ext_method *method,
46 void *ext, STACK_OF(CONF_VALUE) *extlist);
47typedef char *(*X509V3_EXT_I2S)(struct WOLFSSL_v3_ext_method *method, void *ext);
48typedef int (*X509V3_EXT_I2R) (struct WOLFSSL_v3_ext_method *method,
49 void *ext, BIO *out, int indent);
50typedef struct WOLFSSL_v3_ext_method X509V3_EXT_METHOD;
51
52struct WOLFSSL_v3_ext_method {
53 int ext_nid;
54 int ext_flags;
55 void *usr_data;
56 X509V3_EXT_D2I d2i;
57 X509V3_EXT_I2D i2d;
58 X509V3_EXT_I2V i2v;
59 X509V3_EXT_I2S i2s;
60 X509V3_EXT_I2R i2r;
61};
62
63struct WOLFSSL_X509_EXTENSION {
64 WOLFSSL_ASN1_OBJECT *obj;
65 WOLFSSL_ASN1_BOOLEAN crit;
66 ASN1_OCTET_STRING value; /* DER format of extension */
67 WOLFSSL_v3_ext_method ext_method;
68 WOLFSSL_STACK* ext_sk; /* For extension specific data */
69};
70
71#define WOLFSSL_ASN1_BOOLEAN int
72#define GEN_OTHERNAME 0
73#define GEN_EMAIL 1
74#define GEN_DNS 2
75#define GEN_X400 3
76#define GEN_DIRNAME 4
77#define GEN_EDIPARTY 5
78#define GEN_URI 6
79#define GEN_IPADD 7
80#define GEN_RID 8
81
82#define GENERAL_NAME WOLFSSL_GENERAL_NAME
83
84#define X509V3_CTX WOLFSSL_X509V3_CTX
85
86#define CTX_TEST 0x1
87
88typedef struct WOLFSSL_AUTHORITY_KEYID AUTHORITY_KEYID;
89typedef struct WOLFSSL_BASIC_CONSTRAINTS BASIC_CONSTRAINTS;
90typedef struct WOLFSSL_ACCESS_DESCRIPTION ACCESS_DESCRIPTION;
91typedef WOLF_STACK_OF(WOLFSSL_ACCESS_DESCRIPTION) WOLFSSL_AUTHORITY_INFO_ACCESS;
92
93WOLFSSL_API WOLFSSL_BASIC_CONSTRAINTS* wolfSSL_BASIC_CONSTRAINTS_new(void);
94WOLFSSL_API void wolfSSL_BASIC_CONSTRAINTS_free(WOLFSSL_BASIC_CONSTRAINTS *bc);
95WOLFSSL_API WOLFSSL_AUTHORITY_KEYID* wolfSSL_AUTHORITY_KEYID_new(void);
96WOLFSSL_API void wolfSSL_AUTHORITY_KEYID_free(WOLFSSL_AUTHORITY_KEYID *id);
97WOLFSSL_API const WOLFSSL_v3_ext_method* wolfSSL_X509V3_EXT_get(
98 WOLFSSL_X509_EXTENSION* ex);
99WOLFSSL_API void* wolfSSL_X509V3_EXT_d2i(WOLFSSL_X509_EXTENSION* ex);
100WOLFSSL_API char* wolfSSL_i2s_ASN1_STRING(WOLFSSL_v3_ext_method *method,
101 const WOLFSSL_ASN1_STRING *s);
102WOLFSSL_API int wolfSSL_X509V3_EXT_print(WOLFSSL_BIO *out,
103 WOLFSSL_X509_EXTENSION *ext, unsigned long flag, int indent);
104WOLFSSL_API int wolfSSL_X509V3_EXT_add_nconf(WOLFSSL_CONF *conf, WOLFSSL_X509V3_CTX *ctx,
105 const char *section, WOLFSSL_X509 *cert);
106
107#define BASIC_CONSTRAINTS_free wolfSSL_BASIC_CONSTRAINTS_free
108#define AUTHORITY_KEYID_free wolfSSL_AUTHORITY_KEYID_free
109#define SSL_CTX_get_cert_store(x) wolfSSL_CTX_get_cert_store ((WOLFSSL_CTX*) (x))
110#define ASN1_INTEGER WOLFSSL_ASN1_INTEGER
111#define ASN1_OCTET_STRING WOLFSSL_ASN1_STRING
112#define X509V3_EXT_get wolfSSL_X509V3_EXT_get
113#define X509V3_EXT_d2i wolfSSL_X509V3_EXT_d2i
114#define X509V3_EXT_add_nconf wolfSSL_X509V3_EXT_add_nconf
115#ifndef NO_WOLFSSL_STUB
116#define X509V3_parse_list(...) NULL
117#endif
118#define i2s_ASN1_OCTET_STRING wolfSSL_i2s_ASN1_STRING
119#define X509V3_EXT_print wolfSSL_X509V3_EXT_print
120#define X509V3_EXT_conf_nid wolfSSL_X509V3_EXT_conf_nid
121#define X509V3_set_ctx wolfSSL_X509V3_set_ctx
122#ifndef NO_WOLFSSL_STUB
123#define X509V3_set_nconf(...)
124#endif
125#define X509V3_set_ctx_test(ctx) wolfSSL_X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
126#define X509V3_set_ctx_nodb wolfSSL_X509V3_set_ctx_nodb
127#define X509v3_get_ext_count wolfSSL_sk_num
128
129#ifdef __cplusplus
130}
131#endif
132
133#endif
Note: See TracBrowser for help on using the repository browser.