aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2019-03-22 10:36:50 +0100
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2019-03-25 11:38:54 +0000
commit67441248be9b0f08a5cfb6b5ca6f77f6284fa40d (patch)
tree953f9683cde4989ae2b54029e968a266834d3c25
parentea39ed7410081f23225ffaa7b32f2d9410ac7cbd (diff)
gssapi: fix indentation in function dissect_gssapi_work().
Change-Id: I48f331a0e572ce8b9b6b3fbe9eb45b7e2ba2b33a Reviewed-on: https://code.wireshark.org/review/32572 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r--epan/dissectors/packet-gssapi.c135
1 files changed, 66 insertions, 69 deletions
diff --git a/epan/dissectors/packet-gssapi.c b/epan/dissectors/packet-gssapi.c
index e605ade305..f7ce0c7ff0 100644
--- a/epan/dissectors/packet-gssapi.c
+++ b/epan/dissectors/packet-gssapi.c
@@ -269,7 +269,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
pinfo, fi->first_frame, NULL);
if(fd_head && (fd_head->flags&FD_DEFRAGMENTED)){
if(pinfo->num==fi->reassembled_in){
- proto_item *frag_tree_item;
+ proto_item *frag_tree_item;
gss_tvb=tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, gss_tvb, "Reassembled GSSAPI");
show_fragment_tree(fd_head, &gssapi_frag_items, tree, pinfo, tvb, &frag_tree_item);
@@ -289,8 +289,8 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (!(appclass == BER_CLASS_APP && pc && tag == 0)) {
- /* It could be NTLMSSP, with no OID. This can happen
- for anything that microsoft calls 'Negotiate' or GSS-SPNEGO */
+ /* It could be NTLMSSP, with no OID. This can happen
+ for anything that microsoft calls 'Negotiate' or GSS-SPNEGO */
if ((tvb_captured_length_remaining(gss_tvb, start_offset)>7) && (tvb_strneql(gss_tvb, start_offset, "NTLMSSP", 7) == 0)) {
return_offset = call_dissector(ntlmssp_handle,
tvb_new_subset_remaining(gss_tvb, start_offset),
@@ -319,69 +319,67 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
pinfo, subtree, &encrypt_info->gssapi_decrypted_tvb);
encrypt_info->gssapi_data_encrypted = TRUE;
}
- goto done;
- }
-
- /* Maybe it's new GSSKRB5 CFX Wrapping */
- if ((tvb_captured_length_remaining(gss_tvb, start_offset)>2) &&
- ((tvb_memeql(gss_tvb, start_offset, "\04\x04", 2) == 0) ||
- (tvb_memeql(gss_tvb, start_offset, "\05\x04", 2) == 0))) {
- return_offset = call_dissector_with_data(spnego_krb5_wrap_handle,
- tvb_new_subset_remaining(gss_tvb, start_offset),
- pinfo, subtree, encrypt_info);
- goto done;
- }
-
- /*
- * If we do not recognise an Application class,
- * then we are probably dealing with an inner context
- * token or a wrap token, and we should retrieve the
- * gssapi_oid_value pointer from the per-frame data or,
- * if there is no per-frame data (as would be the case
- * the first time we dissect this frame), from the
- * conversation that exists or that we created from
- * pinfo (and then make it per-frame data).
- * We need to make it per-frame data as there can be
- * more than one GSS-API negotiation in a conversation.
- *
- * Note! We "cheat". Since we only need the pointer,
- * we store that as the data. (That's not really
- * "cheating" - the per-frame data and per-conversation
- * data code doesn't care what you supply as a data
- * pointer; it just treats it as an opaque pointer, it
- * doesn't dereference it or free what it points to.)
- */
- oidvalue = (gssapi_oid_value *)p_get_proto_data(wmem_file_scope(), pinfo, proto_gssapi, 0);
- if (!oidvalue && !pinfo->fd->visited)
- {
- /* No handle attached to this frame, but it's the first */
- /* pass, so it'd be attached to the conversation. */
- oidvalue = gss_info->oid;
- if (gss_info->oid)
- p_add_proto_data(wmem_file_scope(), pinfo, proto_gssapi, 0, gss_info->oid);
- }
- if (!oidvalue)
- {
- proto_tree_add_expert_format(subtree, pinfo, &ei_gssapi_unknown_header, gss_tvb, start_offset, 0,
- "Unknown header (class=%d, pc=%d, tag=%d)",
- appclass, pc, tag);
- return_offset = tvb_captured_length(gss_tvb);
- goto done;
- } else {
- tvbuff_t *oid_tvb_local;
-
- oid_tvb_local = tvb_new_subset_remaining(gss_tvb, start_offset);
- if (is_verifier)
- handle = oidvalue->wrap_handle;
- else
- handle = oidvalue->handle;
- len = call_dissector_with_data(handle, oid_tvb_local, pinfo, subtree, encrypt_info);
- if (len == 0)
- return_offset = tvb_captured_length(gss_tvb);
- else
- return_offset = start_offset + len;
- goto done; /* We are finished here */
- }
+ goto done;
+ }
+
+ /* Maybe it's new GSSKRB5 CFX Wrapping */
+ if ((tvb_captured_length_remaining(gss_tvb, start_offset)>2) &&
+ ((tvb_memeql(gss_tvb, start_offset, "\04\x04", 2) == 0) ||
+ (tvb_memeql(gss_tvb, start_offset, "\05\x04", 2) == 0))) {
+ return_offset = call_dissector_with_data(spnego_krb5_wrap_handle,
+ tvb_new_subset_remaining(gss_tvb, start_offset),
+ pinfo, subtree, encrypt_info);
+ goto done;
+ }
+
+ /*
+ * If we do not recognise an Application class,
+ * then we are probably dealing with an inner context
+ * token or a wrap token, and we should retrieve the
+ * gssapi_oid_value pointer from the per-frame data or,
+ * if there is no per-frame data (as would be the case
+ * the first time we dissect this frame), from the
+ * conversation that exists or that we created from
+ * pinfo (and then make it per-frame data).
+ * We need to make it per-frame data as there can be
+ * more than one GSS-API negotiation in a conversation.
+ *
+ * Note! We "cheat". Since we only need the pointer,
+ * we store that as the data. (That's not really
+ * "cheating" - the per-frame data and per-conversation
+ * data code doesn't care what you supply as a data
+ * pointer; it just treats it as an opaque pointer, it
+ * doesn't dereference it or free what it points to.)
+ */
+ oidvalue = (gssapi_oid_value *)p_get_proto_data(wmem_file_scope(), pinfo, proto_gssapi, 0);
+ if (!oidvalue && !pinfo->fd->visited) {
+ /* No handle attached to this frame, but it's the first */
+ /* pass, so it'd be attached to the conversation. */
+ oidvalue = gss_info->oid;
+ if (gss_info->oid)
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_gssapi, 0, gss_info->oid);
+ }
+ if (!oidvalue) {
+ proto_tree_add_expert_format(subtree, pinfo, &ei_gssapi_unknown_header, gss_tvb, start_offset, 0,
+ "Unknown header (class=%d, pc=%d, tag=%d)",
+ appclass, pc, tag);
+ return_offset = tvb_captured_length(gss_tvb);
+ goto done;
+ } else {
+ tvbuff_t *oid_tvb_local;
+
+ oid_tvb_local = tvb_new_subset_remaining(gss_tvb, start_offset);
+ if (is_verifier)
+ handle = oidvalue->wrap_handle;
+ else
+ handle = oidvalue->handle;
+ len = call_dissector_with_data(handle, oid_tvb_local, pinfo, subtree, encrypt_info);
+ if (len == 0)
+ return_offset = tvb_captured_length(gss_tvb);
+ else
+ return_offset = start_offset + len;
+ goto done; /* We are finished here */
+ }
}
/* Read oid */
@@ -428,8 +426,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* Hand off to subdissector.
*/
- if ((oidvalue == NULL) ||
- !proto_is_protocol_enabled(oidvalue->proto)) {
+ if ((oidvalue == NULL) || !proto_is_protocol_enabled(oidvalue->proto)) {
/* No dissector for this oid */
proto_tree_add_item(subtree, hf_gssapi_token_object, gss_tvb, oid_start_offset, -1, ENC_NA);
@@ -445,7 +442,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* Now add the proto data ...
* but only if it is not already there.
*/
- if(!gss_info->oid){
+ if(!gss_info->oid) {
gss_info->oid=oidvalue;
}