ab4b47a1473f40d34b40b31152da0d7284e3b2bf
[metze/wireshark/wip.git] / asn1 / x509if / x509if.cnf
1 # x509if.cnf
2 # X509IF conformation file
3
4 #.IMPORT ../x509sat/x509sat-exp.cnf
5
6 #.MODULE_IMPORT
7 DirectoryAbstractService  dap
8
9 #.OMIT_ASSIGNMENT
10 ObjectClassKind
11 #.END
12 #.CLASS ATTRIBUTE
13 &derivation            ClassReference ATTRIBUTE
14 &Type
15 &equality-match        ClassReference MATCHING-RULE
16 &ordering-match        ClassReference MATCHING-RULE
17 &substrings-match      ClassReference MATCHING-RULE
18 &single-valued         BooleanType
19 &collective            BooleanType
20 &no-user-modification  BooleanType
21 &usage                 TypeReference AttributeUsage
22 &id                    ObjectIdentifierType
23 #.END
24 #.CLASS CONTEXT
25 &Type
26 &Assertion
27 &id         ObjectIdentifierType
28 #.END
29 #.CLASS OBJECT-CLASS
30 &Superclasses         ClassReference OBJECT-CLASS
31 &kind                 TypeReference ObjectClassKind
32 &MandatoryAttributes  ClassReference ATTRIBUTE
33 &OptionalAttributes   ClassReference ATTRIBUTE
34 &id                   ObjectIdentifierType
35 #.END
36
37 #.CLASS MATCHING-RESTRICTION
38 &Restriction
39 &Rules        _FixedTypeValueSetFieldSpec
40 &id           ObjectIdentifierType
41 #.END
42
43 #.CLASS MATCHING-RULE
44 &ParentMatchingRules   ClassReference MATCHING-RULE
45 &AssertionType
46 &uniqueMatchIndicator  ClassReference ATTRIBUTE
47 &id                    ObjectIdentifierType
48 #.END
49
50 #.EXPORTS
51 OBJECT-CLASS
52 ATTRIBUTE
53 MATCHING-RULE
54 MAPPING-BASED-MATCHING
55 NAME-FORM
56 STRUCTURE-RULE
57 CONTENT-RULE
58 CONTEXT
59 SEARCH-RULE
60 MATCHING-RESTRICTION
61 AllowedSubset
62 Attribute
63 AttributeCombination
64 AttributeType
65 AttributeTypeAndDistinguishedValue
66 AttributeTypeAssertion
67 AttributeUsage
68 AttributeValue
69 AttributeValueAssertion
70 #BaseDistance
71 ChopSpecification
72 Context
73 ContextAssertion
74 ContextCombination
75 ContextProfile
76 ControlOptions
77 DistinguishedName
78 DITContentRule
79 DITContextUse
80 DITStructureRule
81 EntryLimit
82 ImposedSubset
83 LocalName
84 Mapping
85 MatchingUse
86 MRMapping
87 MRSubstitution
88 Name
89 Refinement
90 RelativeDistinguishedName
91 RelaxationPolicy
92 RDNSequence
93 RequestAttribute
94 ResultAttribute
95 RuleIdentifier
96 SearchRule
97 SearchRuleDescription
98 SearchRuleId
99 SubtreeSpecification
100
101 #.PDU
102 DistinguishedName
103
104 #.NO_EMIT
105
106 #.TYPE_RENAME
107 AttributeTypeAndDistinguishedValue/valuesWithContext    T_valWithContext
108 AttributeTypeAndDistinguishedValue/valuesWithContext/_item      T_valWithContext_item
109 ChopSpecification/specificExclusions                    T_chopSpecificExclusions
110 ChopSpecification/specificExclusions/_item              T_chopSpecificExclusions_item
111
112 #.FIELD_RENAME
113 AttributeTypeAssertion/assertedContexts         ata_assertedContexts
114 AttributeTypeAndDistinguishedValue/value                atadv_value
115 AttributeTypeAndDistinguishedValue/valuesWithContext    valueswithContext
116 AttributeTypeAndDistinguishedValue/valuesWithContext/_item      valueswithContext_item
117 ChopSpecification/specificExclusions                    chopSpecificExclusions
118 ChopSpecification/specificExclusions/_item              chopSpecificExclusions_item
119 Refinement/and                  refinement_and
120 Refinement/and/_item            refinement_and_item
121 Refinement/not                  refinement_not
122 Refinement/or                   refinement_or
123 Refinement/or/_item             refinement_or_item
124 ContextAssertion/contextType            ca_contextType
125 ContextAssertion/contextValues          ca_contextValues
126 ContextAssertion/contextValues/_item    ca_contextValues_item
127 ContextCombination/not          contextcombination_not
128 ContextCombination/and          contextcombination_and
129 ContextCombination/and/_item    contextcombination_and_item
130 ContextCombination/or           contextcombination_or
131 ContextCombination/or/_item     contextcombination_or_item
132 RelaxationPolicy/maximum        maximum_relaxation
133 RelaxationPolicy/minimum        minimum_relaxation
134 RequestAttribute/defaultValues/_item/values             ra_values
135 RequestAttribute/defaultValues/_item/values/_item       ra_values_item
136 RequestAttribute/selectedValues                         ra_selectedValues
137 RequestAttribute/selectedValues/_item                   ra_selectedValues_item
138
139 #.REGISTER
140 DistinguishedName       B       "2.5.4.1"       "id-at-aliasedEntryName"
141 DistinguishedName       B       "2.5.4.31"      "id-at-member"
142 DistinguishedName       B       "2.5.4.32"      "id-at-owner"
143 DistinguishedName       B       "2.5.4.33"      "id-at-roleOccupant"
144 DistinguishedName       B       "2.5.4.34"      "id-at-seeAlso"
145 DistinguishedName       B       "2.5.4.49"      "id-at-distinguishedName"
146
147 DistinguishedName       B       "2.5.18.3"      "id-oa-creatorsName"
148 DistinguishedName       B       "2.5.18.4"      "id-oa-modifiersName"
149 SubtreeSpecification    B       "2.5.18.6"      "id-oa-subtreeSpecification"
150 DistinguishedName       B       "2.5.18.10"     "id-oa-subschemaSubentry"
151 DistinguishedName       B       "2.5.18.11"     "id-oa-accessControlSubentry"
152 DistinguishedName       B       "2.5.18.12"     "id-oa-collectiveAttributeSubentry"
153 DistinguishedName       B       "2.5.18.13"     "id-oa-contextDefaultSubentry"
154 HierarchyLevel          B       "2.5.18.17"     "id-oa-hierarchyLevel"
155 HierarchyBelow          B       "2.5.18.18"     "iid-oa-hierarchyBelow"
156 # X402 - see master list in acp133.cnf
157 DistinguishedName B "2.6.5.2.5" "id-at-mhs-message-store-dn"
158 DistinguishedName B "2.6.5.2.14" "id-at-mhs-dl-related-lists"
159
160 # ACP133 - see master list in acp133.cnf
161 DistinguishedName B "2.16.840.1.101.2.2.1.3" "id-at-alternateRecipient"
162 DistinguishedName B "2.16.840.1.101.2.2.1.4" "id-at-associatedOrganization"
163 DistinguishedName B "2.16.840.1.101.2.2.1.6" "id-at-associatedPLA"
164 DistinguishedName B "2.16.840.1.101.2.2.1.49" "id-at-aliasPointer"
165 DistinguishedName B "2.16.840.1.101.2.2.1.61" "id-at-listPointer"
166 DistinguishedName B "2.16.840.1.101.2.2.1.110" "id-at-administrator"
167 DistinguishedName B "2.16.840.1.101.2.2.1.111" "id-at-aigsExpanded"
168 DistinguishedName B "2.16.840.1.101.2.2.1.113" "id-at-associatedAL"
169 DistinguishedName B "2.16.840.1.101.2.2.1.114" "id-at-copyMember"
170 DistinguishedName B "2.16.840.1.101.2.2.1.117" "id-at-guard"
171 DistinguishedName B "2.16.840.1.101.2.2.1.121" "id-at-networkDN"
172 DistinguishedName B "2.16.840.1.101.2.2.1.138" "id-at-plasServed"
173 DistinguishedName B "2.16.840.1.101.2.2.1.139" "id-at-deployed"
174 DistinguishedName B "2.16.840.1.101.2.2.1.140" "id-at-garrison"
175 DistinguishedName B "2.16.840.1.101.2.2.1.184" "id-at-aCPDutyOfficer"
176 DistinguishedName B "2.16.840.1.101.2.2.1.188" "id-at-primaryMember"
177
178
179
180 #.FN_PARS ContextAssertion/contextType
181   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
182
183 #.FN_BODY ContextAssertion/contextValues/_item
184   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
185
186 #.FN_PARS AttributeTypeAndDistinguishedValue/type
187   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
188
189 #.FN_BODY AttributeTypeAndDistinguishedValue/type
190   const char *fmt;
191   const char *name;
192
193   %(DEFAULT_BODY)s
194
195   if(actx->external.direct_reference) {
196     /* see if we can find a nice name */
197     name = oid_resolved_from_string(actx->external.direct_reference);
198     if(!name) name = actx->external.direct_reference;
199
200     if(last_rdn) { /* append it to the RDN */
201       g_strlcat(last_rdn, name, MAX_RDN_STR_LEN);
202       g_strlcat(last_rdn, "=", MAX_RDN_STR_LEN);
203
204      /* append it to the tree */
205      proto_item_append_text(tree, " (%%s=", name);
206     } else if(doing_attr) {
207       /* append it to the parent item */
208       proto_item_append_text(tree, " (%%s)", name);
209     }
210
211     if((fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
212       /* we have a format */
213       last_ava = (char *)wmem_alloc(wmem_packet_scope(), MAX_AVA_STR_LEN); *last_ava = '\0';
214       register_frame_end_routine (actx->pinfo, x509if_frame_end);
215
216       g_snprintf(last_ava, MAX_AVA_STR_LEN, "%%s %%s", name, fmt);
217
218       proto_item_append_text(tree, " %%s", last_ava);
219
220     }
221   }
222
223 #.FN_BODY AttributeTypeAndDistinguishedValue/value
224   int old_offset = offset;
225   tvbuff_t      *out_tvb;
226   char          *value = NULL;
227   const char    *fmt;
228   const char    *name = NULL;
229   const char    *orig_oid = actx->external.direct_reference;
230
231   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
232
233   /* in dissecting the value we may have overridden the OID of the value - which is
234      a problem if there are multiple values */
235   actx->external.direct_reference = orig_oid;
236
237   /* try and dissect as a string */
238   dissect_ber_octet_string(FALSE, actx, NULL, tvb, old_offset, hf_x509if_any_string, &out_tvb);
239
240   /* should also try and dissect as an OID and integer */
241   /* of course, if I can look up the syntax .... */
242
243   if(out_tvb) {
244     /* it was a string - format it */
245     value = tvb_format_text(out_tvb, 0, tvb_length(out_tvb));
246
247     if(last_rdn) {
248       g_strlcat(last_rdn, value, MAX_RDN_STR_LEN);
249
250       /* append it to the tree*/
251       proto_item_append_text(tree, "%%s)", value);
252     }
253
254     if((fmt = val_to_str(ava_hf_index, fmt_vals, "")) && *fmt) {
255       /* we have a format */
256
257       if (!last_ava) {
258         last_ava = (char *)wmem_alloc(wmem_packet_scope(), MAX_AVA_STR_LEN);
259       }
260
261       if(!(name = oid_resolved_from_string(actx->external.direct_reference)))
262         name = actx->external.direct_reference;
263       g_snprintf(last_ava, MAX_AVA_STR_LEN, "%%s %%s %%s", name, fmt, value);
264
265       proto_item_append_text(tree, " %%s", last_ava);
266
267     }
268   }
269
270 #.FN_PARS RequestAttribute/attributeType
271   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
272
273 #.FN_BODY RequestAttribute/selectedValues/_item
274   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
275
276 #.FN_PARS RequestAttribute/defaultValues/_item/entryType
277   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
278
279 #.FN_BODY RequestAttribute/defaultValues/_item/values/_item
280   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
281
282 #.FN_BODY Attribute/valuesWithContext/_item/value
283   offset=call_ber_oid_callback("unknown", tvb, offset, actx->pinfo, tree, NULL);
284
285 #.FN_PARS ResultAttribute/attributeType
286   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
287
288 #.FN_BODY ResultAttribute/outputValues/selectedValues/_item
289   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
290
291 #.FN_PARS Context/contextType
292   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
293
294 #.FN_BODY Context/contextValues/_item
295   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
296
297 #.FN_PARS AttributeType
298   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
299
300 #.FN_BODY AttributeValue
301   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
302
303 #.FN_PARS AttributeValueAssertion/type
304   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
305
306 #.FN_BODY AttributeValueAssertion/assertion
307   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
308
309 #.FN_PARS Attribute/type
310   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
311
312 #.FN_BODY Attribute/values/_item
313   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
314
315 #.FN_PARS ContextProfile/contextType
316   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
317
318 #.FN_BODY ContextProfile/contextValue/_item
319   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
320
321 #.FN_PARS MatchingUse/restrictionType
322   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &actx->external.direct_reference
323
324 #.FN_BODY MatchingUse/restrictionValue
325   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
326
327 #.FN_BODY AttributeTypeAndDistinguishedValue/valuesWithContext/_item/distingAttrValue
328   offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
329
330 #.FN_BODY RelativeDistinguishedName
331   char *temp_dn;
332
333   rdn_one_value = FALSE;
334   top_of_rdn = tree;
335   last_rdn = (char *)wmem_alloc(wmem_packet_scope(), MAX_DN_STR_LEN); *last_rdn = '\0';
336   register_frame_end_routine (actx->pinfo, x509if_frame_end);
337
338   %(DEFAULT_BODY)s
339
340   /* we've finished - close the bracket */
341   proto_item_append_text(top_of_rdn, " (%%s)", last_rdn);
342
343   /* now append this to the DN */
344   if (last_dn) {
345     if(*last_dn) {
346       temp_dn = (char *)wmem_alloc(wmem_packet_scope(), MAX_DN_STR_LEN); /* is there a better way to use ep_alloc here ? */
347       g_snprintf(temp_dn, MAX_DN_STR_LEN, "%%s,%%s", last_rdn, last_dn);
348       last_dn[0] = '\0';
349       g_strlcat(last_dn, temp_dn, MAX_DN_STR_LEN);
350     } else {
351       g_strlcat(last_dn, last_rdn, MAX_DN_STR_LEN);
352     }
353   }
354
355   last_rdn = NULL; /* it will get freed when the next packet is dissected */
356
357 #.FN_BODY RelativeDistinguishedName/_item
358
359   if(!rdn_one_value) {
360     top_of_rdn = tree;
361   } else {
362
363    if(last_rdn)
364      /* this is an additional value - delimit */
365      g_strlcat(last_rdn, "+", MAX_RDN_STR_LEN);
366   }
367
368   %(DEFAULT_BODY)s
369
370   rdn_one_value = TRUE;
371
372 #.FN_BODY RDNSequence
373   const char *fmt;
374
375   dn_one_rdn = FALSE; /* reset */
376   last_dn = (char *)wmem_alloc(wmem_packet_scope(), MAX_DN_STR_LEN); *last_dn = '\0';
377   top_of_dn = NULL;
378   register_frame_end_routine (actx->pinfo, x509if_frame_end);
379
380
381   %(DEFAULT_BODY)s
382
383   /* we've finished - append the dn */
384   proto_item_append_text(top_of_dn, " (%%s)", last_dn);
385
386  /* see if we should append this to the col info */
387   if((fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
388       /* we have a format */
389         col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s%%s", fmt, last_dn);
390   }
391
392
393 #.FN_BODY RDNSequence/_item
394
395   if(!dn_one_rdn)  {
396     /* this is the first element - record the top */
397     top_of_dn = tree;
398   }
399
400   %(DEFAULT_BODY)s
401
402   dn_one_rdn = TRUE;
403
404 #.FN_BODY AttributeValueAssertion
405
406         ava_hf_index = hf_index;
407         last_ava = (char *)wmem_alloc(wmem_packet_scope(), MAX_AVA_STR_LEN); *last_ava = '\0';
408         register_frame_end_routine (actx->pinfo, x509if_frame_end);
409
410         %(DEFAULT_BODY)s
411
412         ava_hf_index=-1;
413
414 #.FN_BODY Attribute
415         doing_attr = TRUE;
416         register_frame_end_routine (actx->pinfo, x509if_frame_end);
417
418         %(DEFAULT_BODY)s
419 #.END
420
421