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