blob: 2e9ee7f2b932d5dcb89d29fa2b017eef937e795d [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 Walkin20696a42017-10-17 21:27:33 -070037memb_signature_constraint_1(const 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 Walkin0bfea562017-09-29 23:16:48 -070076 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070077 0, 0, /* No default value */
Lev Walkin006de1c2004-08-20 13:37:45 +000078 .name = "version"
79 },
Lev Walkincc93b0f2004-09-10 09:18:20 +000080 { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, signature),
Lev Walkin006de1c2004-08-20 13:37:45 +000081 .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
82 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000083 .type = &asn_DEF_OBJECT_IDENTIFIER,
Lev Walkin67a30122017-08-10 05:48:54 -070084 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070085 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070086 0, 0, /* No default value */
Lev Walkin006de1c2004-08-20 13:37:45 +000087 .name = "signature"
88 },
Lev Walkincc93b0f2004-09-10 09:18:20 +000089 { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, issuer),
Lev Walkin006de1c2004-08-20 13:37:45 +000090 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
91 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000092 .type = &asn_DEF_Name,
Lev Walkin67a30122017-08-10 05:48:54 -070093 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070094 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070095 0, 0, /* No default value */
Lev Walkin006de1c2004-08-20 13:37:45 +000096 .name = "issuer"
97 },
98};
Lev Walkina7591b52014-10-12 18:37:35 -070099static const ber_tlv_tag_t asn_DEF_toBeSigned_tags_2[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000100 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
101};
Lev Walkina7591b52014-10-12 18:37:35 -0700102static const asn_TYPE_tag2member_t asn_MAP_toBeSigned_tag2el_2[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700103 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* version */
104 { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 1, 0, 0 }, /* signature */
105 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 0 } /* issuer */
Lev Walkin006de1c2004-08-20 13:37:45 +0000106};
Lev Walkin59b176e2005-11-26 11:25:14 +0000107static asn_SEQUENCE_specifics_t asn_SPC_toBeSigned_specs_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000108 sizeof(struct toBeSigned),
Lev Walkindfae9752004-09-29 13:19:37 +0000109 offsetof(struct toBeSigned, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700110 .tag2el = asn_MAP_toBeSigned_tag2el_2,
111 .tag2el_count = 3, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000112 0, 0, 0, /* Optional elements (not needed) */
Lev Walkindf2edbb2017-10-21 13:40:07 -0700113 -1, /* First extension addition */
Lev Walkin006de1c2004-08-20 13:37:45 +0000114};
Lev Walkind04430c2004-09-07 06:44:29 +0000115static /* Use -fall-defs-global to expose */
Lev Walkine0272aa2005-03-04 11:26:08 +0000116asn_TYPE_descriptor_t asn_DEF_toBeSigned_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000117 "toBeSigned",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000118 "toBeSigned",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800119 &asn_OP_SEQUENCE,
Lev Walkin59b176e2005-11-26 11:25:14 +0000120 asn_DEF_toBeSigned_tags_2,
121 sizeof(asn_DEF_toBeSigned_tags_2)
122 /sizeof(asn_DEF_toBeSigned_tags_2[0]), /* 1 */
123 asn_DEF_toBeSigned_tags_2, /* Same as above */
124 sizeof(asn_DEF_toBeSigned_tags_2)
125 /sizeof(asn_DEF_toBeSigned_tags_2[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700126 { 0, 0, SEQUENCE_constraint },
Lev Walkine0272aa2005-03-04 11:26:08 +0000127 asn_MBR_toBeSigned_2,
Lev Walkin006de1c2004-08-20 13:37:45 +0000128 3, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000129 &asn_SPC_toBeSigned_specs_2 /* Additional specs */
Lev Walkin006de1c2004-08-20 13:37:45 +0000130};
131
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800132asn_TYPE_member_t asn_MBR_SIGNED_15P0_1[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000133 { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, toBeSigned),
Lev Walkin006de1c2004-08-20 13:37:45 +0000134 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
135 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000136 .type = &asn_DEF_toBeSigned_2,
Lev Walkin67a30122017-08-10 05:48:54 -0700137 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700138 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700139 0, 0, /* No default value */
Lev Walkin006de1c2004-08-20 13:37:45 +0000140 .name = "toBeSigned"
141 },
Lev Walkina00d6b32006-03-21 03:40:38 +0000142 { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, algorithm),
Lev Walkin006de1c2004-08-20 13:37:45 +0000143 .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
144 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000145 .type = &asn_DEF_OBJECT_IDENTIFIER,
Lev Walkin67a30122017-08-10 05:48:54 -0700146 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700147 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700148 0, 0, /* No default value */
Lev Walkin006de1c2004-08-20 13:37:45 +0000149 .name = "algorithm"
150 },
Lev Walkina00d6b32006-03-21 03:40:38 +0000151 { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, signature),
Lev Walkin006de1c2004-08-20 13:37:45 +0000152 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
153 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000154 .type = &asn_DEF_BIT_STRING,
Lev Walkin67a30122017-08-10 05:48:54 -0700155 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700156 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_signature_constraint_1 },
Lev Walkin20696a42017-10-17 21:27:33 -0700157 0, 0, /* No default value */
Lev Walkin006de1c2004-08-20 13:37:45 +0000158 .name = "signature"
159 },
160};
Lev Walkina7591b52014-10-12 18:37:35 -0700161static const ber_tlv_tag_t asn_DEF_SIGNED_15P0_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000162 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
163};
Lev Walkina7591b52014-10-12 18:37:35 -0700164static const asn_TYPE_tag2member_t asn_MAP_SIGNED_15P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700165 { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 2, 0, 0 }, /* signature */
166 { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 1, 0, 0 }, /* algorithm */
167 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* toBeSigned */
Lev Walkin006de1c2004-08-20 13:37:45 +0000168};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800169asn_SEQUENCE_specifics_t asn_SPC_SIGNED_15P0_specs_1 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000170 sizeof(struct SIGNED_15P0),
171 offsetof(struct SIGNED_15P0, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700172 .tag2el = asn_MAP_SIGNED_15P0_tag2el_1,
173 .tag2el_count = 3, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000174 0, 0, 0, /* Optional elements (not needed) */
Lev Walkindf2edbb2017-10-21 13:40:07 -0700175 -1, /* First extension addition */
Lev Walkin006de1c2004-08-20 13:37:45 +0000176};
Lev Walkina00d6b32006-03-21 03:40:38 +0000177asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0 = {
178 "SIGNED",
179 "SIGNED",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800180 &asn_OP_SEQUENCE,
Lev Walkina00d6b32006-03-21 03:40:38 +0000181 asn_DEF_SIGNED_15P0_tags_1,
182 sizeof(asn_DEF_SIGNED_15P0_tags_1)
183 /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */
184 asn_DEF_SIGNED_15P0_tags_1, /* Same as above */
185 sizeof(asn_DEF_SIGNED_15P0_tags_1)
186 /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700187 { 0, 0, SEQUENCE_constraint },
Lev Walkina00d6b32006-03-21 03:40:38 +0000188 asn_MBR_SIGNED_15P0_1,
189 3, /* Elements count */
190 &asn_SPC_SIGNED_15P0_specs_1 /* Additional specs */
191};
192
193
194/*** <<< INCLUDES [Certificate] >>> ***/
195
Lev Walkin22b5ed42006-09-13 02:51:20 +0000196#include "SIGNED.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000197
198/*** <<< TYPE-DECLS [Certificate] >>> ***/
199
200typedef SIGNED_15P0_t Certificate_t;
201
202/*** <<< FUNC-DECLS [Certificate] >>> ***/
203
204extern asn_TYPE_descriptor_t asn_DEF_Certificate;
205asn_struct_free_f Certificate_free;
206asn_struct_print_f Certificate_print;
207asn_constr_check_f Certificate_constraint;
208ber_type_decoder_f Certificate_decode_ber;
209der_type_encoder_f Certificate_encode_der;
210xer_type_decoder_f Certificate_decode_xer;
211xer_type_encoder_f Certificate_encode_xer;
212
213/*** <<< CODE [Certificate] >>> ***/
214
Lev Walkina00d6b32006-03-21 03:40:38 +0000215/*
216 * This type is implemented using SIGNED_15P0,
217 * so here we adjust the DEF accordingly.
218 */
Lev Walkina00d6b32006-03-21 03:40:38 +0000219
220/*** <<< STAT-DEFS [Certificate] >>> ***/
221
Lev Walkina7591b52014-10-12 18:37:35 -0700222static const ber_tlv_tag_t asn_DEF_Certificate_tags_1[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000223 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
224};
225asn_TYPE_descriptor_t asn_DEF_Certificate = {
226 "Certificate",
227 "Certificate",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800228 &asn_OP_SEQUENCE,
Lev Walkin59b176e2005-11-26 11:25:14 +0000229 asn_DEF_Certificate_tags_1,
230 sizeof(asn_DEF_Certificate_tags_1)
231 /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */
232 asn_DEF_Certificate_tags_1, /* Same as above */
233 sizeof(asn_DEF_Certificate_tags_1)
234 /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700235 { 0, 0, SEQUENCE_constraint },
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800236 asn_MBR_SIGNED_15P0_1,
237 3, /* Elements count */
238 &asn_SPC_SIGNED_15P0_specs_1 /* Additional specs */
Lev Walkin006de1c2004-08-20 13:37:45 +0000239};
240
241
242/*** <<< INCLUDES [Name] >>> ***/
243
Lev Walkin006de1c2004-08-20 13:37:45 +0000244#include <asn_SEQUENCE_OF.h>
245#include <constr_SEQUENCE_OF.h>
246
Lev Walkinc8285712005-03-04 22:18:20 +0000247/*** <<< FWD-DECLS [Name] >>> ***/
Lev Walkin006de1c2004-08-20 13:37:45 +0000248
Lev Walkinbf56d542005-03-04 23:50:56 +0000249struct RelativeDistinguishedName;
Lev Walkin006de1c2004-08-20 13:37:45 +0000250
251/*** <<< TYPE-DECLS [Name] >>> ***/
252
Lev Walkin006de1c2004-08-20 13:37:45 +0000253typedef struct Name {
Lev Walkinc8285712005-03-04 22:18:20 +0000254 A_SEQUENCE_OF(struct RelativeDistinguishedName) list;
Lev Walkin006de1c2004-08-20 13:37:45 +0000255
256 /* Context for parsing across buffer boundaries */
Lev Walkindfae9752004-09-29 13:19:37 +0000257 asn_struct_ctx_t _asn_ctx;
Lev Walkin006de1c2004-08-20 13:37:45 +0000258} Name_t;
259
Lev Walkinc8285712005-03-04 22:18:20 +0000260/*** <<< FUNC-DECLS [Name] >>> ***/
261
262extern asn_TYPE_descriptor_t asn_DEF_Name;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800263extern asn_SET_OF_specifics_t asn_SPC_Name_specs_1;
264extern asn_TYPE_member_t asn_MBR_Name_1[1];
Lev Walkinc8285712005-03-04 22:18:20 +0000265
266/*** <<< POST-INCLUDE [Name] >>> ***/
267
Lev Walkin22b5ed42006-09-13 02:51:20 +0000268#include "RelativeDistinguishedName.h"
Lev Walkinc8285712005-03-04 22:18:20 +0000269
Lev Walkin006de1c2004-08-20 13:37:45 +0000270/*** <<< STAT-DEFS [Name] >>> ***/
271
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800272asn_TYPE_member_t asn_MBR_Name_1[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +0000273 { ATF_POINTER, 0, 0,
Lev Walkin006de1c2004-08-20 13:37:45 +0000274 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
275 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000276 .type = &asn_DEF_RelativeDistinguishedName,
Lev Walkin67a30122017-08-10 05:48:54 -0700277 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700278 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700279 0, 0, /* No default value */
Lev Walkin006de1c2004-08-20 13:37:45 +0000280 .name = ""
281 },
282};
Lev Walkina7591b52014-10-12 18:37:35 -0700283static const ber_tlv_tag_t asn_DEF_Name_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000284 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
285};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800286asn_SET_OF_specifics_t asn_SPC_Name_specs_1 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000287 sizeof(struct Name),
Lev Walkindfae9752004-09-29 13:19:37 +0000288 offsetof(struct Name, _asn_ctx),
Lev Walkina9cc46e2004-09-22 16:06:28 +0000289 0, /* XER encoding is XMLDelimitedItemList */
Lev Walkin006de1c2004-08-20 13:37:45 +0000290};
Lev Walkindfae9752004-09-29 13:19:37 +0000291asn_TYPE_descriptor_t asn_DEF_Name = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000292 "Name",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000293 "Name",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800294 &asn_OP_SEQUENCE_OF,
Lev Walkin59b176e2005-11-26 11:25:14 +0000295 asn_DEF_Name_tags_1,
296 sizeof(asn_DEF_Name_tags_1)
297 /sizeof(asn_DEF_Name_tags_1[0]), /* 1 */
298 asn_DEF_Name_tags_1, /* Same as above */
299 sizeof(asn_DEF_Name_tags_1)
300 /sizeof(asn_DEF_Name_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700301 { 0, 0, SEQUENCE_OF_constraint },
Lev Walkine0272aa2005-03-04 11:26:08 +0000302 asn_MBR_Name_1,
Lev Walkin006de1c2004-08-20 13:37:45 +0000303 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +0000304 &asn_SPC_Name_specs_1 /* Additional specs */
Lev Walkin006de1c2004-08-20 13:37:45 +0000305};
306
307
308/*** <<< INCLUDES [RelativeDistinguishedName] >>> ***/
309
310#include <IA5String.h>
311#include <asn_SET_OF.h>
312#include <constr_SET_OF.h>
313
Lev Walkin006de1c2004-08-20 13:37:45 +0000314/*** <<< TYPE-DECLS [RelativeDistinguishedName] >>> ***/
315
Lev Walkin006de1c2004-08-20 13:37:45 +0000316typedef struct RelativeDistinguishedName {
317 A_SET_OF(IA5String_t) list;
318
319 /* Context for parsing across buffer boundaries */
Lev Walkindfae9752004-09-29 13:19:37 +0000320 asn_struct_ctx_t _asn_ctx;
Lev Walkin006de1c2004-08-20 13:37:45 +0000321} RelativeDistinguishedName_t;
322
Lev Walkinc8285712005-03-04 22:18:20 +0000323/*** <<< FUNC-DECLS [RelativeDistinguishedName] >>> ***/
324
325extern asn_TYPE_descriptor_t asn_DEF_RelativeDistinguishedName;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800326extern asn_SET_OF_specifics_t asn_SPC_RelativeDistinguishedName_specs_1;
327extern asn_TYPE_member_t asn_MBR_RelativeDistinguishedName_1[1];
Lev Walkinc8285712005-03-04 22:18:20 +0000328
Lev Walkin006de1c2004-08-20 13:37:45 +0000329/*** <<< CTABLES [RelativeDistinguishedName] >>> ***/
330
Lev Walkina7591b52014-10-12 18:37:35 -0700331static const int permitted_alphabet_table_2[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
333 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
334 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, /* ,-. */
335 4, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, /* 0 9 */
336 0, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20, /* ABCDEFGHIJKLMNO */
33721,22,23,24,25,26,27,28,29,30,31, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
338 0,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46, /* abcdefghijklmno */
33947,48,49,50,51,52,53,54,55,56,57, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin006de1c2004-08-20 13:37:45 +0000340};
341
Lev Walkine8318b82005-03-06 09:29:03 +0000342static int check_permitted_alphabet_2(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -0700343 const int *table = permitted_alphabet_table_2;
Lev Walkin006de1c2004-08-20 13:37:45 +0000344 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000345 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkina09e5da2004-08-22 03:19:00 +0000346 const uint8_t *ch = st->buf;
347 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000348
349 for(; ch < end; ch++) {
350 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000351 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000352 }
Lev Walkin775885e2004-08-22 12:47:03 +0000353 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000354}
355
356
357/*** <<< CODE [RelativeDistinguishedName] >>> ***/
358
359static int
Lev Walkin20696a42017-10-17 21:27:33 -0700360memb_IA5String_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000361 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000362 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000363
364 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700365 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000366 "%s: value not given (%s:%d)",
367 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000368 return -1;
369 }
370
371
Lev Walkine8318b82005-03-06 09:29:03 +0000372 if(!check_permitted_alphabet_2(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000373 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000374 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000375 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700376 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000377 "%s: constraint failed (%s:%d)",
378 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000379 return -1;
380 }
381}
382
383
384/*** <<< STAT-DEFS [RelativeDistinguishedName] >>> ***/
385
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800386asn_TYPE_member_t asn_MBR_RelativeDistinguishedName_1[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +0000387 { ATF_POINTER, 0, 0,
Lev Walkin006de1c2004-08-20 13:37:45 +0000388 .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
389 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000390 .type = &asn_DEF_IA5String,
Lev Walkin67a30122017-08-10 05:48:54 -0700391 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700392 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_IA5String_constraint_1 },
Lev Walkin20696a42017-10-17 21:27:33 -0700393 0, 0, /* No default value */
Lev Walkin006de1c2004-08-20 13:37:45 +0000394 .name = ""
395 },
396};
Lev Walkina7591b52014-10-12 18:37:35 -0700397static const ber_tlv_tag_t asn_DEF_RelativeDistinguishedName_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000398 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
399};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800400asn_SET_OF_specifics_t asn_SPC_RelativeDistinguishedName_specs_1 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000401 sizeof(struct RelativeDistinguishedName),
Lev Walkindfae9752004-09-29 13:19:37 +0000402 offsetof(struct RelativeDistinguishedName, _asn_ctx),
Lev Walkina9cc46e2004-09-22 16:06:28 +0000403 0, /* XER encoding is XMLDelimitedItemList */
Lev Walkin006de1c2004-08-20 13:37:45 +0000404};
Lev Walkindfae9752004-09-29 13:19:37 +0000405asn_TYPE_descriptor_t asn_DEF_RelativeDistinguishedName = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000406 "RelativeDistinguishedName",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000407 "RelativeDistinguishedName",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800408 &asn_OP_SET_OF,
Lev Walkin59b176e2005-11-26 11:25:14 +0000409 asn_DEF_RelativeDistinguishedName_tags_1,
410 sizeof(asn_DEF_RelativeDistinguishedName_tags_1)
411 /sizeof(asn_DEF_RelativeDistinguishedName_tags_1[0]), /* 1 */
412 asn_DEF_RelativeDistinguishedName_tags_1, /* Same as above */
413 sizeof(asn_DEF_RelativeDistinguishedName_tags_1)
414 /sizeof(asn_DEF_RelativeDistinguishedName_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700415 { 0, 0, SET_OF_constraint },
Lev Walkine0272aa2005-03-04 11:26:08 +0000416 asn_MBR_RelativeDistinguishedName_1,
Lev Walkin006de1c2004-08-20 13:37:45 +0000417 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +0000418 &asn_SPC_RelativeDistinguishedName_specs_1 /* Additional specs */
Lev Walkin006de1c2004-08-20 13:37:45 +0000419};
420