aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/x509if/x509if.cnf
blob: 66bfd93c195a349b416922651b5bafdec68d60a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# x509if.cnf
# X509IF conformation file

# $Id$

#.MODULE_IMPORT
SelectedAttributeTypes x509sat

#.INCLUDE ../x509sat/x509sat-exp.cnf

#.EXPORTS
AllowedSubset
Attribute
AttributeCombination
AttributeType
AttributeTypeAndDistinguishedValue
AttributeTypeAssertion
AttributeUsage
AttributeValue
AttributeValueAssertion
#BaseDistance
ChopSpecification
Context
ContextAssertion
ContextCombination
ContextProfile
ControlOptions
DistinguishedName
DITContentRule
DITContextUse
DITStructureRule
EntryLimit
ImposedSubset
LocalName
Mapping
MatchingUse
MRMapping
MRSubstitution
Name
OutputValues
Refinement
RelativeDistinguishedName
RelaxationPolicy
RDNSequence
RequestAttribute
ResultAttribute
RuleIdentifier
SearchRule
SearchRuleDescription
SearchRuleId
SubtreeSpecification

#.PDU
DistinguishedName
Name

#.NO_EMIT

#.TYPE_RENAME
AttributeTypeAndDistinguishedValue/valuesWithContext	T_valWithContext
AttributeTypeAndDistinguishedValue/valuesWithContext/_item	T_valWithContext_item
ChopSpecification/specificExclusions			T_chopSpecificExclusions
ChopSpecification/specificExclusions/_item		T_chopSpecificExclusions_item

#.FIELD_RENAME
AttributeTypeAssertion/assertedContexts		ata_assertedContexts
AttributeTypeAndDistinguishedValue/value		atadv_value
AttributeTypeAndDistinguishedValue/valuesWithContext	valueswithContext
AttributeTypeAndDistinguishedValue/valuesWithContext/_item	valueswithContext_item
ChopSpecification/specificExclusions			chopSpecificExclusions
ChopSpecification/specificExclusions/_item		chopSpecificExclusions_item
Refinement/and			refinement_and
Refinement/and/_item		refinement_and_item
Refinement/not			refinement_not
Refinement/or			refinement_or
Refinement/or/_item		refinement_or_item
ContextAssertion/contextType		ca_contextType
ContextAssertion/contextValues		ca_contextValues
ContextAssertion/contextValues/_item	ca_contextValues_item
ContextCombination/not		contextcombination_not
ContextCombination/and		contextcombination_and
ContextCombination/and/_item	contextcombination_and_item
ContextCombination/or		contextcombination_or
ContextCombination/or/_item	contextcombination_or_item
RelaxationPolicy/maximum	maximum_relaxation
RelaxationPolicy/minimum	minimum_relaxation
RequestAttribute/defaultValues/_item/values		ra_values
RequestAttribute/defaultValues/_item/values/_item	ra_values_item
RequestAttribute/selectedValues				ra_selectedValues
RequestAttribute/selectedValues/_item			ra_selectedValues_item

#.REGISTER
DistinguishedName	B	"2.5.4.1"	"id-at-aliasedEntryName"
DistinguishedName	B	"2.5.4.31"	"id-at-member"
DistinguishedName	B	"2.5.4.32"	"id-at-owner"
DistinguishedName	B	"2.5.4.33"	"id-at-roleOccupant"
DistinguishedName	B	"2.5.4.34"	"id-at-seeAlso"
DistinguishedName	B	"2.5.4.49"	"id-at-distinguishedName"

DistinguishedName	B	"2.5.18.3"	"id-oa-creatorsName"
DistinguishedName	B	"2.5.18.4"	"id-oa-modifiersName"
#SubtreeSpecification 	B 	"2.5.18.6" 	"id-oa-subtreeSpecification"
DistinguishedName	B	"2.5.18.10"	"id-oa-subschemaSubentry"
DistinguishedName	B	"2.5.18.11"	"id-oa-subschemaSubentry"
DistinguishedName	B	"2.5.18.12"	"id-oa-collectiveAttributeSubentry"
DistinguishedName	B	"2.5.18.13"	"id-oa-contextDefaultSubentry"

# X402 - see master list in acp133.cnf
DistinguishedName B "2.6.5.2.5" "id-at-mhs-message-store-dn"
DistinguishedName B "2.6.5.2.14" "id-at-mhs-dl-related-lists"

# ACP133 - see master list in acp133.cnf
DistinguishedName B "2.16.840.1.101.2.2.1.3" "id-at-alternateRecipient"
DistinguishedName B "2.16.840.1.101.2.2.1.4" "id-at-associatedOrganization"
DistinguishedName B "2.16.840.1.101.2.2.1.6" "id-at-associatedPLA"
DistinguishedName B "2.16.840.1.101.2.2.1.49" "id-at-aliasPointer"
DistinguishedName B "2.16.840.1.101.2.2.1.61" "id-at-listPointer"
DistinguishedName B "2.16.840.1.101.2.2.1.110" "id-at-administrator"
DistinguishedName B "2.16.840.1.101.2.2.1.111" "id-at-aigsExpanded"
DistinguishedName B "2.16.840.1.101.2.2.1.113" "id-at-associatedAL"
DistinguishedName B "2.16.840.1.101.2.2.1.114" "id-at-copyMember"
DistinguishedName B "2.16.840.1.101.2.2.1.117" "id-at-guard"
DistinguishedName B "2.16.840.1.101.2.2.1.121" "id-at-networkDN"
DistinguishedName B "2.16.840.1.101.2.2.1.138" "id-at-plasServed"
DistinguishedName B "2.16.840.1.101.2.2.1.139" "id-at-deployed"
DistinguishedName B "2.16.840.1.101.2.2.1.140" "id-at-garrison"



