2 # spnego conformation file
13 NegTokenInit/mechListMIC T_NegTokenInit_mechListMIC
16 NegTokenInit/mechListMIC negTokenInit_mechListMIC
20 FN_VARIANT = _str VAL_PTR = &MechType_oid
24 gssapi_oid_value *value;
28 value = gssapi_lookup_oid_str(MechType_oid);
31 * Tell our caller the first mechanism we see, so that if
32 * this is a negTokenInit with a mechToken, it can interpret
33 * the mechToken according to the first mechType. (There
34 * might not have been any indication of the mechType
35 * in prior frames, so we can't necessarily use the
36 * mechanism from the conversation; i.e., a negTokenInit
37 * can contain the initial security token for the desired
38 * mechanism of the initiator - that's the first mechanism
43 next_level_value = value;
47 #.FN_BODY InnerContextToken
49 gssapi_oid_value *next_level_value;
56 * XXX - what should we do if this OID doesn't match the value
57 * attached to the frame or conversation? (That would be
58 * bogus, but that's not impossible - some broken implementation
59 * might negotiate some security mechanism but put the OID
60 * for some other security mechanism in GSS_Wrap tokens.)
63 next_level_value = gssapi_lookup_oid_str(MechType_oid);
66 * Now dissect the GSS_Wrap token; it's assumed to be in the
69 item = proto_tree_add_item(tree, hf_spnego_wraptoken, tvb, offset, -1, FALSE);
71 subtree = proto_item_add_subtree(item, ett_spnego_wraptoken);
74 * Now, we should be able to dispatch after creating a new TVB.
75 * The subdissector must return the length of the part of the
76 * token it dissected, so we can return the length of the part
77 * we (and it) dissected.
79 token_tvb = tvb_new_subset(tvb, offset, -1, -1);
80 if (next_level_value && next_level_value->wrap_handle) {
81 len = call_dissector(next_level_value->wrap_handle, token_tvb, actx->pinfo,
84 offset = tvb_length(tvb);
86 offset = offset + len;
88 offset = tvb_length(tvb);
90 #.FN_BODY MechTypeList
92 conversation_t *conversation;
94 saw_mechanism = FALSE;
99 * If we saw a mechType we need to store it in case the negTokenTarg
100 * does not provide a supportedMech.
103 conversation = find_conversation(actx->pinfo->fd->num,
104 &actx->pinfo->src, &actx->pinfo->dst,
106 actx->pinfo->srcport, actx->pinfo->destport, 0);
108 conversation = conversation_new(actx->pinfo->fd->num,
109 &actx->pinfo->src, &actx->pinfo->dst,
111 actx->pinfo->srcport, actx->pinfo->destport, 0);
113 conversation_add_proto_data(conversation, proto_spnego, next_level_value);
116 #.FN_PARS NegTokenInit/mechToken
118 VAL_PTR = &mechToken_tvb
120 #.FN_BODY NegTokenInit/mechToken
122 tvbuff_t *mechToken_tvb = NULL;
127 * Now, we should be able to dispatch, if we've gotten a tvbuff for
128 * the token and we have information on how to dissect its contents.
130 if (mechToken_tvb && next_level_value)
131 call_dissector(next_level_value->handle, mechToken_tvb, actx->pinfo, tree);
134 #.FN_BODY NegTokenInit/mechListMIC
139 tvbuff_t *mechListMIC_tvb;
142 * There seems to be two different forms this can take,
143 * one as an octet string, and one as a general string in a
146 * Peek at the header, and then decide which it is we're seeing.
148 get_ber_identifier(tvb, offset, &class, &pc, &tag);
149 if (class == BER_CLASS_UNI && pc && tag == BER_UNI_TAG_SEQUENCE) {
153 return dissect_spnego_PrincipalSeq(FALSE, tvb, offset, actx, tree,
154 hf_spnego_mechListMIC);
157 * It's not a sequence, so dissect it as an octet string,
158 * which is what it's supposed to be; that'll cause the
159 * right error report if it's not an octet string, either.
161 offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset,
162 hf_spnego_mechListMIC, &mechListMIC_tvb);
165 * Now, we should be able to dispatch with that tvbuff.
167 if (mechListMIC_tvb && next_level_value)
168 call_dissector(next_level_value->handle, mechListMIC_tvb, actx->pinfo, tree);
172 #.FN_BODY NegTokenTarg/supportedMech
174 conversation_t *conversation;
176 saw_mechanism = FALSE;
181 * If we saw an explicit mechType we store this in the conversation so that
182 * it will override any mechType we might have picked up from the
186 conversation = find_conversation(actx->pinfo->fd->num,
187 &actx->pinfo->src, &actx->pinfo->dst,
189 actx->pinfo->srcport, actx->pinfo->destport, 0);
191 conversation = conversation_new(actx->pinfo->fd->num,
192 &actx->pinfo->src, &actx->pinfo->dst,
194 actx->pinfo->srcport, actx->pinfo->destport, 0);
196 conversation_add_proto_data(conversation, proto_spnego, next_level_value);
200 #.FN_PARS NegTokenTarg/responseToken
202 VAL_PTR = &responseToken_tvb
204 #.FN_BODY NegTokenTarg/responseToken
206 tvbuff_t *responseToken_tvb;
213 * Now, we should be able to dispatch, if we've gotten a tvbuff for
214 * the token and we have information on how to dissect its contents.
215 * However, we should make sure that there is something in the
218 if (responseToken_tvb && (tvb_reported_length(responseToken_tvb) > 0) ){
219 gssapi_oid_value *value=next_level_value;
222 call_dissector(value->handle, responseToken_tvb, actx->pinfo, tree);
227 #.FN_PARS NegTokenTarg/mechListMIC
229 VAL_PTR = &mechListMIC_tvb
231 #.FN_BODY NegTokenTarg/mechListMIC
233 tvbuff_t *mechListMIC_tvb;
240 * Now, we should be able to dispatch, if we've gotten a tvbuff for
241 * the MIC and we have information on how to dissect its contents.
243 if (mechListMIC_tvb && (tvb_reported_length(mechListMIC_tvb) > 0) ){
244 gssapi_oid_value *value=next_level_value;
247 call_dissector(value->handle, mechListMIC_tvb, actx->pinfo, tree);