packet-kerberos: remember in what frame a key was learned
authorStefan Metzmacher <metze@samba.org>
Mon, 13 Aug 2012 12:45:58 +0000 (14:45 +0200)
committerAlexis La Goutte <alexis.lagoutte@gmail.com>
Tue, 25 Feb 2014 21:47:27 +0000 (21:47 +0000)
Change-Id: Icd05d4941fdacac44094fafbad07f08ec4cbe976
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/364
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
epan/dissectors/packet-kerberos.c
epan/dissectors/packet-kerberos.h

index 366f477dd1c4ee43544cfacc927e9d4b3ec6b017..adf22ca86da02e10c106ed979cedad33886bcc92 100644 (file)
@@ -455,6 +455,7 @@ printf("added key in %u    keytype:%d len:%d\n",pinfo->fd->num, keytype, keyleng
 
     new_key=(enc_key_t *)g_malloc(sizeof(enc_key_t));
     g_snprintf(new_key->key_origin, KRB_MAX_ORIG_LEN, "%s learnt from frame %u",origin,pinfo->fd->num);
+    new_key->fd_num = pinfo->fd->num;
     new_key->next=enc_key_list;
     enc_key_list=new_key;
     new_key->keytype=keytype;
@@ -510,6 +511,7 @@ printf("read keytab file %s\n", filename);
 
     do{
         new_key=(enc_key_t *)g_malloc(sizeof(enc_key_t));
+        new_key->fd_num = -1;
         new_key->next=enc_key_list;
         ret = krb5_kt_next_entry(krb5_ctx, keytab, &key, &cursor);
         if(ret==0){
@@ -645,6 +647,7 @@ read_keytab_file(const char *filename)
 
     do{
         new_key=(enc_key_t*)g_malloc(sizeof(enc_key_t));
+        new_key->fd_num = -1;
         new_key->next=enc_key_list;
         ret = krb5_kt_next_entry(krb5_ctx, keytab, &key, &cursor);
         if(ret==0){
index 2fc9f023f188170e02f4a3efe80c3bcbe9b99127..2ffb910fb9afdac801f890b69275ff7c43bb2512 100644 (file)
@@ -73,6 +73,7 @@ typedef struct _enc_key_t {
        int keylength;
        char *keyvalue;
        char                    key_origin[KRB_MAX_ORIG_LEN+1];
+       int fd_num; /* remember where we learned a key */
 } enc_key_t;
 extern enc_key_t *enc_key_list;