diff options
author | Dario Lombardo <lomato@gmail.com> | 2019-11-17 22:07:02 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-11-18 04:40:06 +0000 |
commit | 726eea03483358f28b58a4ec6b9a4f33abfc0ea2 (patch) | |
tree | c0b91b46c049cfc172da7ef24fdf647c1f547657 /epan | |
parent | aa2145982f3aec7320f33d201a17d0fdbea2a6c0 (diff) |
ssh: indentation fixes.
Change-Id: Id7915aeca33d358f436681e7154e810a32c8064d
Reviewed-on: https://code.wireshark.org/review/35113
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ssh.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/epan/dissectors/packet-ssh.c b/epan/dissectors/packet-ssh.c index 2374ba6b2b..22508666ae 100644 --- a/epan/dissectors/packet-ssh.c +++ b/epan/dissectors/packet-ssh.c @@ -111,13 +111,13 @@ static int proto_ssh = -1; static int hf_ssh_protocol = -1; /* Framing */ -static int hf_ssh_packet_length= -1; -static int hf_ssh_packet_length_encrypted= -1; -static int hf_ssh_padding_length= -1; -static int hf_ssh_payload= -1; -static int hf_ssh_encrypted_packet= -1; -static int hf_ssh_padding_string= -1; -static int hf_ssh_mac_string= -1; +static int hf_ssh_packet_length = -1; +static int hf_ssh_packet_length_encrypted = -1; +static int hf_ssh_padding_length = -1; +static int hf_ssh_payload = -1; +static int hf_ssh_encrypted_packet = -1; +static int hf_ssh_padding_string = -1; +static int hf_ssh_mac_string = -1; /* Message codes */ static int hf_ssh_msg_code = -1; @@ -132,22 +132,22 @@ static int hf_ssh_kex_algorithms = -1; static int hf_ssh_server_host_key_algorithms = -1; static int hf_ssh_encryption_algorithms_client_to_server = -1; static int hf_ssh_encryption_algorithms_server_to_client = -1; -static int hf_ssh_mac_algorithms_client_to_server=-1; -static int hf_ssh_mac_algorithms_server_to_client=-1; -static int hf_ssh_compression_algorithms_client_to_server=-1; -static int hf_ssh_compression_algorithms_server_to_client=-1; -static int hf_ssh_languages_client_to_server=-1; -static int hf_ssh_languages_server_to_client=-1; -static int hf_ssh_kex_algorithms_length= -1; -static int hf_ssh_server_host_key_algorithms_length= -1; -static int hf_ssh_encryption_algorithms_client_to_server_length= -1; -static int hf_ssh_encryption_algorithms_server_to_client_length= -1; -static int hf_ssh_mac_algorithms_client_to_server_length= -1; -static int hf_ssh_mac_algorithms_server_to_client_length= -1; -static int hf_ssh_compression_algorithms_client_to_server_length= -1; -static int hf_ssh_compression_algorithms_server_to_client_length= -1; -static int hf_ssh_languages_client_to_server_length= -1; -static int hf_ssh_languages_server_to_client_length= -1; +static int hf_ssh_mac_algorithms_client_to_server = -1; +static int hf_ssh_mac_algorithms_server_to_client = -1; +static int hf_ssh_compression_algorithms_client_to_server = -1; +static int hf_ssh_compression_algorithms_server_to_client = -1; +static int hf_ssh_languages_client_to_server = -1; +static int hf_ssh_languages_server_to_client = -1; +static int hf_ssh_kex_algorithms_length = -1; +static int hf_ssh_server_host_key_algorithms_length = -1; +static int hf_ssh_encryption_algorithms_client_to_server_length = -1; +static int hf_ssh_encryption_algorithms_server_to_client_length = -1; +static int hf_ssh_mac_algorithms_client_to_server_length = -1; +static int hf_ssh_mac_algorithms_server_to_client_length = -1; +static int hf_ssh_compression_algorithms_client_to_server_length = -1; +static int hf_ssh_compression_algorithms_server_to_client_length = -1; +static int hf_ssh_languages_client_to_server_length = -1; +static int hf_ssh_languages_server_to_client_length = -1; static int hf_ssh_first_kex_packet_follows = -1; static int hf_ssh_kex_reserved = -1; @@ -361,13 +361,13 @@ dissect_ssh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) proto_tree *ssh_tree; proto_item *ti; conversation_t *conversation; - int last_offset, offset = 0; + int last_offset, offset = 0; gboolean is_response = (pinfo->destport != pinfo->match_uint), need_desegmentation; guint version; - struct ssh_flow_data *global_data=NULL; + struct ssh_flow_data *global_data = NULL; struct ssh_peer_data *peer_data; conversation = find_or_create_conversation(pinfo); @@ -375,10 +375,10 @@ dissect_ssh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) global_data = (struct ssh_flow_data *)conversation_get_proto_data(conversation, proto_ssh); if (!global_data) { global_data = (struct ssh_flow_data *)wmem_alloc0(wmem_file_scope(), sizeof(struct ssh_flow_data)); - global_data->version=SSH_VERSION_UNKNOWN; - global_data->kex_specific_dissector=ssh_dissect_kex_dh; - global_data->peer_data[CLIENT_PEER_DATA].mac_length=-1; - global_data->peer_data[SERVER_PEER_DATA].mac_length=-1; + global_data->version = SSH_VERSION_UNKNOWN; + global_data->kex_specific_dissector = ssh_dissect_kex_dh; + global_data->peer_data[CLIENT_PEER_DATA].mac_length = -1; + global_data->peer_data[SERVER_PEER_DATA].mac_length = -1; conversation_add_proto_data(conversation, proto_ssh, global_data); } @@ -471,13 +471,13 @@ ssh_dissect_ssh2(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, int is_response, gboolean *need_desegmentation) { - proto_item *ssh2_tree=NULL; - int last_offset=offset; + proto_item *ssh2_tree = NULL; + int last_offset = offset; struct ssh_peer_data *peer_data = &global_data->peer_data[is_response]; if (tree) { - wmem_strbuf_t *title=wmem_strbuf_new(wmem_packet_scope(), "SSH Version 2"); + wmem_strbuf_t *title = wmem_strbuf_new(wmem_packet_scope(), "SSH Version 2"); if (peer_data->enc || peer_data->mac || peer_data->comp) { wmem_strbuf_append_printf(title, " ("); @@ -496,7 +496,7 @@ ssh_dissect_ssh2(tvbuff_t *tvb, packet_info *pinfo, wmem_strbuf_append_printf(title, ")"); } - ssh2_tree=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ssh2, NULL, wmem_strbuf_get_str(title)); + ssh2_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_ssh2, NULL, wmem_strbuf_get_str(title)); } if ((peer_data->frame_key_start == 0) || @@ -531,7 +531,7 @@ ssh_dissect_ssh1(tvbuff_t *tvb, packet_info *pinfo, struct ssh_peer_data *peer_data = &global_data->peer_data[is_response]; - ssh1_tree=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ssh1, NULL, "SSH Version 1"); + ssh1_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_ssh1, NULL, "SSH Version 1"); /* * We use "tvb_ensure_captured_length_remaining()" to make sure there @@ -589,7 +589,7 @@ ssh_dissect_ssh1(tvbuff_t *tvb, packet_info *pinfo, } } offset+=4; -/* padding length */ + /* padding length */ proto_tree_add_uint(ssh1_tree, hf_ssh_padding_length, tvb, offset, padding_length, padding_length); @@ -619,7 +619,7 @@ ssh_dissect_ssh1(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_item(ssh1_tree, hf_ssh_payload, tvb, offset, len, ENC_NA); } - offset+=len; + offset += len; return offset; } @@ -711,11 +711,11 @@ ssh_dissect_key_exchange(tvbuff_t *tvb, packet_info *pinfo, guint plen, len; guint8 padding_length; guint remain_length; - int last_offset=offset; + int last_offset = offset; guint msg_code; proto_item *ti; - proto_item *key_ex_tree =NULL; + proto_item *key_ex_tree = NULL; struct ssh_peer_data *peer_data = &global_data->peer_data[is_response]; @@ -776,7 +776,7 @@ ssh_dissect_key_exchange(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_uint(tree, hf_ssh_padding_length, tvb, offset, 1, padding_length); offset += 1; - key_ex_tree=proto_tree_add_subtree(tree, tvb, offset, plen-1, ett_key_exchange, NULL, "Key Exchange"); + key_ex_tree = proto_tree_add_subtree(tree, tvb, offset, plen-1, ett_key_exchange, NULL, "Key Exchange"); /* msg_code */ msg_code = tvb_get_guint8(tvb, offset); @@ -837,7 +837,7 @@ ssh_dissect_key_exchange(tvbuff_t *tvb, packet_info *pinfo, if (len > 0) { proto_tree_add_item(key_ex_tree, hf_ssh_payload, tvb, offset, len, ENC_NA); } - offset +=len; + offset += len; /* padding */ proto_tree_add_item(tree, hf_ssh_padding_string, tvb, offset, padding_length, ENC_NA); @@ -973,7 +973,7 @@ ssh_dissect_encrypted_packet(tvbuff_t *tvb, packet_info *pinfo, tvb, offset+4+encrypted_len, peer_data->mac_length, ENC_NA); } - offset+=len; + offset += len; return offset; } @@ -1043,7 +1043,7 @@ ssh_dissect_protocol(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_item(tree, hf_ssh_protocol, tvb, offset, protolen, ENC_ASCII|ENC_NA); - offset+=linelen; + offset += linelen; return offset; } @@ -1126,8 +1126,8 @@ ssh_gslist_compare_strings(gconstpointer a, gconstpointer b) static void ssh_choose_algo(gchar *client, gchar *server, gchar **result) { - gchar **server_strings=NULL; - gchar **client_strings=NULL; + gchar **server_strings = NULL; + gchar **client_strings = NULL; gchar **step; GSList *server_list = NULL; @@ -1142,7 +1142,7 @@ ssh_choose_algo(gchar *client, gchar *server, gchar **result) client_strings = g_strsplit(client, ",", 0); for (step = client_strings; *step; step++) { GSList *agreed; - if ((agreed=g_slist_find_custom(server_list, *step, ssh_gslist_compare_strings))) { + if ((agreed = g_slist_find_custom(server_list, *step, ssh_gslist_compare_strings))) { *result = wmem_strdup(wmem_file_scope(), (const gchar *)agreed->data); break; } @@ -1164,7 +1164,7 @@ ssh_dissect_key_init(tvbuff_t *tvb, int offset, proto_tree *tree, struct ssh_peer_data *peer_data = &global_data->peer_data[is_response]; - key_init_tree=proto_tree_add_subtree(tree, tvb, offset, -1, ett_key_init, &tf, "Algorithms"); + key_init_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_key_init, &tf, "Algorithms"); proto_tree_add_item(key_init_tree, hf_ssh_cookie, tvb, offset, 16, ENC_NA); offset += 16; |