#.FN_PARS ContextId
  FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &object_identifier_id

#.FN_BODY ContextValue
  offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);

#.FN_PARS AttributeId
  FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &object_identifier_id

#.FN_BODY AttributeId
  const char *fmt; 
  const char *name;

  %(DEFAULT_BODY)s

  if(object_identifier_id) {
    /* see if we can find a nice name */
    name = get_ber_oid_name(object_identifier_id);
    if(!name) name = object_identifier_id;    

    if(doing_dn) { /* append it to the RDN */
      g_strlcat(last_rdn, name, MAX_RDN_STR_LEN);
      g_strlcat(last_rdn, "=", MAX_RDN_STR_LEN);

     /* append it to the tree */
     proto_item_append_text(tree, " (%%s=", name);
    }

    if((fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
      /* we have a format */
      last_ava = ep_alloc(MAX_AVA_STR_LEN); *last_ava = '\0';

      g_snprintf(last_ava, MAX_AVA_STR_LEN, "%%s %%s", name, fmt);

      proto_item_append_text(tree, " %%s", last_ava);

    }
  }

#.FN_BODY AttributeValue
  int old_offset = offset;
  tvbuff_t	*out_tvb;
  char  	*value = NULL;
  const char 	*fmt; 
  const char	*name = NULL;
  const char    *orig_oid = object_identifier_id;

  offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);

  /* in dissecting the value we may have overridden the OID of the value - which is
     a problem if there are multiple values */
  object_identifier_id = orig_oid;

  /* try and dissect as a string */
  dissect_ber_octet_string(FALSE, pinfo, NULL, tvb, old_offset, hf_x509if_any_string, &out_tvb);
  
  /* should also try and dissect as an OID and integer */
  /* of course, if I can look up the syntax .... */

  if(out_tvb) {
    /* it was a string - format it */
    value = tvb_format_text(out_tvb, 0, tvb_length(out_tvb));

    if(doing_dn) {
      g_strlcat(last_rdn, value, MAX_RDN_STR_LEN);

      /* append it to the tree*/
      proto_item_append_text(tree, "%%s)", value);
    }

    if((fmt = val_to_str(ava_hf_index, fmt_vals, "")) && *fmt) {
      /* we have a format */

    if(!(name = get_ber_oid_name(object_identifier_id)))
      name = object_identifier_id;
    g_snprintf(last_ava, MAX_AVA_STR_LEN, "%%s %%s %%s", name, fmt, value);

    proto_item_append_text(tree, " %%s", last_ava);

    }
  }

#.FN_BODY SelectedValues
  offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);

#.FN_PARS DefaultValueType
  FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &object_identifier_id

#.FN_BODY DefaultValueValues
  offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);

#.FN_BODY ValuesWithContextValue
  offset=call_ber_oid_callback("unknown", tvb, offset, pinfo, tree);

#.FN_BODY RelativeDistinguishedName
  char *temp_dn;

  rdn_one_value = FALSE;
  top_of_rdn = tree;
  last_rdn = ep_alloc(MAX_DN_STR_LEN); *last_rdn = '\0';
  doing_dn = TRUE;

  %(DEFAULT_BODY)s

  /* we've finished - close the bracket */
  proto_item_append_text(top_of_rdn, " (%%s)", last_rdn);

  /* now append this to the DN */
  if (last_dn) {
    if(*last_dn) {
      temp_dn = ep_alloc(MAX_DN_STR_LEN); /* is there a better way to use ep_alloc here ? */
      g_snprintf(temp_dn, MAX_DN_STR_LEN, "%%s,%%s", last_rdn, last_dn);
      last_dn[0] = '\0';
      g_strlcat(last_dn, temp_dn, MAX_DN_STR_LEN);
    } else {
      g_strlcat(last_dn, last_rdn, MAX_DN_STR_LEN);
    }
  }

  doing_dn = FALSE;
  last_rdn = NULL; /* it will get freed when the next packet is dissected */

#.FN_BODY RelativeDistinguishedName/_item

  if(!rdn_one_value) {
    top_of_rdn = tree;
  } else {

   if(doing_dn)  
     /* this is an additional value - delimit */
     g_strlcat(last_rdn, "+", MAX_RDN_STR_LEN);
  }

  %(DEFAULT_BODY)s

  rdn_one_value = TRUE;

#.FN_BODY RDNSequence
  const char *fmt; 

  dn_one_rdn = FALSE; /* reset */
  last_dn = ep_alloc(MAX_DN_STR_LEN); *last_dn = '\0';
  top_of_dn = NULL;

  %(DEFAULT_BODY)s

  /* we've finished - append the dn */
  proto_item_append_text(top_of_dn, " (%%s)", last_dn);

 /* see if we should append this to the col info */
  if(check_col(pinfo->cinfo, COL_INFO) &&
     (fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
      /* we have a format */
	col_append_fstr(pinfo->cinfo, COL_INFO, " %%s%%s", fmt, last_dn);
  }


#.FN_BODY RDNSequence/_item

  if(!dn_one_rdn)  {
    /* this is the first element - record the top */
    top_of_dn = tree;
  } 

  %(DEFAULT_BODY)s

  dn_one_rdn = TRUE;

#.FN_BODY AttributeValueAssertion

	ava_hf_index = hf_index;
	last_ava = ep_alloc(MAX_AVA_STR_LEN); *last_ava = '\0';

	%(DEFAULT_BODY)s

	ava_hf_index=-1;

#.END