/* Get the encryption state tied to this conversation. cryptpeer indicates whether to retrieve the client key (1) or the server key (0)  */
static rc4_state_struct* get_encrypted_state(packet_info *pinfo, int cryptpeer)
/* Get the encryption state tied to this conversation. cryptpeer indicates whether to retrieve the client key (1) or the server key (0)  */
static rc4_state_struct* get_encrypted_state(packet_info *pinfo, int cryptpeer)
{
  conversation_t *conversation;
  ntlmssp_info   *conv_ntlmssp_info;
  conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
                                   pinfo->ptype, pinfo->srcport,
                                   pinfo->destport, 0);
  if (conversation == NULL) {
    return NULL;
  }
  else {
    conv_ntlmssp_info = (ntlmssp_info *)conversation_get_proto_data(conversation,
                                                    proto_ntlmssp);
    if (conv_ntlmssp_info == NULL) {
      return NULL;
    }
    else {
      if (cryptpeer == 1) {
        return &conv_ntlmssp_info->rc4_state_client;
      } else {
        return &conv_ntlmssp_info->rc4_state_server;
      }
    }
  }
}