#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/conversation.h>
gchar* enc_client_request;
gchar* enc_server_offer;
gchar* enc;
-
+
gchar* comp_client_request;
gchar* comp_server_offer;
gchar* comp;
global_data = conversation_get_proto_data(conversation,proto_ssh);
if(!global_data ) {
- global_data = se_alloc(sizeof(struct ssh_flow_data));
- global_data->req_counter=0;
- global_data->rsp_counter=0;
+ global_data = se_alloc0(sizeof(struct ssh_flow_data));
global_data->version=SSH_VERSION_UNKNOWN;
-
- global_data->mac_client_request=NULL;
- global_data->mac_server_offer=NULL;
global_data->mac_length=-1;
- global_data->enc_client_request=NULL;
- global_data->enc_server_offer=NULL;
-
- global_data->comp_client_request=NULL;
- global_data->comp_server_offer=NULL;
-
conversation_add_proto_data(conversation,proto_ssh,global_data);
}
g_string_append_printf(title,")");
}
- ti=proto_tree_add_text(tree,tvb,offset,-1,title->str);
+ ti=proto_tree_add_text(tree,tvb,offset,-1, "%s", title->str);
ssh2_tree = proto_item_add_subtree(ti ,ett_ssh2);
if (title) g_string_free(title,TRUE);
}
msg_code);
}
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO,
+ col_append_str(pinfo->cinfo, COL_INFO,
val_to_str(msg_code, ssh1_msg_vals, "Unknown (%u)"));
}
offset += 1;
}
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO,
+ col_append_str(pinfo->cinfo, COL_INFO,
val_to_str(msg_code, ssh2_msg_vals, "Unknown (%u)"));
}
offset += 1;
offset+=ssh_tree_add_string(tvb,offset,key_ex_tree,hf_ssh_kexdh_h_sig,hf_ssh_kexdh_h_sig_length);
}
}
-
+
len = plen+4-padding_length-(offset-last_offset);
if (tree ) {
ssh_proto_tree_add_item(key_ex_tree, hf_ssh_payload,
if ((size_str=g_strrstr(mac_name,"-")) && ((size=atoi(size_str+1)))) {
global_data->mac_length = size;
}
- else if (!g_strcmp0(mac_name,"hmac-sha1")) {
+ else if (strcmp(mac_name,"hmac-sha1") == 0) {
global_data->mac_length = 20;
}
- else if (!g_strcmp0(mac_name,"hmac-md5")) {
+ else if (strcmp(mac_name,"hmac-md5") == 0) {
global_data->mac_length = 12;
}
- else if (!g_strcmp0(mac_name,"none")) {
+ else if (strcmp(mac_name,"none") == 0) {
global_data->mac_length = 0;
}
}
static gint
ssh_gslist_compare_strings(gconstpointer a, gconstpointer b)
{
- return g_strcmp0((char*)a,(char*)b);
+ if (a == NULL && b == NULL)
+ return 0;
+ if (a == NULL)
+ return -1;
+ if (b == NULL)
+ return 1;
+ return strcmp((char*)a,(char*)b);
}
/* expects that *result is NULL */