#include "packet-smb2.h"
#include "packet-dcerpc.h"
#include "packet-ntlmssp.h"
+#include <epan/asn1.h>
+#include "packet-kerberos.h"
#include "packet-windows-common.h"
#include "packet-smb-common.h"
#include "packet-smb.h"
offset = dissect_smb2_olb_tvb_max_offset(offset, &s_olb);
+ /* If we have found a uid->acct_name mapping, store it */
+ if(!pinfo->fd->flags.visited && si->status == 0){
+#ifdef HAVE_KERBEROS
+ enc_key_t *ek;
+
+ if (krb_decrypt){
+ read_keytab_file_from_preferences();
+ }
+
+ for(ek=enc_key_list;ek;ek=ek->next){
+ if (ek->fd_num == -1) {
+ continue;
+ }
+
+ if (ek->fd_num != (int)pinfo->fd->num) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (ek != NULL) {
+ smb2_sesid_info_t *sesid;
+ sesid=(smb2_sesid_info_t *)se_alloc(sizeof(smb2_sesid_info_t));
+ sesid->sesid=si->sesid;
+ /* TODO: fill in the correct information */
+ sesid->acct_name=se_strdup("<krb5>");
+ sesid->domain_name=se_strdup("<krb5>");
+ sesid->host_name=se_strdup("<krb5>");
+ smb2_key_derivation(ek->keyvalue,
+ ek->keylength,
+ "SMB2AESCCM", 11,
+ "ServerIn ", 10,
+ sesid->server_decryption_key);
+ smb2_key_derivation(ek->keyvalue,
+ ek->keylength,
+ "SMB2AESCCM", 11,
+ "ServerOut", 10,
+ sesid->client_decryption_key);
+ sesid->server_port = pinfo->srcport;
+ sesid->auth_frame=pinfo->fd->num;
+ sesid->tids= g_hash_table_new(smb2_tid_info_hash, smb2_tid_info_equal);
+ g_hash_table_insert(si->conv->sesids, sesid, sesid);
+ }
+#endif
+ }
return offset;
}