licentivo-launch 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +35 -0
  4. data/ext/launch_native/extconf.rb +28 -0
  5. data/lib/licentivo_launch/vendor/licentivo.rb +262 -0
  6. data/lib/licentivo_launch.rb +352 -0
  7. data/vendor/LICENSE +21 -0
  8. data/vendor/NOTICE +17 -0
  9. data/vendor/VERSION +1 -0
  10. data/vendor/c/app.c +33 -0
  11. data/vendor/c/demo.c +77 -0
  12. data/vendor/c/feature_tasks.h +72 -0
  13. data/vendor/c/licentivo.c +382 -0
  14. data/vendor/c/licentivo.h +67 -0
  15. data/vendor/c/quickstart.c +51 -0
  16. data/vendor/c/test_vectors.c +4 -0
  17. data/vendor/c/vendor/Monocypher-LICENCE.md +173 -0
  18. data/vendor/c/vendor/cJSON-LICENSE +20 -0
  19. data/vendor/c/vendor/cJSON.c +3191 -0
  20. data/vendor/c/vendor/cJSON.h +306 -0
  21. data/vendor/c/vendor/monocypher-ed25519.c +500 -0
  22. data/vendor/c/vendor/monocypher-ed25519.h +140 -0
  23. data/vendor/c/vendor/monocypher.c +2956 -0
  24. data/vendor/c/vendor/monocypher.h +321 -0
  25. data/vendor/curl/COPYING.txt +22 -0
  26. data/vendor/curl/bin/libcurl-x64.dll +0 -0
  27. data/vendor/curl/include/brotli/decode.h +409 -0
  28. data/vendor/curl/include/brotli/encode.h +505 -0
  29. data/vendor/curl/include/brotli/port.h +302 -0
  30. data/vendor/curl/include/brotli/shared_dictionary.h +100 -0
  31. data/vendor/curl/include/brotli/types.h +83 -0
  32. data/vendor/curl/include/curl/curl.h +3374 -0
  33. data/vendor/curl/include/curl/curlver.h +77 -0
  34. data/vendor/curl/include/curl/easy.h +123 -0
  35. data/vendor/curl/include/curl/header.h +74 -0
  36. data/vendor/curl/include/curl/mprintf.h +85 -0
  37. data/vendor/curl/include/curl/multi.h +561 -0
  38. data/vendor/curl/include/curl/options.h +70 -0
  39. data/vendor/curl/include/curl/stdcheaders.h +35 -0
  40. data/vendor/curl/include/curl/system.h +399 -0
  41. data/vendor/curl/include/curl/typecheck-gcc.h +964 -0
  42. data/vendor/curl/include/curl/urlapi.h +156 -0
  43. data/vendor/curl/include/curl/websockets.h +98 -0
  44. data/vendor/curl/include/libpsl.h +207 -0
  45. data/vendor/curl/include/libssh2.h +1516 -0
  46. data/vendor/curl/include/libssh2_publickey.h +128 -0
  47. data/vendor/curl/include/libssh2_sftp.h +382 -0
  48. data/vendor/curl/include/nghttp2/nghttp2.h +6878 -0
  49. data/vendor/curl/include/nghttp2/nghttp2ver.h +42 -0
  50. data/vendor/curl/include/nghttp3/nghttp3.h +3704 -0
  51. data/vendor/curl/include/nghttp3/version.h +46 -0
  52. data/vendor/curl/include/ngtcp2/ngtcp2.h +7485 -0
  53. data/vendor/curl/include/ngtcp2/ngtcp2_crypto.h +1071 -0
  54. data/vendor/curl/include/ngtcp2/ngtcp2_crypto_quictls.h +147 -0
  55. data/vendor/curl/include/ngtcp2/version.h +51 -0
  56. data/vendor/curl/include/openssl/aes.h +120 -0
  57. data/vendor/curl/include/openssl/asn1.h +1121 -0
  58. data/vendor/curl/include/openssl/asn1t.h +996 -0
  59. data/vendor/curl/include/openssl/bio.h +716 -0
  60. data/vendor/curl/include/openssl/blowfish.h +106 -0
  61. data/vendor/curl/include/openssl/bn.h +480 -0
  62. data/vendor/curl/include/openssl/buffer.h +102 -0
  63. data/vendor/curl/include/openssl/camellia.h +121 -0
  64. data/vendor/curl/include/openssl/cast.h +99 -0
  65. data/vendor/curl/include/openssl/chacha.h +54 -0
  66. data/vendor/curl/include/openssl/cmac.h +81 -0
  67. data/vendor/curl/include/openssl/cms.h +541 -0
  68. data/vendor/curl/include/openssl/comp.h +7 -0
  69. data/vendor/curl/include/openssl/conf.h +189 -0
  70. data/vendor/curl/include/openssl/crypto.h +458 -0
  71. data/vendor/curl/include/openssl/ct.h +567 -0
  72. data/vendor/curl/include/openssl/curve25519.h +104 -0
  73. data/vendor/curl/include/openssl/des.h +215 -0
  74. data/vendor/curl/include/openssl/dh.h +245 -0
  75. data/vendor/curl/include/openssl/dsa.h +263 -0
  76. data/vendor/curl/include/openssl/dtls1.h +107 -0
  77. data/vendor/curl/include/openssl/ec.h +675 -0
  78. data/vendor/curl/include/openssl/ecdh.h +6 -0
  79. data/vendor/curl/include/openssl/ecdsa.h +6 -0
  80. data/vendor/curl/include/openssl/engine.h +215 -0
  81. data/vendor/curl/include/openssl/err.h +325 -0
  82. data/vendor/curl/include/openssl/evp.h +1288 -0
  83. data/vendor/curl/include/openssl/hkdf.h +65 -0
  84. data/vendor/curl/include/openssl/hmac.h +101 -0
  85. data/vendor/curl/include/openssl/idea.h +99 -0
  86. data/vendor/curl/include/openssl/kdf.h +137 -0
  87. data/vendor/curl/include/openssl/lhash.h +179 -0
  88. data/vendor/curl/include/openssl/md4.h +105 -0
  89. data/vendor/curl/include/openssl/md5.h +99 -0
  90. data/vendor/curl/include/openssl/mlkem.h +236 -0
  91. data/vendor/curl/include/openssl/modes.h +118 -0
  92. data/vendor/curl/include/openssl/obj_mac.h +4646 -0
  93. data/vendor/curl/include/openssl/objects.h +137 -0
  94. data/vendor/curl/include/openssl/ocsp.h +484 -0
  95. data/vendor/curl/include/openssl/opensslconf.h +16 -0
  96. data/vendor/curl/include/openssl/opensslfeatures.h +153 -0
  97. data/vendor/curl/include/openssl/opensslv.h +18 -0
  98. data/vendor/curl/include/openssl/ossl_typ.h +196 -0
  99. data/vendor/curl/include/openssl/pem.h +542 -0
  100. data/vendor/curl/include/openssl/pkcs12.h +284 -0
  101. data/vendor/curl/include/openssl/pkcs7.h +523 -0
  102. data/vendor/curl/include/openssl/poly1305.h +45 -0
  103. data/vendor/curl/include/openssl/posix_time.h +54 -0
  104. data/vendor/curl/include/openssl/rand.h +118 -0
  105. data/vendor/curl/include/openssl/rc2.h +101 -0
  106. data/vendor/curl/include/openssl/rc4.h +88 -0
  107. data/vendor/curl/include/openssl/ripemd.h +107 -0
  108. data/vendor/curl/include/openssl/rsa.h +603 -0
  109. data/vendor/curl/include/openssl/safestack.h +1739 -0
  110. data/vendor/curl/include/openssl/sha.h +190 -0
  111. data/vendor/curl/include/openssl/sm3.h +49 -0
  112. data/vendor/curl/include/openssl/sm4.h +47 -0
  113. data/vendor/curl/include/openssl/srtp.h +148 -0
  114. data/vendor/curl/include/openssl/ssl.h +2336 -0
  115. data/vendor/curl/include/openssl/ssl3.h +441 -0
  116. data/vendor/curl/include/openssl/stack.h +99 -0
  117. data/vendor/curl/include/openssl/tls1.h +764 -0
  118. data/vendor/curl/include/openssl/ts.h +660 -0
  119. data/vendor/curl/include/openssl/txt_db.h +112 -0
  120. data/vendor/curl/include/openssl/ui.h +397 -0
  121. data/vendor/curl/include/openssl/x509.h +1037 -0
  122. data/vendor/curl/include/openssl/x509_vfy.h +464 -0
  123. data/vendor/curl/include/openssl/x509v3.h +1039 -0
  124. data/vendor/curl/include/zconf.h +206 -0
  125. data/vendor/curl/include/zdict.h +481 -0
  126. data/vendor/curl/include/zlib.h +1859 -0
  127. data/vendor/curl/include/zlib_name_mangling.h +8 -0
  128. data/vendor/curl/include/zstd.h +3198 -0
  129. data/vendor/curl/include/zstd_errors.h +107 -0
  130. data/vendor/curl/lib/libcurl.dll.a +0 -0
  131. data/vendor/curl/licenses/brotli/LICENSE.txt +19 -0
  132. data/vendor/curl/licenses/certdata/LICENSE.url +2 -0
  133. data/vendor/curl/licenses/libpsl/COPYING.txt +20 -0
  134. data/vendor/curl/licenses/libressl/COPYING.txt +133 -0
  135. data/vendor/curl/licenses/libssh2/COPYING.txt +43 -0
  136. data/vendor/curl/licenses/nghttp2/COPYING.txt +23 -0
  137. data/vendor/curl/licenses/nghttp3/COPYING.txt +22 -0
  138. data/vendor/curl/licenses/ngtcp2/COPYING.txt +22 -0
  139. data/vendor/curl/licenses/psl/LICENSE.txt +373 -0
  140. data/vendor/curl/licenses/trurl/COPYING.txt +22 -0
  141. data/vendor/curl/licenses/zlibng/LICENSE.md +19 -0
  142. data/vendor/curl/licenses/zstd/LICENSE.txt +30 -0
  143. metadata +205 -0
