blob: 4fb9487151a6b7b19af9b10369d34f31a23592df [file] [log] [blame]
Lev Walkin006de1c2004-08-20 13:37:45 +00001
Lev Walkina00d6b32006-03-21 03:40:38 +00002/*** <<< INCLUDES [SIGNED] >>> ***/
Lev Walkin006de1c2004-08-20 13:37:45 +00003
4#include <OBJECT_IDENTIFIER.h>
5#include <BIT_STRING.h>
6#include <INTEGER.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00007#include "Name.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00008#include <constr_SEQUENCE.h>
9
Lev Walkina00d6b32006-03-21 03:40:38 +000010/*** <<< TYPE-DECLS [SIGNED] >>> ***/
Lev Walkin006de1c2004-08-20 13:37:45 +000011
Lev Walkina00d6b32006-03-21 03:40:38 +000012typedef struct SIGNED_15P0 {
Lev Walkin006de1c2004-08-20 13:37:45 +000013 struct toBeSigned {
14 INTEGER_t version;
15 OBJECT_IDENTIFIER_t signature;
16 Name_t issuer;
17
18 /* Context for parsing across buffer boundaries */
Lev Walkindfae9752004-09-29 13:19:37 +000019 asn_struct_ctx_t _asn_ctx;
Lev Walkin006de1c2004-08-20 13:37:45 +000020 } toBeSigned;
21 OBJECT_IDENTIFIER_t algorithm;
22 BIT_STRING_t signature;
23
24 /* Context for parsing across buffer boundaries */
Lev Walkindfae9752004-09-29 13:19:37 +000025 asn_struct_ctx_t _asn_ctx;
Lev Walkina00d6b32006-03-21 03:40:38 +000026} SIGNED_15P0_t;
Lev Walkin006de1c2004-08-20 13:37:45 +000027
Lev Walkina00d6b32006-03-21 03:40:38 +000028/*** <<< FUNC-DECLS [SIGNED] >>> ***/
Lev Walkinc8285712005-03-04 22:18:20 +000029
Lev Walkina00d6b32006-03-21 03:40:38 +000030extern asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080031extern asn_SEQUENCE_specifics_t asn_SPC_SIGNED_15P0_specs_1;
32extern asn_TYPE_member_t asn_MBR_SIGNED_15P0_1[3];
Lev Walkinc8285712005-03-04 22:18:20 +000033
Lev Walkina00d6b32006-03-21 03:40:38 +000034/*** <<< CODE [SIGNED] >>> ***/
Lev Walkindaa7d2b2004-09-05 10:37:18 +000035
36static int
Lev Walkin59b176e2005-11-26 11:25:14 +000037memb_signature_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000038 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +000039 const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
Lev Walkindaa7d2b2004-09-05 10:37:18 +000040 size_t size;
41
42 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070043 ASN__CTFAIL(app_key, td, sptr,
Lev Walkindaa7d2b2004-09-05 10:37:18 +000044 "%s: value not given (%s:%d)",
45 td->name, __FILE__, __LINE__);
46 return -1;
47 }
48
49 if(st->size > 0) {
50 /* Size in bits */
Lev Walkin1b1c5fc2006-09-08 19:38:11 +000051 size = 8 * st->size - (st->bits_unused & 0x07);
Lev Walkindaa7d2b2004-09-05 10:37:18 +000052 } else {
53 size = 0;
54 }
55
56 if((size <= 256)) {
57 /* Constraint check succeeded */
58 return 0;
59 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -070060 ASN__CTFAIL(app_key, td, sptr,
Lev Walkindaa7d2b2004-09-05 10:37:18 +000061 "%s: constraint failed (%s:%d)",
62 td->name, __FILE__, __LINE__);
63 return -1;
64 }
65}
66
67
Lev Walkina00d6b32006-03-21 03:40:38 +000068/*** <<< STAT-DEFS [SIGNED] >>> ***/
Lev Walkin006de1c2004-08-20 13:37:45 +000069
Lev Walkine0272aa2005-03-04 11:26:08 +000070static asn_TYPE_member_t asn_MBR_toBeSigned_2[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +000071 { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, version),
Lev Walkin006de1c2004-08-20 13:37:45 +000072 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
73 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000074 .type = &asn_DEF_INTEGER,
Lev Walkin67a30122017-08-10 05:48:54 -070075 .type_selector = 0,
Lev Walkinba58e1b2005-01-17 12:20:19 +000076 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040077 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +000078 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
79 .default_value = 0,
Lev Walkin006de1c2004-08-20 13:37:45 +000080 .name = "version"
81 },
Lev Walkincc93b0f2004-09-10 09:18:20 +000082 { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, signature),
Lev Walkin006de1c2004-08-20 13:37:45 +000083 .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
84 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000085 .type = &asn_DEF_OBJECT_IDENTIFIER,
Lev Walkin67a30122017-08-10 05:48:54 -070086 .type_selector = 0,
Lev Walkinba58e1b2005-01-17 12:20:19 +000087 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040088 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +000089 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
90 .default_value = 0,
Lev Walkin006de1c2004-08-20 13:37:45 +000091 .name = "signature"
92 },
Lev Walkincc93b0f2004-09-10 09:18:20 +000093 { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, issuer),
Lev Walkin006de1c2004-08-20 13:37:45 +000094 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
95 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000096 .type = &asn_DEF_Name,
Lev Walkin67a30122017-08-10 05:48:54 -070097 .type_selector = 0,
Lev Walkinba58e1b2005-01-17 12:20:19 +000098 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040099 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000100 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
101 .default_value = 0,
Lev Walkin006de1c2004-08-20 13:37:45 +0000102 .name = "issuer"
103 },
104};
Lev Walkina7591b52014-10-12 18:37:35 -0700105static const ber_tlv_tag_t asn_DEF_toBeSigned_tags_2[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000106 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
107};
Lev Walkina7591b52014-10-12 18:37:35 -0700108static const asn_TYPE_tag2member_t asn_MAP_toBeSigned_tag2el_2[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700109 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* version */
110 { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 1, 0, 0 }, /* signature */
111 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 0 } /* issuer */
Lev Walkin006de1c2004-08-20 13:37:45 +0000112};
Lev Walkin59b176e2005-11-26 11:25:14 +0000113static asn_SEQUENCE_specifics_t asn_SPC_toBeSigned_specs_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000114 sizeof(struct toBeSigned),
Lev Walkindfae9752004-09-29 13:19:37 +0000115 offsetof(struct toBeSigned, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700116 .tag2el = asn_MAP_toBeSigned_tag2el_2,
117 .tag2el_count = 3, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000118 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin006de1c2004-08-20 13:37:45 +0000119 -1, /* Start extensions */
120 -1 /* Stop extensions */
121};
Lev Walkind04430c2004-09-07 06:44:29 +0000122static /* Use -fall-defs-global to expose */
Lev Walkine0272aa2005-03-04 11:26:08 +0000123asn_TYPE_descriptor_t asn_DEF_toBeSigned_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000124 "toBeSigned",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000125 "toBeSigned",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800126 &asn_OP_SEQUENCE,
Lev Walkin006de1c2004-08-20 13:37:45 +0000127 SEQUENCE_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000128 asn_DEF_toBeSigned_tags_2,
129 sizeof(asn_DEF_toBeSigned_tags_2)
130 /sizeof(asn_DEF_toBeSigned_tags_2[0]), /* 1 */
131 asn_DEF_toBeSigned_tags_2, /* Same as above */
132 sizeof(asn_DEF_toBeSigned_tags_2)
133 /sizeof(asn_DEF_toBeSigned_tags_2[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400134 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000135 0, /* No PER visible constraints */
Lev Walkine0272aa2005-03-04 11:26:08 +0000136 asn_MBR_toBeSigned_2,
Lev Walkin006de1c2004-08-20 13:37:45 +0000137 3, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000138 &asn_SPC_toBeSigned_specs_2 /* Additional specs */
Lev Walkin006de1c2004-08-20 13:37:45 +0000139};
140
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800141asn_TYPE_member_t asn_MBR_SIGNED_15P0_1[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000142 { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, toBeSigned),
Lev Walkin006de1c2004-08-20 13:37:45 +0000143 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
144 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000145 .type = &asn_DEF_toBeSigned_2,
Lev Walkin67a30122017-08-10 05:48:54 -0700146 .type_selector = 0,
Lev Walkinba58e1b2005-01-17 12:20:19 +0000147 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400148 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000149 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
150 .default_value = 0,
Lev Walkin006de1c2004-08-20 13:37:45 +0000151 .name = "toBeSigned"
152 },
Lev Walkina00d6b32006-03-21 03:40:38 +0000153 { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, algorithm),
Lev Walkin006de1c2004-08-20 13:37:45 +0000154 .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
155 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000156 .type = &asn_DEF_OBJECT_IDENTIFIER,
Lev Walkin67a30122017-08-10 05:48:54 -0700157 .type_selector = 0,
Lev Walkinba58e1b2005-01-17 12:20:19 +0000158 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400159 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000160 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
161 .default_value = 0,
Lev Walkin006de1c2004-08-20 13:37:45 +0000162 .name = "algorithm"
163 },
Lev Walkina00d6b32006-03-21 03:40:38 +0000164 { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, signature),
Lev Walkin006de1c2004-08-20 13:37:45 +0000165 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
166 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000167 .type = &asn_DEF_BIT_STRING,
Lev Walkin67a30122017-08-10 05:48:54 -0700168 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +0000169 .memb_constraints = memb_signature_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +0400170 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000171 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
172 .default_value = 0,
Lev Walkin006de1c2004-08-20 13:37:45 +0000173 .name = "signature"
174 },
175};
Lev Walkina7591b52014-10-12 18:37:35 -0700176static const ber_tlv_tag_t asn_DEF_SIGNED_15P0_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000177 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
178};
Lev Walkina7591b52014-10-12 18:37:35 -0700179static const asn_TYPE_tag2member_t asn_MAP_SIGNED_15P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700180 { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 2, 0, 0 }, /* signature */
181 { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 1, 0, 0 }, /* algorithm */
182 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* toBeSigned */
Lev Walkin006de1c2004-08-20 13:37:45 +0000183};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800184asn_SEQUENCE_specifics_t asn_SPC_SIGNED_15P0_specs_1 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000185 sizeof(struct SIGNED_15P0),
186 offsetof(struct SIGNED_15P0, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700187 .tag2el = asn_MAP_SIGNED_15P0_tag2el_1,
188 .tag2el_count = 3, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000189 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin006de1c2004-08-20 13:37:45 +0000190 -1, /* Start extensions */
191 -1 /* Stop extensions */
192};
Lev Walkina00d6b32006-03-21 03:40:38 +0000193asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0 = {
194 "SIGNED",
195 "SIGNED",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800196 &asn_OP_SEQUENCE,
Lev Walkin006de1c2004-08-20 13:37:45 +0000197 SEQUENCE_constraint,
Lev Walkina00d6b32006-03-21 03:40:38 +0000198 asn_DEF_SIGNED_15P0_tags_1,
199 sizeof(asn_DEF_SIGNED_15P0_tags_1)
200 /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */
201 asn_DEF_SIGNED_15P0_tags_1, /* Same as above */
202 sizeof(asn_DEF_SIGNED_15P0_tags_1)
203 /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400204 0, /* No OER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000205 0, /* No PER visible constraints */
206 asn_MBR_SIGNED_15P0_1,
207 3, /* Elements count */
208 &asn_SPC_SIGNED_15P0_specs_1 /* Additional specs */
209};
210
211
212/*** <<< INCLUDES [Certificate] >>> ***/
213
Lev Walkin22b5ed42006-09-13 02:51:20 +0000214#include "SIGNED.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000215
216/*** <<< TYPE-DECLS [Certificate] >>> ***/
217
218typedef SIGNED_15P0_t Certificate_t;
219
220/*** <<< FUNC-DECLS [Certificate] >>> ***/
221
222extern asn_TYPE_descriptor_t asn_DEF_Certificate;
223asn_struct_free_f Certificate_free;
224asn_struct_print_f Certificate_print;
225asn_constr_check_f Certificate_constraint;
226ber_type_decoder_f Certificate_decode_ber;
227der_type_encoder_f Certificate_encode_der;
228xer_type_decoder_f Certificate_decode_xer;
229xer_type_encoder_f Certificate_encode_xer;
230
231/*** <<< CODE [Certificate] >>> ***/
232
Lev Walkina00d6b32006-03-21 03:40:38 +0000233/*
234 * This type is implemented using SIGNED_15P0,
235 * so here we adjust the DEF accordingly.
236 */
Lev Walkina00d6b32006-03-21 03:40:38 +0000237
238/*** <<< STAT-DEFS [Certificate] >>> ***/
239
Lev Walkina7591b52014-10-12 18:37:35 -0700240static const ber_tlv_tag_t asn_DEF_Certificate_tags_1[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000241 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
242};
243asn_TYPE_descriptor_t asn_DEF_Certificate = {
244 "Certificate",
245 "Certificate",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800246 &asn_OP_SEQUENCE,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800247 SEQUENCE_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000248 asn_DEF_Certificate_tags_1,
249 sizeof(asn_DEF_Certificate_tags_1)
250 /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */
251 asn_DEF_Certificate_tags_1, /* Same as above */
252 sizeof(asn_DEF_Certificate_tags_1)
253 /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400254 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000255 0, /* No PER visible constraints */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800256 asn_MBR_SIGNED_15P0_1,
257 3, /* Elements count */
258 &asn_SPC_SIGNED_15P0_specs_1 /* Additional specs */
Lev Walkin006de1c2004-08-20 13:37:45 +0000259};
260
261
262/*** <<< INCLUDES [Name] >>> ***/
263
Lev Walkin006de1c2004-08-20 13:37:45 +0000264#include <asn_SEQUENCE_OF.h>
265#include <constr_SEQUENCE_OF.h>
266
Lev Walkinc8285712005-03-04 22:18:20 +0000267/*** <<< FWD-DECLS [Name] >>> ***/
Lev Walkin006de1c2004-08-20 13:37:45 +0000268
Lev Walkinbf56d542005-03-04 23:50:56 +0000269struct RelativeDistinguishedName;
Lev Walkin006de1c2004-08-20 13:37:45 +0000270
271/*** <<< TYPE-DECLS [Name] >>> ***/
272
Lev Walkin006de1c2004-08-20 13:37:45 +0000273typedef struct Name {
Lev Walkinc8285712005-03-04 22:18:20 +0000274 A_SEQUENCE_OF(struct RelativeDistinguishedName) list;
Lev Walkin006de1c2004-08-20 13:37:45 +0000275
276 /* Context for parsing across buffer boundaries */
Lev Walkindfae9752004-09-29 13:19:37 +0000277 asn_struct_ctx_t _asn_ctx;
Lev Walkin006de1c2004-08-20 13:37:45 +0000278} Name_t;
279
Lev Walkinc8285712005-03-04 22:18:20 +0000280/*** <<< FUNC-DECLS [Name] >>> ***/
281
282extern asn_TYPE_descriptor_t asn_DEF_Name;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800283extern asn_SET_OF_specifics_t asn_SPC_Name_specs_1;
284extern asn_TYPE_member_t asn_MBR_Name_1[1];
Lev Walkinc8285712005-03-04 22:18:20 +0000285
286/*** <<< POST-INCLUDE [Name] >>> ***/
287
Lev Walkin22b5ed42006-09-13 02:51:20 +0000288#include "RelativeDistinguishedName.h"
Lev Walkinc8285712005-03-04 22:18:20 +0000289
Lev Walkin006de1c2004-08-20 13:37:45 +0000290/*** <<< STAT-DEFS [Name] >>> ***/
291
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800292asn_TYPE_member_t asn_MBR_Name_1[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +0000293 { ATF_POINTER, 0, 0,
Lev Walkin006de1c2004-08-20 13:37:45 +0000294 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
295 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000296 .type = &asn_DEF_RelativeDistinguishedName,
Lev Walkin67a30122017-08-10 05:48:54 -0700297 .type_selector = 0,
Lev Walkinba58e1b2005-01-17 12:20:19 +0000298 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400299 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000300 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
301 .default_value = 0,
Lev Walkin006de1c2004-08-20 13:37:45 +0000302 .name = ""
303 },
304};
Lev Walkina7591b52014-10-12 18:37:35 -0700305static const ber_tlv_tag_t asn_DEF_Name_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000306 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
307};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800308asn_SET_OF_specifics_t asn_SPC_Name_specs_1 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000309 sizeof(struct Name),
Lev Walkindfae9752004-09-29 13:19:37 +0000310 offsetof(struct Name, _asn_ctx),
Lev Walkina9cc46e2004-09-22 16:06:28 +0000311 0, /* XER encoding is XMLDelimitedItemList */
Lev Walkin006de1c2004-08-20 13:37:45 +0000312};
Lev Walkindfae9752004-09-29 13:19:37 +0000313asn_TYPE_descriptor_t asn_DEF_Name = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000314 "Name",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000315 "Name",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800316 &asn_OP_SEQUENCE_OF,
Lev Walkin006de1c2004-08-20 13:37:45 +0000317 SEQUENCE_OF_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000318 asn_DEF_Name_tags_1,
319 sizeof(asn_DEF_Name_tags_1)
320 /sizeof(asn_DEF_Name_tags_1[0]), /* 1 */
321 asn_DEF_Name_tags_1, /* Same as above */
322 sizeof(asn_DEF_Name_tags_1)
323 /sizeof(asn_DEF_Name_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400324 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000325 0, /* No PER visible constraints */
Lev Walkine0272aa2005-03-04 11:26:08 +0000326 asn_MBR_Name_1,
Lev Walkin006de1c2004-08-20 13:37:45 +0000327 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +0000328 &asn_SPC_Name_specs_1 /* Additional specs */
Lev Walkin006de1c2004-08-20 13:37:45 +0000329};
330
331
332/*** <<< INCLUDES [RelativeDistinguishedName] >>> ***/
333
334#include <IA5String.h>
335#include <asn_SET_OF.h>
336#include <constr_SET_OF.h>
337
Lev Walkin006de1c2004-08-20 13:37:45 +0000338/*** <<< TYPE-DECLS [RelativeDistinguishedName] >>> ***/
339
Lev Walkin006de1c2004-08-20 13:37:45 +0000340typedef struct RelativeDistinguishedName {
341 A_SET_OF(IA5String_t) list;
342
343 /* Context for parsing across buffer boundaries */
Lev Walkindfae9752004-09-29 13:19:37 +0000344 asn_struct_ctx_t _asn_ctx;
Lev Walkin006de1c2004-08-20 13:37:45 +0000345} RelativeDistinguishedName_t;
346
Lev Walkinc8285712005-03-04 22:18:20 +0000347/*** <<< FUNC-DECLS [RelativeDistinguishedName] >>> ***/
348
349extern asn_TYPE_descriptor_t asn_DEF_RelativeDistinguishedName;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800350extern asn_SET_OF_specifics_t asn_SPC_RelativeDistinguishedName_specs_1;
351extern asn_TYPE_member_t asn_MBR_RelativeDistinguishedName_1[1];
Lev Walkinc8285712005-03-04 22:18:20 +0000352
Lev Walkin006de1c2004-08-20 13:37:45 +0000353/*** <<< CTABLES [RelativeDistinguishedName] >>> ***/
354
Lev Walkina7591b52014-10-12 18:37:35 -0700355static const int permitted_alphabet_table_2[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000356 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
357 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
358 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, /* ,-. */
359 4, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, /* 0 9 */
360 0, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20, /* ABCDEFGHIJKLMNO */
36121,22,23,24,25,26,27,28,29,30,31, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
362 0,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46, /* abcdefghijklmno */
36347,48,49,50,51,52,53,54,55,56,57, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin006de1c2004-08-20 13:37:45 +0000364};
365
Lev Walkine8318b82005-03-06 09:29:03 +0000366static int check_permitted_alphabet_2(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -0700367 const int *table = permitted_alphabet_table_2;
Lev Walkin006de1c2004-08-20 13:37:45 +0000368 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000369 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkina09e5da2004-08-22 03:19:00 +0000370 const uint8_t *ch = st->buf;
371 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000372
373 for(; ch < end; ch++) {
374 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000375 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000376 }
Lev Walkin775885e2004-08-22 12:47:03 +0000377 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000378}
379
380
381/*** <<< CODE [RelativeDistinguishedName] >>> ***/
382
383static int
Lev Walkin59b176e2005-11-26 11:25:14 +0000384memb_IA5String_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000385 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000386 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000387
388 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700389 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000390 "%s: value not given (%s:%d)",
391 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000392 return -1;
393 }
394
395
Lev Walkine8318b82005-03-06 09:29:03 +0000396 if(!check_permitted_alphabet_2(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000397 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000398 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000399 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700400 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000401 "%s: constraint failed (%s:%d)",
402 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000403 return -1;
404 }
405}
406
407
408/*** <<< STAT-DEFS [RelativeDistinguishedName] >>> ***/
409
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800410asn_TYPE_member_t asn_MBR_RelativeDistinguishedName_1[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +0000411 { ATF_POINTER, 0, 0,
Lev Walkin006de1c2004-08-20 13:37:45 +0000412 .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
413 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000414 .type = &asn_DEF_IA5String,
Lev Walkin67a30122017-08-10 05:48:54 -0700415 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +0000416 .memb_constraints = memb_IA5String_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +0400417 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000418 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
419 .default_value = 0,
Lev Walkin006de1c2004-08-20 13:37:45 +0000420 .name = ""
421 },
422};
Lev Walkina7591b52014-10-12 18:37:35 -0700423static const ber_tlv_tag_t asn_DEF_RelativeDistinguishedName_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000424 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
425};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800426asn_SET_OF_specifics_t asn_SPC_RelativeDistinguishedName_specs_1 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000427 sizeof(struct RelativeDistinguishedName),
Lev Walkindfae9752004-09-29 13:19:37 +0000428 offsetof(struct RelativeDistinguishedName, _asn_ctx),
Lev Walkina9cc46e2004-09-22 16:06:28 +0000429 0, /* XER encoding is XMLDelimitedItemList */
Lev Walkin006de1c2004-08-20 13:37:45 +0000430};
Lev Walkindfae9752004-09-29 13:19:37 +0000431asn_TYPE_descriptor_t asn_DEF_RelativeDistinguishedName = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000432 "RelativeDistinguishedName",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000433 "RelativeDistinguishedName",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800434 &asn_OP_SET_OF,
Lev Walkin006de1c2004-08-20 13:37:45 +0000435 SET_OF_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000436 asn_DEF_RelativeDistinguishedName_tags_1,
437 sizeof(asn_DEF_RelativeDistinguishedName_tags_1)
438 /sizeof(asn_DEF_RelativeDistinguishedName_tags_1[0]), /* 1 */
439 asn_DEF_RelativeDistinguishedName_tags_1, /* Same as above */
440 sizeof(asn_DEF_RelativeDistinguishedName_tags_1)
441 /sizeof(asn_DEF_RelativeDistinguishedName_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400442 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000443 0, /* No PER visible constraints */
Lev Walkine0272aa2005-03-04 11:26:08 +0000444 asn_MBR_RelativeDistinguishedName_1,
Lev Walkin006de1c2004-08-20 13:37:45 +0000445 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +0000446 &asn_SPC_RelativeDistinguishedName_specs_1 /* Additional specs */
Lev Walkin006de1c2004-08-20 13:37:45 +0000447};
448