Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 2 | /*** <<< INCLUDES [SIGNED] >>> ***/ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 3 | |
| 4 | #include <OBJECT_IDENTIFIER.h> |
| 5 | #include <BIT_STRING.h> |
| 6 | #include <INTEGER.h> |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 7 | #include "Name.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 8 | #include <constr_SEQUENCE.h> |
| 9 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 10 | /*** <<< TYPE-DECLS [SIGNED] >>> ***/ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 11 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 12 | typedef struct SIGNED_15P0 { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 13 | struct toBeSigned { |
| 14 | INTEGER_t version; |
| 15 | OBJECT_IDENTIFIER_t signature; |
| 16 | Name_t issuer; |
| 17 | |
| 18 | /* Context for parsing across buffer boundaries */ |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 19 | asn_struct_ctx_t _asn_ctx; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 20 | } toBeSigned; |
| 21 | OBJECT_IDENTIFIER_t algorithm; |
| 22 | BIT_STRING_t signature; |
| 23 | |
| 24 | /* Context for parsing across buffer boundaries */ |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 25 | asn_struct_ctx_t _asn_ctx; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 26 | } SIGNED_15P0_t; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 27 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 28 | /*** <<< FUNC-DECLS [SIGNED] >>> ***/ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 29 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 30 | extern asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0; |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 31 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 32 | /*** <<< CODE [SIGNED] >>> ***/ |
Lev Walkin | daa7d2b | 2004-09-05 10:37:18 +0000 | [diff] [blame] | 33 | |
| 34 | static int |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 35 | memb_signature_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 36 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 37 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
Lev Walkin | daa7d2b | 2004-09-05 10:37:18 +0000 | [diff] [blame] | 38 | size_t size; |
| 39 | |
| 40 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 41 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | daa7d2b | 2004-09-05 10:37:18 +0000 | [diff] [blame] | 42 | "%s: value not given (%s:%d)", |
| 43 | td->name, __FILE__, __LINE__); |
| 44 | return -1; |
| 45 | } |
| 46 | |
| 47 | if(st->size > 0) { |
| 48 | /* Size in bits */ |
Lev Walkin | 1b1c5fc | 2006-09-08 19:38:11 +0000 | [diff] [blame] | 49 | size = 8 * st->size - (st->bits_unused & 0x07); |
Lev Walkin | daa7d2b | 2004-09-05 10:37:18 +0000 | [diff] [blame] | 50 | } else { |
| 51 | size = 0; |
| 52 | } |
| 53 | |
| 54 | if((size <= 256)) { |
| 55 | /* Constraint check succeeded */ |
| 56 | return 0; |
| 57 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 58 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | daa7d2b | 2004-09-05 10:37:18 +0000 | [diff] [blame] | 59 | "%s: constraint failed (%s:%d)", |
| 60 | td->name, __FILE__, __LINE__); |
| 61 | return -1; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 66 | /*** <<< STAT-DEFS [SIGNED] >>> ***/ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 67 | |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 68 | static asn_TYPE_member_t asn_MBR_toBeSigned_2[] = { |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 69 | { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, version), |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 70 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 71 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 72 | .type = &asn_DEF_INTEGER, |
Lev Walkin | ba58e1b | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 73 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 74 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 75 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 76 | .default_value = 0, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 77 | .name = "version" |
| 78 | }, |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 79 | { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, signature), |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 80 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), |
| 81 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 82 | .type = &asn_DEF_OBJECT_IDENTIFIER, |
Lev Walkin | ba58e1b | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 83 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 84 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 85 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 86 | .default_value = 0, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 87 | .name = "signature" |
| 88 | }, |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 89 | { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, issuer), |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 90 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 91 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 92 | .type = &asn_DEF_Name, |
Lev Walkin | ba58e1b | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 93 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 94 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 95 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 96 | .default_value = 0, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 97 | .name = "issuer" |
| 98 | }, |
| 99 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 100 | static const ber_tlv_tag_t asn_DEF_toBeSigned_tags_2[] = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 101 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 102 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 103 | static const asn_TYPE_tag2member_t asn_MAP_toBeSigned_tag2el_2[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 104 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* version */ |
| 105 | { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 1, 0, 0 }, /* signature */ |
| 106 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 0 } /* issuer */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 107 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 108 | static asn_SEQUENCE_specifics_t asn_SPC_toBeSigned_specs_2 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 109 | sizeof(struct toBeSigned), |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 110 | offsetof(struct toBeSigned, _asn_ctx), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 111 | asn_MAP_toBeSigned_tag2el_2, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 112 | 3, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 113 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 114 | -1, /* Start extensions */ |
| 115 | -1 /* Stop extensions */ |
| 116 | }; |
Lev Walkin | d04430c | 2004-09-07 06:44:29 +0000 | [diff] [blame] | 117 | static /* Use -fall-defs-global to expose */ |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 118 | asn_TYPE_descriptor_t asn_DEF_toBeSigned_2 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 119 | "toBeSigned", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 120 | "toBeSigned", |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 121 | SEQUENCE_free, |
| 122 | SEQUENCE_print, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 123 | SEQUENCE_constraint, |
| 124 | SEQUENCE_decode_ber, |
| 125 | SEQUENCE_encode_der, |
Lev Walkin | 61b40d8 | 2004-10-23 15:07:45 +0000 | [diff] [blame] | 126 | SEQUENCE_decode_xer, |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 127 | SEQUENCE_encode_xer, |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 128 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 129 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 130 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 131 | asn_DEF_toBeSigned_tags_2, |
| 132 | sizeof(asn_DEF_toBeSigned_tags_2) |
| 133 | /sizeof(asn_DEF_toBeSigned_tags_2[0]), /* 1 */ |
| 134 | asn_DEF_toBeSigned_tags_2, /* Same as above */ |
| 135 | sizeof(asn_DEF_toBeSigned_tags_2) |
| 136 | /sizeof(asn_DEF_toBeSigned_tags_2[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 137 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 138 | 0, /* No PER visible constraints */ |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 139 | asn_MBR_toBeSigned_2, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 140 | 3, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 141 | &asn_SPC_toBeSigned_specs_2 /* Additional specs */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 142 | }; |
| 143 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 144 | static asn_TYPE_member_t asn_MBR_SIGNED_15P0_1[] = { |
| 145 | { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, toBeSigned), |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 146 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 147 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 148 | .type = &asn_DEF_toBeSigned_2, |
Lev Walkin | ba58e1b | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 149 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 150 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 151 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 152 | .default_value = 0, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 153 | .name = "toBeSigned" |
| 154 | }, |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 155 | { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, algorithm), |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 156 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), |
| 157 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 158 | .type = &asn_DEF_OBJECT_IDENTIFIER, |
Lev Walkin | ba58e1b | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 159 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 160 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 161 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 162 | .default_value = 0, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 163 | .name = "algorithm" |
| 164 | }, |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 165 | { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, signature), |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 166 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), |
| 167 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 168 | .type = &asn_DEF_BIT_STRING, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 169 | .memb_constraints = memb_signature_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 170 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 171 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 172 | .default_value = 0, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 173 | .name = "signature" |
| 174 | }, |
| 175 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 176 | static const ber_tlv_tag_t asn_DEF_SIGNED_15P0_tags_1[] = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 177 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 178 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 179 | static const asn_TYPE_tag2member_t asn_MAP_SIGNED_15P0_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 180 | { (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 Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 183 | }; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 184 | static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_15P0_specs_1 = { |
| 185 | sizeof(struct SIGNED_15P0), |
| 186 | offsetof(struct SIGNED_15P0, _asn_ctx), |
| 187 | asn_MAP_SIGNED_15P0_tag2el_1, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 188 | 3, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 189 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 190 | -1, /* Start extensions */ |
| 191 | -1 /* Stop extensions */ |
| 192 | }; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 193 | asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0 = { |
| 194 | "SIGNED", |
| 195 | "SIGNED", |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 196 | SEQUENCE_free, |
| 197 | SEQUENCE_print, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 198 | SEQUENCE_constraint, |
| 199 | SEQUENCE_decode_ber, |
| 200 | SEQUENCE_encode_der, |
Lev Walkin | 61b40d8 | 2004-10-23 15:07:45 +0000 | [diff] [blame] | 201 | SEQUENCE_decode_xer, |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 202 | SEQUENCE_encode_xer, |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 203 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 204 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 205 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 206 | asn_DEF_SIGNED_15P0_tags_1, |
| 207 | sizeof(asn_DEF_SIGNED_15P0_tags_1) |
| 208 | /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */ |
| 209 | asn_DEF_SIGNED_15P0_tags_1, /* Same as above */ |
| 210 | sizeof(asn_DEF_SIGNED_15P0_tags_1) |
| 211 | /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 212 | 0, /* No OER visible constraints */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 213 | 0, /* No PER visible constraints */ |
| 214 | asn_MBR_SIGNED_15P0_1, |
| 215 | 3, /* Elements count */ |
| 216 | &asn_SPC_SIGNED_15P0_specs_1 /* Additional specs */ |
| 217 | }; |
| 218 | |
| 219 | |
| 220 | /*** <<< INCLUDES [Certificate] >>> ***/ |
| 221 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 222 | #include "SIGNED.h" |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 223 | |
| 224 | /*** <<< TYPE-DECLS [Certificate] >>> ***/ |
| 225 | |
| 226 | typedef SIGNED_15P0_t Certificate_t; |
| 227 | |
| 228 | /*** <<< FUNC-DECLS [Certificate] >>> ***/ |
| 229 | |
| 230 | extern asn_TYPE_descriptor_t asn_DEF_Certificate; |
| 231 | asn_struct_free_f Certificate_free; |
| 232 | asn_struct_print_f Certificate_print; |
| 233 | asn_constr_check_f Certificate_constraint; |
| 234 | ber_type_decoder_f Certificate_decode_ber; |
| 235 | der_type_encoder_f Certificate_encode_der; |
| 236 | xer_type_decoder_f Certificate_decode_xer; |
| 237 | xer_type_encoder_f Certificate_encode_xer; |
| 238 | |
| 239 | /*** <<< CODE [Certificate] >>> ***/ |
| 240 | |
| 241 | int |
| 242 | Certificate_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 243 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 244 | /* Replace with underlying type checker */ |
| 245 | td->check_constraints = asn_DEF_SIGNED_15P0.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 246 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | /* |
| 250 | * This type is implemented using SIGNED_15P0, |
| 251 | * so here we adjust the DEF accordingly. |
| 252 | */ |
| 253 | static void |
| 254 | Certificate_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 255 | td->free_struct = asn_DEF_SIGNED_15P0.free_struct; |
| 256 | td->print_struct = asn_DEF_SIGNED_15P0.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 257 | td->check_constraints = asn_DEF_SIGNED_15P0.check_constraints; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 258 | td->ber_decoder = asn_DEF_SIGNED_15P0.ber_decoder; |
| 259 | td->der_encoder = asn_DEF_SIGNED_15P0.der_encoder; |
| 260 | td->xer_decoder = asn_DEF_SIGNED_15P0.xer_decoder; |
| 261 | td->xer_encoder = asn_DEF_SIGNED_15P0.xer_encoder; |
| 262 | td->uper_decoder = asn_DEF_SIGNED_15P0.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 263 | td->uper_encoder = asn_DEF_SIGNED_15P0.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 264 | td->oer_decoder = asn_DEF_SIGNED_15P0.oer_decoder; |
| 265 | td->oer_encoder = asn_DEF_SIGNED_15P0.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 266 | if(!td->oer_constraints) |
| 267 | td->oer_constraints = asn_DEF_SIGNED_15P0.oer_constraints; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 268 | if(!td->per_constraints) |
| 269 | td->per_constraints = asn_DEF_SIGNED_15P0.per_constraints; |
| 270 | td->elements = asn_DEF_SIGNED_15P0.elements; |
| 271 | td->elements_count = asn_DEF_SIGNED_15P0.elements_count; |
| 272 | td->specifics = asn_DEF_SIGNED_15P0.specifics; |
| 273 | } |
| 274 | |
| 275 | void |
| 276 | Certificate_free(asn_TYPE_descriptor_t *td, |
| 277 | void *struct_ptr, int contents_only) { |
| 278 | Certificate_1_inherit_TYPE_descriptor(td); |
| 279 | td->free_struct(td, struct_ptr, contents_only); |
| 280 | } |
| 281 | |
| 282 | int |
| 283 | Certificate_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 284 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 285 | Certificate_1_inherit_TYPE_descriptor(td); |
| 286 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 287 | } |
| 288 | |
| 289 | asn_dec_rval_t |
| 290 | Certificate_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 291 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 292 | Certificate_1_inherit_TYPE_descriptor(td); |
| 293 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 294 | } |
| 295 | |
| 296 | asn_enc_rval_t |
| 297 | Certificate_encode_der(asn_TYPE_descriptor_t *td, |
| 298 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 299 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 300 | Certificate_1_inherit_TYPE_descriptor(td); |
| 301 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 302 | } |
| 303 | |
| 304 | asn_dec_rval_t |
| 305 | Certificate_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 306 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 307 | Certificate_1_inherit_TYPE_descriptor(td); |
| 308 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 309 | } |
| 310 | |
| 311 | asn_enc_rval_t |
| 312 | Certificate_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 313 | int ilevel, enum xer_encoder_flags_e flags, |
| 314 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 315 | Certificate_1_inherit_TYPE_descriptor(td); |
| 316 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 317 | } |
| 318 | |
| 319 | |
| 320 | /*** <<< STAT-DEFS [Certificate] >>> ***/ |
| 321 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 322 | static const ber_tlv_tag_t asn_DEF_Certificate_tags_1[] = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 323 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 324 | }; |
| 325 | asn_TYPE_descriptor_t asn_DEF_Certificate = { |
| 326 | "Certificate", |
| 327 | "Certificate", |
| 328 | Certificate_free, |
| 329 | Certificate_print, |
| 330 | Certificate_constraint, |
| 331 | Certificate_decode_ber, |
| 332 | Certificate_encode_der, |
| 333 | Certificate_decode_xer, |
| 334 | Certificate_encode_xer, |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 335 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 336 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 337 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 338 | asn_DEF_Certificate_tags_1, |
| 339 | sizeof(asn_DEF_Certificate_tags_1) |
| 340 | /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */ |
| 341 | asn_DEF_Certificate_tags_1, /* Same as above */ |
| 342 | sizeof(asn_DEF_Certificate_tags_1) |
| 343 | /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 344 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 345 | 0, /* No PER visible constraints */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 346 | 0, 0, /* Defined elsewhere */ |
| 347 | 0 /* No specifics */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 348 | }; |
| 349 | |
| 350 | |
| 351 | /*** <<< INCLUDES [Name] >>> ***/ |
| 352 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 353 | #include <asn_SEQUENCE_OF.h> |
| 354 | #include <constr_SEQUENCE_OF.h> |
| 355 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 356 | /*** <<< FWD-DECLS [Name] >>> ***/ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 357 | |
Lev Walkin | bf56d54 | 2005-03-04 23:50:56 +0000 | [diff] [blame] | 358 | struct RelativeDistinguishedName; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 359 | |
| 360 | /*** <<< TYPE-DECLS [Name] >>> ***/ |
| 361 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 362 | typedef struct Name { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 363 | A_SEQUENCE_OF(struct RelativeDistinguishedName) list; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 364 | |
| 365 | /* Context for parsing across buffer boundaries */ |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 366 | asn_struct_ctx_t _asn_ctx; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 367 | } Name_t; |
| 368 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 369 | /*** <<< FUNC-DECLS [Name] >>> ***/ |
| 370 | |
| 371 | extern asn_TYPE_descriptor_t asn_DEF_Name; |
| 372 | |
| 373 | /*** <<< POST-INCLUDE [Name] >>> ***/ |
| 374 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 375 | #include "RelativeDistinguishedName.h" |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 376 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 377 | /*** <<< STAT-DEFS [Name] >>> ***/ |
| 378 | |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 379 | static asn_TYPE_member_t asn_MBR_Name_1[] = { |
Lev Walkin | 8eb4b57 | 2005-08-16 16:57:17 +0000 | [diff] [blame] | 380 | { ATF_POINTER, 0, 0, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 381 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 382 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 383 | .type = &asn_DEF_RelativeDistinguishedName, |
Lev Walkin | ba58e1b | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 384 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 385 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 386 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 387 | .default_value = 0, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 388 | .name = "" |
| 389 | }, |
| 390 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 391 | static const ber_tlv_tag_t asn_DEF_Name_tags_1[] = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 392 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 393 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 394 | static asn_SET_OF_specifics_t asn_SPC_Name_specs_1 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 395 | sizeof(struct Name), |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 396 | offsetof(struct Name, _asn_ctx), |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 397 | 0, /* XER encoding is XMLDelimitedItemList */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 398 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 399 | asn_TYPE_descriptor_t asn_DEF_Name = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 400 | "Name", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 401 | "Name", |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 402 | SEQUENCE_OF_free, |
| 403 | SEQUENCE_OF_print, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 404 | SEQUENCE_OF_constraint, |
| 405 | SEQUENCE_OF_decode_ber, |
| 406 | SEQUENCE_OF_encode_der, |
Lev Walkin | b223080 | 2005-02-14 20:31:31 +0000 | [diff] [blame] | 407 | SEQUENCE_OF_decode_xer, |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 408 | SEQUENCE_OF_encode_xer, |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 409 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 410 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 411 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 412 | asn_DEF_Name_tags_1, |
| 413 | sizeof(asn_DEF_Name_tags_1) |
| 414 | /sizeof(asn_DEF_Name_tags_1[0]), /* 1 */ |
| 415 | asn_DEF_Name_tags_1, /* Same as above */ |
| 416 | sizeof(asn_DEF_Name_tags_1) |
| 417 | /sizeof(asn_DEF_Name_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 418 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 419 | 0, /* No PER visible constraints */ |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 420 | asn_MBR_Name_1, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 421 | 1, /* Single element */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 422 | &asn_SPC_Name_specs_1 /* Additional specs */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 423 | }; |
| 424 | |
| 425 | |
| 426 | /*** <<< INCLUDES [RelativeDistinguishedName] >>> ***/ |
| 427 | |
| 428 | #include <IA5String.h> |
| 429 | #include <asn_SET_OF.h> |
| 430 | #include <constr_SET_OF.h> |
| 431 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 432 | /*** <<< TYPE-DECLS [RelativeDistinguishedName] >>> ***/ |
| 433 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 434 | typedef struct RelativeDistinguishedName { |
| 435 | A_SET_OF(IA5String_t) list; |
| 436 | |
| 437 | /* Context for parsing across buffer boundaries */ |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 438 | asn_struct_ctx_t _asn_ctx; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 439 | } RelativeDistinguishedName_t; |
| 440 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 441 | /*** <<< FUNC-DECLS [RelativeDistinguishedName] >>> ***/ |
| 442 | |
| 443 | extern asn_TYPE_descriptor_t asn_DEF_RelativeDistinguishedName; |
| 444 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 445 | /*** <<< CTABLES [RelativeDistinguishedName] >>> ***/ |
| 446 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 447 | static const int permitted_alphabet_table_2[256] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 448 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 449 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 450 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, /* ,-. */ |
| 451 | 4, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, /* 0 9 */ |
| 452 | 0, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20, /* ABCDEFGHIJKLMNO */ |
| 453 | 21,22,23,24,25,26,27,28,29,30,31, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */ |
| 454 | 0,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46, /* abcdefghijklmno */ |
| 455 | 47,48,49,50,51,52,53,54,55,56,57, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 456 | }; |
| 457 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 458 | static int check_permitted_alphabet_2(const void *sptr) { |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 459 | const int *table = permitted_alphabet_table_2; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 460 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 461 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | a09e5da | 2004-08-22 03:19:00 +0000 | [diff] [blame] | 462 | const uint8_t *ch = st->buf; |
| 463 | const uint8_t *end = ch + st->size; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 464 | |
| 465 | for(; ch < end; ch++) { |
| 466 | uint8_t cv = *ch; |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 467 | if(!table[cv]) return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 468 | } |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 469 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 470 | } |
| 471 | |
| 472 | |
| 473 | /*** <<< CODE [RelativeDistinguishedName] >>> ***/ |
| 474 | |
| 475 | static int |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 476 | memb_IA5String_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 477 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 478 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 479 | |
| 480 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 481 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 482 | "%s: value not given (%s:%d)", |
| 483 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 484 | return -1; |
| 485 | } |
| 486 | |
| 487 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 488 | if(!check_permitted_alphabet_2(st)) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 489 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 490 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 491 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 492 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 493 | "%s: constraint failed (%s:%d)", |
| 494 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 495 | return -1; |
| 496 | } |
| 497 | } |
| 498 | |
| 499 | |
| 500 | /*** <<< STAT-DEFS [RelativeDistinguishedName] >>> ***/ |
| 501 | |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 502 | static asn_TYPE_member_t asn_MBR_RelativeDistinguishedName_1[] = { |
Lev Walkin | 8eb4b57 | 2005-08-16 16:57:17 +0000 | [diff] [blame] | 503 | { ATF_POINTER, 0, 0, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 504 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), |
| 505 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 506 | .type = &asn_DEF_IA5String, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 507 | .memb_constraints = memb_IA5String_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 508 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 509 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 510 | .default_value = 0, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 511 | .name = "" |
| 512 | }, |
| 513 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 514 | static const ber_tlv_tag_t asn_DEF_RelativeDistinguishedName_tags_1[] = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 515 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 516 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 517 | static asn_SET_OF_specifics_t asn_SPC_RelativeDistinguishedName_specs_1 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 518 | sizeof(struct RelativeDistinguishedName), |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 519 | offsetof(struct RelativeDistinguishedName, _asn_ctx), |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 520 | 0, /* XER encoding is XMLDelimitedItemList */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 521 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 522 | asn_TYPE_descriptor_t asn_DEF_RelativeDistinguishedName = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 523 | "RelativeDistinguishedName", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 524 | "RelativeDistinguishedName", |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 525 | SET_OF_free, |
| 526 | SET_OF_print, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 527 | SET_OF_constraint, |
| 528 | SET_OF_decode_ber, |
| 529 | SET_OF_encode_der, |
Lev Walkin | b223080 | 2005-02-14 20:31:31 +0000 | [diff] [blame] | 530 | SET_OF_decode_xer, |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 531 | SET_OF_encode_xer, |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 532 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 533 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 534 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 535 | asn_DEF_RelativeDistinguishedName_tags_1, |
| 536 | sizeof(asn_DEF_RelativeDistinguishedName_tags_1) |
| 537 | /sizeof(asn_DEF_RelativeDistinguishedName_tags_1[0]), /* 1 */ |
| 538 | asn_DEF_RelativeDistinguishedName_tags_1, /* Same as above */ |
| 539 | sizeof(asn_DEF_RelativeDistinguishedName_tags_1) |
| 540 | /sizeof(asn_DEF_RelativeDistinguishedName_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 541 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 542 | 0, /* No PER visible constraints */ |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 543 | asn_MBR_RelativeDistinguishedName_1, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 544 | 1, /* Single element */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 545 | &asn_SPC_RelativeDistinguishedName_specs_1 /* Additional specs */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 546 | }; |
| 547 | |