@@ -0,0 +1,1121 @@
1
+ /* $OpenBSD: asn1.h,v 1.95 2026/01/02 08:03:02 tb Exp $ */
2
+ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3
+ * All rights reserved.
4
+ *
5
+ * This package is an SSL implementation written
6
+ * by Eric Young (eay@cryptsoft.com).
7
+ * The implementation was written so as to conform with Netscapes SSL.
8
+ *
9
+ * This library is free for commercial and non-commercial use as long as
10
+ * the following conditions are aheared to. The following conditions
11
+ * apply to all code found in this distribution, be it the RC4, RSA,
12
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13
+ * included with this distribution is covered by the same copyright terms
14
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15
+ *
16
+ * Copyright remains Eric Young's, and as such any Copyright notices in
17
+ * the code are not to be removed.
18
+ * If this package is used in a product, Eric Young should be given attribution
19
+ * as the author of the parts of the library used.
20
+ * This can be in the form of a textual message at program startup or
21
+ * in documentation (online or textual) provided with the package.
22
+ *
23
+ * Redistribution and use in source and binary forms, with or without
24
+ * modification, are permitted provided that the following conditions
25
+ * are met:
26
+ * 1. Redistributions of source code must retain the copyright
27
+ * notice, this list of conditions and the following disclaimer.
28
+ * 2. Redistributions in binary form must reproduce the above copyright
29
+ * notice, this list of conditions and the following disclaimer in the
30
+ * documentation and/or other materials provided with the distribution.
31
+ * 3. All advertising materials mentioning features or use of this software
32
+ * must display the following acknowledgement:
33
+ * "This product includes cryptographic software written by
34
+ * Eric Young (eay@cryptsoft.com)"
35
+ * The word 'cryptographic' can be left out if the rouines from the library
36
+ * being used are not cryptographic related :-).
37
+ * 4. If you include any Windows specific code (or a derivative thereof) from
38
+ * the apps directory (application code) you must include an acknowledgement:
39
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40
+ *
41
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51
+ * SUCH DAMAGE.
52
+ *
53
+ * The licence and distribution terms for any publically available version or
54
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
55
+ * copied and put under another distribution licence
56
+ * [including the GNU Public Licence.]
57
+ */
58
+
59
+ #ifndef HEADER_ASN1_H
60
+ #define HEADER_ASN1_H
61
+
62
+ #include <time.h>
63
+
64
+ #include <openssl/opensslconf.h>
65
+
66
+ #ifndef OPENSSL_NO_BIO
67
+ #include <openssl/bio.h>
68
+ #endif
69
+ #include <openssl/bn.h>
70
+ #include <openssl/stack.h>
71
+ #include <openssl/safestack.h>
72
+
73
+ #include <openssl/ossl_typ.h>
74
+
75
+ #ifdef __cplusplus
76
+ extern "C" {
77
+ #endif
78
+
79
+ #define V_ASN1_UNIVERSAL 0x00
80
+ #define V_ASN1_APPLICATION 0x40
81
+ #define V_ASN1_CONTEXT_SPECIFIC 0x80
82
+ #define V_ASN1_PRIVATE 0xc0
83
+
84
+ #define V_ASN1_CONSTRUCTED 0x20
85
+ #define V_ASN1_PRIMITIVE_TAG 0x1f
86
+ #define V_ASN1_PRIMATIVE_TAG 0x1f
87
+
88
+ #define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
89
+ #define V_ASN1_ANY -4 /* used in ASN1 template code */
90
+
91
+ #define V_ASN1_NEG 0x100 /* negative flag */
92
+
93
+ #define V_ASN1_UNDEF -1
94
+ #define V_ASN1_EOC 0
95
+ #define V_ASN1_BOOLEAN 1 /**/
96
+ #define V_ASN1_INTEGER 2
97
+ #define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
98
+ #define V_ASN1_BIT_STRING 3
99
+ #define V_ASN1_OCTET_STRING 4
100
+ #define V_ASN1_NULL 5
101
+ #define V_ASN1_OBJECT 6
102
+ #define V_ASN1_OBJECT_DESCRIPTOR 7
103
+ #define V_ASN1_EXTERNAL 8
104
+ #define V_ASN1_REAL 9
105
+ #define V_ASN1_ENUMERATED 10
106
+ #define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
107
+ #define V_ASN1_UTF8STRING 12
108
+ #define V_ASN1_SEQUENCE 16
109
+ #define V_ASN1_SET 17
110
+ #define V_ASN1_NUMERICSTRING 18 /**/
111
+ #define V_ASN1_PRINTABLESTRING 19
112
+ #define V_ASN1_T61STRING 20
113
+ #define V_ASN1_TELETEXSTRING 20 /* alias */
114
+ #define V_ASN1_VIDEOTEXSTRING 21 /**/
115
+ #define V_ASN1_IA5STRING 22
116
+ #define V_ASN1_UTCTIME 23
117
+ #define V_ASN1_GENERALIZEDTIME 24 /**/
118
+ #define V_ASN1_GRAPHICSTRING 25 /**/
119
+ #define V_ASN1_ISO64STRING 26 /**/
120
+ #define V_ASN1_VISIBLESTRING 26 /* alias */
121
+ #define V_ASN1_GENERALSTRING 27 /**/
122
+ #define V_ASN1_UNIVERSALSTRING 28 /**/
123
+ #define V_ASN1_BMPSTRING 30
124
+
125
+ #define B_ASN1_NUMERICSTRING 0x0001
126
+ #define B_ASN1_PRINTABLESTRING 0x0002
127
+ #define B_ASN1_T61STRING 0x0004
128
+ #define B_ASN1_TELETEXSTRING 0x0004
129
+ #define B_ASN1_VIDEOTEXSTRING 0x0008
130
+ #define B_ASN1_IA5STRING 0x0010
131
+ #define B_ASN1_GRAPHICSTRING 0x0020
132
+ #define B_ASN1_ISO64STRING 0x0040
133
+ #define B_ASN1_VISIBLESTRING 0x0040
134
+ #define B_ASN1_GENERALSTRING 0x0080
135
+ #define B_ASN1_UNIVERSALSTRING 0x0100
136
+ #define B_ASN1_OCTET_STRING 0x0200
137
+ #define B_ASN1_BIT_STRING 0x0400
138
+ #define B_ASN1_BMPSTRING 0x0800
139
+ #define B_ASN1_UNKNOWN 0x1000
140
+ #define B_ASN1_UTF8STRING 0x2000
141
+ #define B_ASN1_UTCTIME 0x4000
142
+ #define B_ASN1_GENERALIZEDTIME 0x8000
143
+ #define B_ASN1_SEQUENCE 0x10000
144
+
145
+ /* For use with ASN1_mbstring_copy() */
146
+ #define MBSTRING_FLAG 0x1000
147
+ #define MBSTRING_UTF8 (MBSTRING_FLAG)
148
+ #define MBSTRING_ASC (MBSTRING_FLAG|1)
149
+ #define MBSTRING_BMP (MBSTRING_FLAG|2)
150
+ #define MBSTRING_UNIV (MBSTRING_FLAG|4)
151
+
152
+ #define SMIME_OLDMIME 0x400
153
+ #define SMIME_CRLFEOL 0x800
154
+ #define SMIME_STREAM 0x1000
155
+
156
+ struct X509_algor_st;
157
+ DECLARE_STACK_OF(X509_ALGOR)
158
+
159
+ #define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */
160
+ #define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */
161
+
162
+ #define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
163
+ /* This indicates that the ASN1_STRING is not a real value but just a place
164
+ * holder for the location where indefinite length constructed data should
165
+ * be inserted in the memory buffer
166
+ */
167
+ #define ASN1_STRING_FLAG_NDEF 0x010
168
+
169
+ /* This flag is used by the CMS code to indicate that a string is not
170
+ * complete and is a place holder for content when it had all been
171
+ * accessed. The flag will be reset when content has been written to it.
172
+ */
173
+
174
+ #define ASN1_STRING_FLAG_CONT 0x020
175
+ /* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
176
+ * type.
177
+ */
178
+ #define ASN1_STRING_FLAG_MSTRING 0x040
179
+ /* This is the base type that holds just about everything :-) */
180
+ struct asn1_string_st {
181
+ int length;
182
+ int type;
183
+ unsigned char *data;
184
+ /* The value of the following field depends on the type being
185
+ * held. It is mostly being used for BIT_STRING so if the
186
+ * input data has a non-zero 'unused bits' value, it will be
187
+ * handled correctly */
188
+ long flags;
189
+ };
190
+
191
+ /* ASN1_ENCODING structure: this is used to save the received
192
+ * encoding of an ASN1 type. This is useful to get round
193
+ * problems with invalid encodings which can break signatures.
194
+ */
195
+
196
+ typedef struct ASN1_ENCODING_st {
197
+ unsigned char *enc; /* DER encoding */
198
+ long len; /* Length of encoding */
199
+ int modified; /* set to 1 if 'enc' is invalid */
200
+ } ASN1_ENCODING;
201
+
202
+ /* Used by security/xca */
203
+ #define STABLE_NO_MASK 0x02
204
+
205
+ #define DIRSTRING_TYPE \
206
+ (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
207
+ #define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
208
+
209
+ typedef struct asn1_string_table_st {
210
+ int nid;
211
+ long minsize;
212
+ long maxsize;
213
+ unsigned long mask;
214
+ unsigned long flags;
215
+ } ASN1_STRING_TABLE;
216
+
217
+ /* Declarations for template structures: for full definitions
218
+ * see asn1t.h
219
+ */
220
+ typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
221
+ typedef struct ASN1_TLC_st ASN1_TLC;
222
+ /* This is just an opaque pointer */
223
+ typedef struct ASN1_VALUE_st ASN1_VALUE;
224
+
225
+ #ifndef LIBRESSL_INTERNAL
226
+
227
+ /* Declare ASN1 functions: the implement macro in in asn1t.h */
228
+
229
+ #define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
230
+
231
+ #define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
232
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
233
+
234
+ #define DECLARE_ASN1_FUNCTIONS_name(type, name) \
235
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
236
+ DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
237
+
238
+ #define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
239
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
240
+ DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
241
+
242
+ #define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
243
+ type *d2i_##name(type **a, const unsigned char **in, long len); \
244
+ int i2d_##name(type *a, unsigned char **out); \
245
+ DECLARE_ASN1_ITEM(itname)
246
+
247
+ #define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
248
+ type *d2i_##name(type **a, const unsigned char **in, long len); \
249
+ int i2d_##name(const type *a, unsigned char **out); \
250
+ DECLARE_ASN1_ITEM(name)
251
+
252
+ #define DECLARE_ASN1_NDEF_FUNCTION(name) \
253
+ int i2d_##name##_NDEF(name *a, unsigned char **out);
254
+
255
+ #define DECLARE_ASN1_FUNCTIONS_const(name) \
256
+ DECLARE_ASN1_ALLOC_FUNCTIONS(name) \
257
+ DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name)
258
+
259
+ #define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
260
+ type *name##_new(void); \
261
+ void name##_free(type *a);
262
+
263
+ #define DECLARE_ASN1_PRINT_FUNCTION(stname) \
264
+ DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname)
265
+
266
+ #define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \
267
+ int fname##_print_ctx(BIO *out, stname *x, int indent, \
268
+ const ASN1_PCTX *pctx);
269
+
270
+ #endif /* !LIBRESSL_INTERNAL */
271
+
272
+ #define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
273
+ #define I2D_OF(type) int (*)(type *,unsigned char **)
274
+ #define I2D_OF_const(type) int (*)(const type *,unsigned char **)
275
+
276
+ #define CHECKED_D2I_OF(type, d2i) \
277
+ ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0)))
278
+ #define CHECKED_I2D_OF(type, i2d) \
279
+ ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))
280
+ #define CHECKED_NEW_OF(type, xnew) \
281
+ ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0)))
282
+ #define CHECKED_PTR_OF(type, p) \
283
+ ((void*) (1 ? p : (type*)0))
284
+ #define CHECKED_PPTR_OF(type, p) \
285
+ ((void**) (1 ? p : (type**)0))
286
+
287
+ #define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
288
+ #define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
289
+ #define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
290
+
291
+ TYPEDEF_D2I2D_OF(void);
292
+
293
+ /* The following macros and typedefs allow an ASN1_ITEM
294
+ * to be embedded in a structure and referenced. Since
295
+ * the ASN1_ITEM pointers need to be globally accessible
296
+ * (possibly from shared libraries) they may exist in
297
+ * different forms. On platforms that support it the
298
+ * ASN1_ITEM structure itself will be globally exported.
299
+ * Other platforms will export a function that returns
300
+ * an ASN1_ITEM pointer.
301
+ *
302
+ * To handle both cases transparently the macros below
303
+ * should be used instead of hard coding an ASN1_ITEM
304
+ * pointer in a structure.
305
+ *
306
+ * The structure will look like this:
307
+ *
308
+ * typedef struct SOMETHING_st {
309
+ * ...
310
+ * ASN1_ITEM_EXP *iptr;
311
+ * ...
312
+ * } SOMETHING;
313
+ *
314
+ * It would be initialised as e.g.:
315
+ *
316
+ * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...};
317
+ *
318
+ * and the actual pointer extracted with:
319
+ *
320
+ * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr);
321
+ *
322
+ * Finally an ASN1_ITEM pointer can be extracted from an
323
+ * appropriate reference with: ASN1_ITEM_rptr(X509). This
324
+ * would be used when a function takes an ASN1_ITEM * argument.
325
+ *
326
+ */
327
+
328
+ /* ASN1_ITEM pointer exported type */
329
+ typedef const ASN1_ITEM ASN1_ITEM_EXP;
330
+
331
+ #ifndef LIBRESSL_INTERNAL
332
+
333
+ /* Macro to obtain ASN1_ITEM pointer from exported type */
334
+ #define ASN1_ITEM_ptr(iptr) (iptr)
335
+
336
+ /* Macro to include ASN1_ITEM pointer from base type */
337
+ #define ASN1_ITEM_ref(iptr) (&(iptr##_it))
338
+
339
+ #define ASN1_ITEM_rptr(ref) (&(ref##_it))
340
+
341
+ #define DECLARE_ASN1_ITEM(name) \
342
+ extern const ASN1_ITEM name##_it;
343
+
344
+ #endif /* !LIBRESSL_INTERNAL */
345
+
346
+ /* Parameters used by ASN1_STRING_print_ex() */
347
+
348
+ /* These determine which characters to escape:
349
+ * RFC2253 special characters, control characters and
350
+ * MSB set characters
351
+ */
352
+
353
+ #define ASN1_STRFLGS_ESC_2253 1
354
+ #define ASN1_STRFLGS_ESC_CTRL 2
355
+ #define ASN1_STRFLGS_ESC_MSB 4
356
+
357
+
358
+ /* This flag determines how we do escaping: normally
359
+ * RC2253 backslash only, set this to use backslash and
360
+ * quote.
361
+ */
362
+
363
+ #define ASN1_STRFLGS_ESC_QUOTE 8
364
+
365
+
366
+ /* These three flags are internal use only. */
367
+
368
+ /* Character is a valid PrintableString character */
369
+ #define CHARTYPE_PRINTABLESTRING 0x10
370
+ /* Character needs escaping if it is the first character */
371
+ #define CHARTYPE_FIRST_ESC_2253 0x20
372
+ /* Character needs escaping if it is the last character */
373
+ #define CHARTYPE_LAST_ESC_2253 0x40
374
+
375
+ /* NB the internal flags are safely reused below by flags
376
+ * handled at the top level.
377
+ */
378
+
379
+ /* If this is set we convert all character strings
380
+ * to UTF8 first
381
+ */
382
+
383
+ #define ASN1_STRFLGS_UTF8_CONVERT 0x10
384
+
385
+ /* If this is set we don't attempt to interpret content:
386
+ * just assume all strings are 1 byte per character. This
387
+ * will produce some pretty odd looking output!
388
+ */
389
+
390
+ #define ASN1_STRFLGS_IGNORE_TYPE 0x20
391
+
392
+ /* If this is set we include the string type in the output */
393
+ #define ASN1_STRFLGS_SHOW_TYPE 0x40
394
+
395
+ /* This determines which strings to display and which to
396
+ * 'dump' (hex dump of content octets or DER encoding). We can
397
+ * only dump non character strings or everything. If we
398
+ * don't dump 'unknown' they are interpreted as character
399
+ * strings with 1 octet per character and are subject to
400
+ * the usual escaping options.
401
+ */
402
+
403
+ #define ASN1_STRFLGS_DUMP_ALL 0x80
404
+ #define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
405
+
406
+ /* These determine what 'dumping' does, we can dump the
407
+ * content octets or the DER encoding: both use the
408
+ * RFC2253 #NNNNN notation.
409
+ */
410
+
411
+ #define ASN1_STRFLGS_DUMP_DER 0x200
412
+
413
+ /* All the string flags consistent with RFC2253,
414
+ * escaping control characters isn't essential in
415
+ * RFC2253 but it is advisable anyway.
416
+ */
417
+
418
+ #define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
419
+ ASN1_STRFLGS_ESC_CTRL | \
420
+ ASN1_STRFLGS_ESC_MSB | \
421
+ ASN1_STRFLGS_UTF8_CONVERT | \
422
+ ASN1_STRFLGS_DUMP_UNKNOWN | \
423
+ ASN1_STRFLGS_DUMP_DER)
424
+
425
+ DECLARE_STACK_OF(ASN1_INTEGER)
426
+
427
+ DECLARE_STACK_OF(ASN1_GENERALSTRING)
428
+
429
+ typedef struct asn1_type_st {
430
+ int type;
431
+ union {
432
+ char *ptr;
433
+ ASN1_BOOLEAN boolean;
434
+ ASN1_STRING * asn1_string;
435
+ ASN1_OBJECT * object;
436
+ ASN1_INTEGER * integer;
437
+ ASN1_ENUMERATED * enumerated;
438
+ ASN1_BIT_STRING * bit_string;
439
+ ASN1_OCTET_STRING * octet_string;
440
+ ASN1_PRINTABLESTRING * printablestring;
441
+ ASN1_T61STRING * t61string;
442
+ ASN1_IA5STRING * ia5string;
443
+ ASN1_GENERALSTRING * generalstring;
444
+ ASN1_BMPSTRING * bmpstring;
445
+ ASN1_UNIVERSALSTRING * universalstring;
446
+ ASN1_UTCTIME * utctime;
447
+ ASN1_GENERALIZEDTIME * generalizedtime;
448
+ ASN1_VISIBLESTRING * visiblestring;
449
+ ASN1_UTF8STRING * utf8string;
450
+ /* set and sequence are left complete and still
451
+ * contain the set or sequence bytes */
452
+ ASN1_STRING * set;
453
+ ASN1_STRING * sequence;
454
+ ASN1_VALUE * asn1_value;
455
+ } value;
456
+ } ASN1_TYPE;
457
+
458
+ DECLARE_STACK_OF(ASN1_TYPE)
459
+
460
+ typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
461
+
462
+ ASN1_SEQUENCE_ANY *d2i_ASN1_SEQUENCE_ANY(ASN1_SEQUENCE_ANY **a, const unsigned char **in, long len);
463
+ int i2d_ASN1_SEQUENCE_ANY(const ASN1_SEQUENCE_ANY *a, unsigned char **out);
464
+ extern const ASN1_ITEM ASN1_SEQUENCE_ANY_it;
465
+ ASN1_SEQUENCE_ANY *d2i_ASN1_SET_ANY(ASN1_SEQUENCE_ANY **a, const unsigned char **in, long len);
466
+ int i2d_ASN1_SET_ANY(const ASN1_SEQUENCE_ANY *a, unsigned char **out);
467
+ extern const ASN1_ITEM ASN1_SET_ANY_it;
468
+
469
+ /* This is used to contain a list of bit names */
470
+ typedef struct BIT_STRING_BITNAME_st {
471
+ int bitnum;
472
+ const char *lname;
473
+ const char *sname;
474
+ } BIT_STRING_BITNAME;
475
+
476
+ #define B_ASN1_TIME \
477
+ B_ASN1_UTCTIME | \
478
+ B_ASN1_GENERALIZEDTIME
479
+
480
+ #define B_ASN1_PRINTABLE \
481
+ B_ASN1_NUMERICSTRING| \
482
+ B_ASN1_PRINTABLESTRING| \
483
+ B_ASN1_T61STRING| \
484
+ B_ASN1_IA5STRING| \
485
+ B_ASN1_BIT_STRING| \
486
+ B_ASN1_UNIVERSALSTRING|\
487
+ B_ASN1_BMPSTRING|\
488
+ B_ASN1_UTF8STRING|\
489
+ B_ASN1_SEQUENCE|\
490
+ B_ASN1_UNKNOWN
491
+
492
+ #define B_ASN1_DIRECTORYSTRING \
493
+ B_ASN1_PRINTABLESTRING| \
494
+ B_ASN1_TELETEXSTRING|\
495
+ B_ASN1_BMPSTRING|\
496
+ B_ASN1_UNIVERSALSTRING|\
497
+ B_ASN1_UTF8STRING
498
+
499
+ #define B_ASN1_DISPLAYTEXT \
500
+ B_ASN1_IA5STRING| \
501
+ B_ASN1_VISIBLESTRING| \
502
+ B_ASN1_BMPSTRING|\
503
+ B_ASN1_UTF8STRING
504
+
505
+ ASN1_TYPE *ASN1_TYPE_new(void);
506
+ void ASN1_TYPE_free(ASN1_TYPE *a);
507
+ ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, const unsigned char **in, long len);
508
+ int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **out);
509
+ extern const ASN1_ITEM ASN1_ANY_it;
510
+
511
+ int ASN1_TYPE_get(const ASN1_TYPE *a);
512
+ void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
513
+ int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
514
+ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
515
+
516
+ ASN1_OBJECT *ASN1_OBJECT_new(void);
517
+ void ASN1_OBJECT_free(ASN1_OBJECT *a);
518
+ int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp);
519
+ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
520
+ long length);
521
+
522
+ extern const ASN1_ITEM ASN1_OBJECT_it;
523
+
524
+ DECLARE_STACK_OF(ASN1_OBJECT)
525
+
526
+ ASN1_STRING *ASN1_STRING_new(void);
527
+ void ASN1_STRING_free(ASN1_STRING *a);
528
+ int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
529
+ ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a);
530
+ ASN1_STRING *ASN1_STRING_type_new(int type);
531
+ int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
532
+ /* Since this is used to store all sorts of things, via macros, for now, make
533
+ its data void * */
534
+ int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
535
+ void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
536
+ int ASN1_STRING_length(const ASN1_STRING *x);
537
+ void ASN1_STRING_length_set(ASN1_STRING *x, int n);
538
+ int ASN1_STRING_type(const ASN1_STRING *x);
539
+ unsigned char *ASN1_STRING_data(ASN1_STRING *x);
540
+ const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
541
+
542
+ ASN1_BIT_STRING *ASN1_BIT_STRING_new(void);
543
+ void ASN1_BIT_STRING_free(ASN1_BIT_STRING *a);
544
+ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **in, long len);
545
+ int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **out);
546
+ extern const ASN1_ITEM ASN1_BIT_STRING_it;
547
+ int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length);
548
+ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
549
+ int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n);
550
+
551
+ ASN1_INTEGER *ASN1_INTEGER_new(void);
552
+ void ASN1_INTEGER_free(ASN1_INTEGER *a);
553
+ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **in, long len);
554
+ int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **out);
555
+ extern const ASN1_ITEM ASN1_INTEGER_it;
556
+ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
557
+ long length);
558
+ ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x);
559
+ int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y);
560
+
561
+ ASN1_ENUMERATED *ASN1_ENUMERATED_new(void);
562
+ void ASN1_ENUMERATED_free(ASN1_ENUMERATED *a);
563
+ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char **in, long len);
564
+ int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out);
565
+ extern const ASN1_ITEM ASN1_ENUMERATED_it;
566
+
567
+ int ASN1_UTCTIME_check(const ASN1_UTCTIME *a);
568
+ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t);
569
+ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
570
+ int offset_day, long offset_sec);
571
+ int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);
572
+
573
+ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
574
+
575
+ int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
576
+ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
577
+ time_t t);
578
+ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
579
+ time_t t, int offset_day, long offset_sec);
580
+ int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
581
+
582
+ ASN1_OCTET_STRING *ASN1_OCTET_STRING_new(void);
583
+ void ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *a);
584
+ ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a, const unsigned char **in, long len);
585
+ int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **out);
586
+ extern const ASN1_ITEM ASN1_OCTET_STRING_it;
587
+ ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a);
588
+ int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
589
+ const ASN1_OCTET_STRING *b);
590
+ int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data,
591
+ int len);
592
+
593
+ ASN1_VISIBLESTRING *ASN1_VISIBLESTRING_new(void);
594
+ void ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *a);
595
+ ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a, const unsigned char **in, long len);
596
+ int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **out);
597
+ extern const ASN1_ITEM ASN1_VISIBLESTRING_it;
598
+ ASN1_UNIVERSALSTRING *ASN1_UNIVERSALSTRING_new(void);
599
+ void ASN1_UNIVERSALSTRING_free(ASN1_UNIVERSALSTRING *a);
600
+ ASN1_UNIVERSALSTRING *d2i_ASN1_UNIVERSALSTRING(ASN1_UNIVERSALSTRING **a, const unsigned char **in, long len);
601
+ int i2d_ASN1_UNIVERSALSTRING(ASN1_UNIVERSALSTRING *a, unsigned char **out);
602
+ extern const ASN1_ITEM ASN1_UNIVERSALSTRING_it;
603
+ ASN1_UTF8STRING *ASN1_UTF8STRING_new(void);
604
+ void ASN1_UTF8STRING_free(ASN1_UTF8STRING *a);
605
+ ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a, const unsigned char **in, long len);
606
+ int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **out);
607
+ extern const ASN1_ITEM ASN1_UTF8STRING_it;
608
+ ASN1_NULL *ASN1_NULL_new(void);
609
+ void ASN1_NULL_free(ASN1_NULL *a);
610
+ ASN1_NULL *d2i_ASN1_NULL(ASN1_NULL **a, const unsigned char **in, long len);
611
+ int i2d_ASN1_NULL(ASN1_NULL *a, unsigned char **out);
612
+ extern const ASN1_ITEM ASN1_NULL_it;
613
+ ASN1_BMPSTRING *ASN1_BMPSTRING_new(void);
614
+ void ASN1_BMPSTRING_free(ASN1_BMPSTRING *a);
615
+ ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, const unsigned char **in, long len);
616
+ int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **out);
617
+ extern const ASN1_ITEM ASN1_BMPSTRING_it;
618
+
619
+ ASN1_STRING *ASN1_PRINTABLE_new(void);
620
+ void ASN1_PRINTABLE_free(ASN1_STRING *a);
621
+ ASN1_STRING *d2i_ASN1_PRINTABLE(ASN1_STRING **a, const unsigned char **in, long len);
622
+ int i2d_ASN1_PRINTABLE(ASN1_STRING *a, unsigned char **out);
623
+ extern const ASN1_ITEM ASN1_PRINTABLE_it;
624
+
625
+ ASN1_STRING *DIRECTORYSTRING_new(void);
626
+ void DIRECTORYSTRING_free(ASN1_STRING *a);
627
+ ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, const unsigned char **in, long len);
628
+ int i2d_DIRECTORYSTRING(ASN1_STRING *a, unsigned char **out);
629
+ extern const ASN1_ITEM DIRECTORYSTRING_it;
630
+ ASN1_STRING *DISPLAYTEXT_new(void);
631
+ void DISPLAYTEXT_free(ASN1_STRING *a);
632
+ ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, const unsigned char **in, long len);
633
+ int i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **out);
634
+ extern const ASN1_ITEM DISPLAYTEXT_it;
635
+ ASN1_PRINTABLESTRING *ASN1_PRINTABLESTRING_new(void);
636
+ void ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *a);
637
+ ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a, const unsigned char **in, long len);
638
+ int i2d_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING *a, unsigned char **out);
639
+ extern const ASN1_ITEM ASN1_PRINTABLESTRING_it;
640
+ ASN1_T61STRING *ASN1_T61STRING_new(void);
641
+ void ASN1_T61STRING_free(ASN1_T61STRING *a);
642
+ ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, const unsigned char **in, long len);
643
+ int i2d_ASN1_T61STRING(ASN1_T61STRING *a, unsigned char **out);
644
+ extern const ASN1_ITEM ASN1_T61STRING_it;
645
+ ASN1_IA5STRING *ASN1_IA5STRING_new(void);
646
+ void ASN1_IA5STRING_free(ASN1_IA5STRING *a);
647
+ ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, const unsigned char **in, long len);
648
+ int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **out);
649
+ extern const ASN1_ITEM ASN1_IA5STRING_it;
650
+ ASN1_GENERALSTRING *ASN1_GENERALSTRING_new(void);
651
+ void ASN1_GENERALSTRING_free(ASN1_GENERALSTRING *a);
652
+ ASN1_GENERALSTRING *d2i_ASN1_GENERALSTRING(ASN1_GENERALSTRING **a, const unsigned char **in, long len);
653
+ int i2d_ASN1_GENERALSTRING(ASN1_GENERALSTRING *a, unsigned char **out);
654
+ extern const ASN1_ITEM ASN1_GENERALSTRING_it;
655
+ ASN1_UTCTIME *ASN1_UTCTIME_new(void);
656
+ void ASN1_UTCTIME_free(ASN1_UTCTIME *a);
657
+ ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, const unsigned char **in, long len);
658
+ int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **out);
659
+ extern const ASN1_ITEM ASN1_UTCTIME_it;
660
+ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_new(void);
661
+ void ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *a);
662
+ ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a, const unsigned char **in, long len);
663
+ int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **out);
664
+ extern const ASN1_ITEM ASN1_GENERALIZEDTIME_it;
665
+ ASN1_TIME *ASN1_TIME_new(void);
666
+ void ASN1_TIME_free(ASN1_TIME *a);
667
+ ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, const unsigned char **in, long len);
668
+ int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out);
669
+ extern const ASN1_ITEM ASN1_TIME_it;
670
+
671
+ int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm);
672
+ int ASN1_TIME_compare(const ASN1_TIME *t1, const ASN1_TIME *t2);
673
+ int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t2);
674
+ int ASN1_TIME_normalize(ASN1_TIME *t);
675
+ int ASN1_TIME_set_string_X509(ASN1_TIME *time, const char *str);
676
+ int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from,
677
+ const ASN1_TIME *to);
678
+
679
+ extern const ASN1_ITEM ASN1_OCTET_STRING_NDEF_it;
680
+
681
+ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t);
682
+ ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day,
683
+ long offset_sec);
684
+ int ASN1_TIME_check(const ASN1_TIME *t);
685
+ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,
686
+ ASN1_GENERALIZEDTIME **out);
687
+ int ASN1_TIME_set_string(ASN1_TIME *s, const char *str);
688
+
689
+ #ifndef OPENSSL_NO_BIO
690
+ int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a);
691
+ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size);
692
+ int i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a);
693
+ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size);
694
+ int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a);
695
+ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size);
696
+ int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type);
697
+ #endif
698
+ int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a);
699
+
700
+ int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num);
701
+ ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
702
+ const char *sn, const char *ln);
703
+
704
+ int ASN1_INTEGER_get_uint64(uint64_t *out_val, const ASN1_INTEGER *aint);
705
+ int ASN1_INTEGER_set_uint64(ASN1_INTEGER *aint, uint64_t val);
706
+ int ASN1_INTEGER_get_int64(int64_t *out_val, const ASN1_INTEGER *aint);
707
+ int ASN1_INTEGER_set_int64(ASN1_INTEGER *aint, int64_t val);
708
+ int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
709
+ long ASN1_INTEGER_get(const ASN1_INTEGER *a);
710
+ ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
711
+ BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
712
+
713
+ int ASN1_ENUMERATED_get_int64(int64_t *out_val, const ASN1_ENUMERATED *aenum);
714
+ int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *aenum, int64_t val);
715
+ int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
716
+ long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a);
717
+ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai);
718
+ BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn);
719
+
720
+ /* General */
721
+ /* given a string, return the correct type, max is the maximum length */
722
+ int ASN1_PRINTABLE_type(const unsigned char *s, int max);
723
+
724
+ /* SPECIALS */
725
+ int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
726
+ int *pclass, long omax);
727
+ void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
728
+ int xclass);
729
+ int ASN1_put_eoc(unsigned char **pp);
730
+ int ASN1_object_size(int constructed, int length, int tag);
731
+
732
+ void *ASN1_item_dup(const ASN1_ITEM *it, void *x);
733
+
734
+ void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x);
735
+
736
+ void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x);
737
+
738
+ #define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \
739
+ ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \
740
+ CHECKED_D2I_OF(type, d2i), \
741
+ in, \
742
+ CHECKED_PPTR_OF(type, x)))
743
+
744
+ void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
745
+ int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x);
746
+
747
+ #define ASN1_i2d_fp_of(type,i2d,out,x) \
748
+ (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \
749
+ out, \
750
+ CHECKED_PTR_OF(type, x)))
751
+
752
+ #define ASN1_i2d_fp_of_const(type,i2d,out,x) \
753
+ (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \
754
+ out, \
755
+ CHECKED_PTR_OF(const type, x)))
756
+
757
+ int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
758
+ int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str,
759
+ unsigned long flags);
760
+
761
+ int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in);
762
+
763
+ #ifndef OPENSSL_NO_BIO
764
+ void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x);
765
+
766
+ #define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
767
+ ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \
768
+ CHECKED_D2I_OF(type, d2i), \
769
+ in, \
770
+ CHECKED_PPTR_OF(type, x)))
771
+
772
+ void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);
773
+ int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x);
774
+
775
+ #define ASN1_i2d_bio_of(type,i2d,out,x) \
776
+ (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \
777
+ out, \
778
+ CHECKED_PTR_OF(type, x)))
779
+
780
+ #define ASN1_i2d_bio_of_const(type,i2d,out,x) \
781
+ (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \
782
+ out, \
783
+ CHECKED_PTR_OF(const type, x)))
784
+
785
+ int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
786
+ int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a);
787
+ int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a);
788
+ int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a);
789
+ int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v);
790
+ int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags);
791
+ int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent);
792
+ int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, int dump);
793
+ #endif
794
+
795
+ unsigned long ASN1_tag2bit(int tag);
796
+ const char *ASN1_tag2str(int tag);
797
+
798
+ int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
799
+
800
+ int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, const unsigned char *data, int len);
801
+ int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data,
802
+ int max_len);
803
+ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, const unsigned char *data,
804
+ int len);
805
+ int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num,
806
+ unsigned char *data, int max_len);
807
+
808
+ ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it,
809
+ ASN1_OCTET_STRING **oct);
810
+ void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it);
811
+
812
+ void ASN1_STRING_set_default_mask(unsigned long mask);
813
+ int ASN1_STRING_set_default_mask_asc(const char *p);
814
+ unsigned long ASN1_STRING_get_default_mask(void);
815
+ int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
816
+ int inform, unsigned long mask);
817
+ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
818
+ int inform, unsigned long mask, long minsize, long maxsize);
819
+
820
+ ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
821
+ const unsigned char *in, int inlen, int inform, int nid);
822
+ const ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
823
+
824
+ /* ASN1 template functions */
825
+
826
+ /* Old API compatible functions */
827
+ ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);
828
+ void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
829
+ ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in,
830
+ long len, const ASN1_ITEM *it);
831
+ int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
832
+
833
+ ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf);
834
+ ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf);
835
+
836
+ /* ASN1 Print flags */
837
+
838
+ /* Indicate missing OPTIONAL fields */
839
+ #define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001
840
+ /* Mark start and end of SEQUENCE */
841
+ #define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002
842
+ /* Mark start and end of SEQUENCE/SET OF */
843
+ #define ASN1_PCTX_FLAGS_SHOW_SSOF 0x004
844
+ /* Show the ASN1 type of primitives */
845
+ #define ASN1_PCTX_FLAGS_SHOW_TYPE 0x008
846
+ /* Don't show ASN1 type of ANY */
847
+ #define ASN1_PCTX_FLAGS_NO_ANY_TYPE 0x010
848
+ /* Don't show ASN1 type of MSTRINGs */
849
+ #define ASN1_PCTX_FLAGS_NO_MSTRING_TYPE 0x020
850
+ /* Don't show field names in SEQUENCE */
851
+ #define ASN1_PCTX_FLAGS_NO_FIELD_NAME 0x040
852
+ /* Show structure names of each SEQUENCE field */
853
+ #define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME 0x080
854
+ /* Don't show structure name even at top level */
855
+ #define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100
856
+
857
+ int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent,
858
+ const ASN1_ITEM *it, const ASN1_PCTX *pctx);
859
+
860
+ int SMIME_crlf_copy(BIO *in, BIO *out, int flags);
861
+ int SMIME_text(BIO *in, BIO *out);
862
+
863
+ void ERR_load_ASN1_strings(void);
864
+
865
+ /* Error codes for the ASN1 functions. */
866
+
867
+ /* Function codes. */
868
+ #define ASN1_F_A2D_ASN1_OBJECT 100
869
+ #define ASN1_F_A2I_ASN1_ENUMERATED 101
870
+ #define ASN1_F_A2I_ASN1_INTEGER 102
871
+ #define ASN1_F_A2I_ASN1_STRING 103
872
+ #define ASN1_F_APPEND_EXP 176
873
+ #define ASN1_F_ASN1_BIT_STRING_SET_BIT 183
874
+ #define ASN1_F_ASN1_CB 177
875
+ #define ASN1_F_ASN1_CHECK_TLEN 104
876
+ #define ASN1_F_ASN1_COLLATE_PRIMITIVE 105
877
+ #define ASN1_F_ASN1_COLLECT 106
878
+ #define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108
879
+ #define ASN1_F_ASN1_D2I_FP 109
880
+ #define ASN1_F_ASN1_D2I_READ_BIO 107
881
+ #define ASN1_F_ASN1_DIGEST 184
882
+ #define ASN1_F_ASN1_DO_ADB 110
883
+ #define ASN1_F_ASN1_DUP 111
884
+ #define ASN1_F_ASN1_ENUMERATED_SET 112
885
+ #define ASN1_F_ASN1_ENUMERATED_TO_BN 113
886
+ #define ASN1_F_ASN1_EX_C2I 204
887
+ #define ASN1_F_ASN1_FIND_END 190
888
+ #define ASN1_F_ASN1_GENERALIZEDTIME_ADJ 216
889
+ #define ASN1_F_ASN1_GENERALIZEDTIME_SET 185
890
+ #define ASN1_F_ASN1_GENERATE_V3 178
891
+ #define ASN1_F_ASN1_GET_OBJECT 114
892
+ #define ASN1_F_ASN1_HEADER_NEW 115
893
+ #define ASN1_F_ASN1_I2D_BIO 116
894
+ #define ASN1_F_ASN1_I2D_FP 117
895
+ #define ASN1_F_ASN1_INTEGER_SET 118
896
+ #define ASN1_F_ASN1_INTEGER_TO_BN 119
897
+ #define ASN1_F_ASN1_ITEM_D2I_FP 206
898
+ #define ASN1_F_ASN1_ITEM_DUP 191
899
+ #define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121
900
+ #define ASN1_F_ASN1_ITEM_EX_D2I 120
901
+ #define ASN1_F_ASN1_ITEM_I2D_BIO 192
902
+ #define ASN1_F_ASN1_ITEM_I2D_FP 193
903
+ #define ASN1_F_ASN1_ITEM_PACK 198
904
+ #define ASN1_F_ASN1_ITEM_SIGN 195
905
+ #define ASN1_F_ASN1_ITEM_SIGN_CTX 220
906
+ #define ASN1_F_ASN1_ITEM_UNPACK 199
907
+ #define ASN1_F_ASN1_ITEM_VERIFY 197
908
+ #define ASN1_F_ASN1_MBSTRING_NCOPY 122
909
+ #define ASN1_F_ASN1_OBJECT_NEW 123
910
+ #define ASN1_F_ASN1_OUTPUT_DATA 214
911
+ #define ASN1_F_ASN1_PACK_STRING 124
912
+ #define ASN1_F_ASN1_PCTX_NEW 205
913
+ #define ASN1_F_ASN1_PKCS5_PBE_SET 125
914
+ #define ASN1_F_ASN1_SEQ_PACK 126
915
+ #define ASN1_F_ASN1_SEQ_UNPACK 127
916
+ #define ASN1_F_ASN1_SIGN 128
917
+ #define ASN1_F_ASN1_STR2TYPE 179
918
+ #define ASN1_F_ASN1_STRING_SET 186
919
+ #define ASN1_F_ASN1_STRING_TABLE_ADD 129
920
+ #define ASN1_F_ASN1_STRING_TYPE_NEW 130
921
+ #define ASN1_F_ASN1_TEMPLATE_EX_D2I 132
922
+ #define ASN1_F_ASN1_TEMPLATE_NEW 133
923
+ #define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131
924
+ #define ASN1_F_ASN1_TIME_ADJ 217
925
+ #define ASN1_F_ASN1_TIME_SET 175
926
+ #define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134
927
+ #define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135
928
+ #define ASN1_F_ASN1_UNPACK_STRING 136
929
+ #define ASN1_F_ASN1_UTCTIME_ADJ 218
930
+ #define ASN1_F_ASN1_UTCTIME_SET 187
931
+ #define ASN1_F_ASN1_VERIFY 137
932
+ #define ASN1_F_B64_READ_ASN1 209
933
+ #define ASN1_F_B64_WRITE_ASN1 210
934
+ #define ASN1_F_BIO_NEW_NDEF 208
935
+ #define ASN1_F_BITSTR_CB 180
936
+ #define ASN1_F_BN_TO_ASN1_ENUMERATED 138
937
+ #define ASN1_F_BN_TO_ASN1_INTEGER 139
938
+ #define ASN1_F_C2I_ASN1_BIT_STRING 189
939
+ #define ASN1_F_C2I_ASN1_INTEGER 194
940
+ #define ASN1_F_C2I_ASN1_OBJECT 196
941
+ #define ASN1_F_COLLECT_DATA 140
942
+ #define ASN1_F_D2I_ASN1_BIT_STRING 141
943
+ #define ASN1_F_D2I_ASN1_BOOLEAN 142
944
+ #define ASN1_F_D2I_ASN1_BYTES 143
945
+ #define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144
946
+ #define ASN1_F_D2I_ASN1_HEADER 145
947
+ #define ASN1_F_D2I_ASN1_INTEGER 146
948
+ #define ASN1_F_D2I_ASN1_OBJECT 147
949
+ #define ASN1_F_D2I_ASN1_SET 148
950
+ #define ASN1_F_D2I_ASN1_TYPE_BYTES 149
951
+ #define ASN1_F_D2I_ASN1_UINTEGER 150
952
+ #define ASN1_F_D2I_ASN1_UTCTIME 151
953
+ #define ASN1_F_D2I_AUTOPRIVATEKEY 207
954
+ #define ASN1_F_D2I_NETSCAPE_RSA 152
955
+ #define ASN1_F_D2I_NETSCAPE_RSA_2 153
956
+ #define ASN1_F_D2I_PRIVATEKEY 154
957
+ #define ASN1_F_D2I_PUBLICKEY 155
958
+ #define ASN1_F_D2I_RSA_NET 200
959
+ #define ASN1_F_D2I_RSA_NET_2 201
960
+ #define ASN1_F_D2I_X509 156
961
+ #define ASN1_F_D2I_X509_CINF 157
962
+ #define ASN1_F_D2I_X509_PKEY 159
963
+ #define ASN1_F_I2D_ASN1_BIO_STREAM 211
964
+ #define ASN1_F_I2D_ASN1_SET 188
965
+ #define ASN1_F_I2D_ASN1_TIME 160
966
+ #define ASN1_F_I2D_DSA_PUBKEY 161
967
+ #define ASN1_F_I2D_EC_PUBKEY 181
968
+ #define ASN1_F_I2D_PRIVATEKEY 163
969
+ #define ASN1_F_I2D_PUBLICKEY 164
970
+ #define ASN1_F_I2D_RSA_NET 162
971
+ #define ASN1_F_I2D_RSA_PUBKEY 165
972
+ #define ASN1_F_LONG_C2I 166
973
+ #define ASN1_F_OID_MODULE_INIT 174
974
+ #define ASN1_F_PARSE_TAGGING 182
975
+ #define ASN1_F_PKCS5_PBE2_SET_IV 167
976
+ #define ASN1_F_PKCS5_PBE_SET 202
977
+ #define ASN1_F_PKCS5_PBE_SET0_ALGOR 215
978
+ #define ASN1_F_PKCS5_PBKDF2_SET 219
979
+ #define ASN1_F_SMIME_READ_ASN1 212
980
+ #define ASN1_F_SMIME_TEXT 213
981
+ #define ASN1_F_X509_CINF_NEW 168
982
+ #define ASN1_F_X509_CRL_ADD0_REVOKED 169
983
+ #define ASN1_F_X509_INFO_NEW 170
984
+ #define ASN1_F_X509_NAME_ENCODE 203
985
+ #define ASN1_F_X509_NAME_EX_D2I 158
986
+ #define ASN1_F_X509_NAME_EX_NEW 171
987
+ #define ASN1_F_X509_NEW 172
988
+ #define ASN1_F_X509_PKEY_NEW 173
989
+
990
+ /* Reason codes. */
991
+ #define ASN1_R_ADDING_OBJECT 171
992
+ #define ASN1_R_ASN1_PARSE_ERROR 203
993
+ #define ASN1_R_ASN1_SIG_PARSE_ERROR 204
994
+ #define ASN1_R_AUX_ERROR 100
995
+ #define ASN1_R_BAD_CLASS 101
996
+ #define ASN1_R_BAD_OBJECT_HEADER 102
997
+ #define ASN1_R_BAD_PASSWORD_READ 103
998
+ #define ASN1_R_BAD_TAG 104
999
+ #define ASN1_R_BAD_TEMPLATE 230
1000
+ #define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214
1001
+ #define ASN1_R_BN_LIB 105
1002
+ #define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
1003
+ #define ASN1_R_BUFFER_TOO_SMALL 107
1004
+ #define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
1005
+ #define ASN1_R_CONTEXT_NOT_INITIALISED 217
1006
+ #define ASN1_R_DATA_IS_WRONG 109
1007
+ #define ASN1_R_DECODE_ERROR 110
1008
+ #define ASN1_R_DECODING_ERROR 111
1009
+ #define ASN1_R_DEPTH_EXCEEDED 174
1010
+ #define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED 198
1011
+ #define ASN1_R_ENCODE_ERROR 112
1012
+ #define ASN1_R_ERROR_GETTING_TIME 173
1013
+ #define ASN1_R_ERROR_LOADING_SECTION 172
1014
+ #define ASN1_R_ERROR_PARSING_SET_ELEMENT 113
1015
+ #define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114
1016
+ #define ASN1_R_EXPECTING_AN_INTEGER 115
1017
+ #define ASN1_R_EXPECTING_AN_OBJECT 116
1018
+ #define ASN1_R_EXPECTING_A_BOOLEAN 117
1019
+ #define ASN1_R_EXPECTING_A_TIME 118
1020
+ #define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119
1021
+ #define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120
1022
+ #define ASN1_R_FIELD_MISSING 121
1023
+ #define ASN1_R_FIRST_NUM_TOO_LARGE 122
1024
+ #define ASN1_R_HEADER_TOO_LONG 123
1025
+ #define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175
1026
+ #define ASN1_R_ILLEGAL_BOOLEAN 176
1027
+ #define ASN1_R_ILLEGAL_CHARACTERS 124
1028
+ #define ASN1_R_ILLEGAL_FORMAT 177
1029
+ #define ASN1_R_ILLEGAL_HEX 178
1030
+ #define ASN1_R_ILLEGAL_IMPLICIT_TAG 179
1031
+ #define ASN1_R_ILLEGAL_INTEGER 180
1032
+ #define ASN1_R_ILLEGAL_NEGATIVE_VALUE 226
1033
+ #define ASN1_R_ILLEGAL_NESTED_TAGGING 181
1034
+ #define ASN1_R_ILLEGAL_NULL 125
1035
+ #define ASN1_R_ILLEGAL_NULL_VALUE 182
1036
+ #define ASN1_R_ILLEGAL_OBJECT 183
1037
+ #define ASN1_R_ILLEGAL_OPTIONAL_ANY 126
1038
+ #define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170
1039
+ #define ASN1_R_ILLEGAL_TAGGED_ANY 127
1040
+ #define ASN1_R_ILLEGAL_TIME_VALUE 184
1041
+ #define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
1042
+ #define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
1043
+ #define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220
1044
+ #define ASN1_R_INVALID_BMPSTRING_LENGTH 129
1045
+ #define ASN1_R_INVALID_DIGIT 130
1046
+ #define ASN1_R_INVALID_MIME_TYPE 205
1047
+ #define ASN1_R_INVALID_MODIFIER 186
1048
+ #define ASN1_R_INVALID_NUMBER 187
1049
+ #define ASN1_R_INVALID_OBJECT_ENCODING 216
1050
+ #define ASN1_R_INVALID_SEPARATOR 131
1051
+ #define ASN1_R_INVALID_TIME_FORMAT 132
1052
+ #define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133
1053
+ #define ASN1_R_INVALID_UTF8STRING 134
1054
+ #define ASN1_R_IV_TOO_LARGE 135
1055
+ #define ASN1_R_LENGTH_ERROR 136
1056
+ #define ASN1_R_LIST_ERROR 188
1057
+ #define ASN1_R_MIME_NO_CONTENT_TYPE 206
1058
+ #define ASN1_R_MIME_PARSE_ERROR 207
1059
+ #define ASN1_R_MIME_SIG_PARSE_ERROR 208
1060
+ #define ASN1_R_MISSING_EOC 137
1061
+ #define ASN1_R_MISSING_SECOND_NUMBER 138
1062
+ #define ASN1_R_MISSING_VALUE 189
1063
+ #define ASN1_R_MSTRING_NOT_UNIVERSAL 139
1064
+ #define ASN1_R_MSTRING_WRONG_TAG 140
1065
+ #define ASN1_R_NESTED_ASN1_STRING 197
1066
+ #define ASN1_R_NESTED_TOO_DEEP 219
1067
+ #define ASN1_R_NON_HEX_CHARACTERS 141
1068
+ #define ASN1_R_NOT_ASCII_FORMAT 190
1069
+ #define ASN1_R_NOT_ENOUGH_DATA 142
1070
+ #define ASN1_R_NO_CONTENT_TYPE 209
1071
+ #define ASN1_R_NO_DEFAULT_DIGEST 201
1072
+ #define ASN1_R_NO_MATCHING_CHOICE_TYPE 143
1073
+ #define ASN1_R_NO_MULTIPART_BODY_FAILURE 210
1074
+ #define ASN1_R_NO_MULTIPART_BOUNDARY 211
1075
+ #define ASN1_R_NO_SIG_CONTENT_TYPE 212
1076
+ #define ASN1_R_NULL_IS_WRONG_LENGTH 144
1077
+ #define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191
1078
+ #define ASN1_R_ODD_NUMBER_OF_CHARS 145
1079
+ #define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146
1080
+ #define ASN1_R_SECOND_NUMBER_TOO_LARGE 147
1081
+ #define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148
1082
+ #define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149
1083
+ #define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192
1084
+ #define ASN1_R_SHORT_LINE 150
1085
+ #define ASN1_R_SIG_INVALID_MIME_TYPE 213
1086
+ #define ASN1_R_STREAMING_NOT_SUPPORTED 202
1087
+ #define ASN1_R_STRING_TOO_LONG 151
1088
+ #define ASN1_R_STRING_TOO_SHORT 152
1089
+ #define ASN1_R_TAG_VALUE_TOO_HIGH 153
1090
+ #define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154
1091
+ #define ASN1_R_TIME_NOT_ASCII_FORMAT 193
1092
+ #define ASN1_R_TOO_LARGE 223
1093
+ #define ASN1_R_TOO_LONG 155
1094
+ #define ASN1_R_TOO_SMALL 224
1095
+ #define ASN1_R_TYPE_NOT_CONSTRUCTED 156
1096
+ #define ASN1_R_TYPE_NOT_PRIMITIVE 231
1097
+ #define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157
1098
+ #define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158
1099
+ #define ASN1_R_UNEXPECTED_EOC 159
1100
+ #define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 215
1101
+ #define ASN1_R_UNKNOWN_FORMAT 160
1102
+ #define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
1103
+ #define ASN1_R_UNKNOWN_OBJECT_TYPE 162
1104
+ #define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163
1105
+ #define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM 199
1106
+ #define ASN1_R_UNKNOWN_TAG 194
1107
+ #define ASN1_R_UNKOWN_FORMAT 195
1108
+ #define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164
1109
+ #define ASN1_R_UNSUPPORTED_CIPHER 165
1110
+ #define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166
1111
+ #define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167
1112
+ #define ASN1_R_UNSUPPORTED_TYPE 196
1113
+ #define ASN1_R_WRONG_INTEGER_TYPE 225
1114
+ #define ASN1_R_WRONG_PUBLIC_KEY_TYPE 200
1115
+ #define ASN1_R_WRONG_TAG 168
1116
+ #define ASN1_R_WRONG_TYPE 169
1117
+
1118
+ #ifdef __cplusplus
1119
+ }
1120
+ #endif
1121
+ #endif