return True;
}
+static BOOL net_io_ctrl_data_info_5(const char *desc, CTRL_DATA_INFO_5 *info, prs_struct *ps, int depth)
+{
+ if (info == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "net_io_ctrl_data_info_5");
+ depth++;
+
+ if ( !prs_uint32( "function_code", ps, depth, &info->function_code ) )
+ return False;
+
+ if(!prs_uint32("ptr_domain", ps, depth, &info->ptr_domain))
+ return False;
+
+ if ( info->ptr_domain ) {
+ if(!smb_io_unistr2("domain", &info->domain, info->ptr_domain, ps, depth))
+ return False;
+ }
+
+ return True;
+}
+
+static BOOL net_io_ctrl_data_info_6(const char *desc, CTRL_DATA_INFO_6 *info, prs_struct *ps, int depth)
+{
+ if (info == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "net_io_ctrl_data_info_6");
+ depth++;
+
+ if ( !prs_uint32( "function_code", ps, depth, &info->function_code ) )
+ return False;
+
+ if(!prs_uint32("ptr_domain", ps, depth, &info->ptr_domain))
+ return False;
+
+ if ( info->ptr_domain ) {
+ if(!smb_io_unistr2("domain", &info->domain, info->ptr_domain, ps, depth))
+ return False;
+ }
+
+ return True;
+}
+
/*******************************************************************
Reads or writes an NET_Q_LOGON_CTRL2 structure.
********************************************************************/
return False;
if(!prs_uint32("query_level ", ps, depth, &q_l->query_level))
return False;
- if(!prs_uint32("switch_value ", ps, depth, &q_l->switch_value))
- return False;
+ switch ( q_l->function_code ) {
+ case NETLOGON_CONTROL_REDISCOVER:
+ if ( !net_io_ctrl_data_info_5( "ctrl_data_info5", &q_l->info.info5, ps, depth) )
+ return False;
+ break;
+
+ case NETLOGON_CONTROL_TC_QUERY:
+ if ( !net_io_ctrl_data_info_6( "ctrl_data_info6", &q_l->info.info6, ps, depth) )
+ return False;
+ break;
+ default:
+ DEBUG(0,("net_io_q_logon_ctrl2: unknown function_code [%d]\n",
+ q_l->function_code));
+ return False;
+ }
+
return True;
}
q_l->function_code = 0x01;
q_l->query_level = query_level;
- q_l->switch_value = 0x01;
init_unistr2(&q_l->uni_server_name, srv_name, UNI_STR_TERMINATE);
}
uint32 logon_attempts, uint32 tc_status,
const char *trusted_domain_name)
{
- DEBUG(5,("init_r_logon_ctrl2\n"));
-
- r_l->switch_value = query_level; /* should only be 0x1 */
+ r_l->switch_value = query_level;
switch (query_level) {
case 1:
void init_q_req_chal(NET_Q_REQ_CHAL *q_c,
const char *logon_srv, const char *logon_clnt,
- DOM_CHAL *clnt_chal)
+ const DOM_CHAL *clnt_chal)
{
DEBUG(5,("init_q_req_chal: %d\n", __LINE__));
void init_q_auth_2(NET_Q_AUTH_2 *q_a,
const char *logon_srv, const char *acct_name, uint16 sec_chan, const char *comp_name,
- DOM_CHAL *clnt_chal, uint32 clnt_flgs)
+ const DOM_CHAL *clnt_chal, uint32 clnt_flgs)
{
DEBUG(5,("init_q_auth_2: %d\n", __LINE__));
void init_q_auth_3(NET_Q_AUTH_3 *q_a,
const char *logon_srv, const char *acct_name, uint16 sec_chan, const char *comp_name,
- DOM_CHAL *clnt_chal, uint32 clnt_flgs)
+ const DOM_CHAL *clnt_chal, uint32 clnt_flgs)
{
DEBUG(5,("init_q_auth_3: %d\n", __LINE__));
}
/* Now allocate space for them. */
- *ppsids = (DOM_SID2 *)talloc_zero(ctx, count * sizeof(DOM_SID2));
+ *ppsids = TALLOC_ZERO_ARRAY(ctx, DOM_SID2, count);
if (*ppsids == NULL)
return 0;
const uchar * lm_chal_resp, size_t lm_chal_resp_len,
const uchar * nt_chal_resp, size_t nt_chal_resp_len)
{
- unsigned char lm_owf[24];
- unsigned char nt_owf[128];
DEBUG(5,("init_id_info2: %d\n", __LINE__));
id->ptr_id_info2 = 1;
-
id->param_ctrl = param_ctrl;
init_logon_id(&id->logon_id, log_id_low, log_id_high);
- if (nt_chal_resp) {
- /* oops. can only send what-ever-it-is direct */
- memcpy(nt_owf, nt_chal_resp, MIN(sizeof(nt_owf), nt_chal_resp_len));
- nt_chal_resp = nt_owf;
- }
- if (lm_chal_resp) {
- /* oops. can only send what-ever-it-is direct */
- memcpy(lm_owf, lm_chal_resp, MIN(sizeof(lm_owf), lm_chal_resp_len));
- lm_chal_resp = lm_owf;
- }
-
memcpy(id->lm_chal, lm_challenge, sizeof(id->lm_chal));
init_str_hdr(&id->hdr_nt_chal_resp, nt_chal_resp_len, nt_chal_resp_len, (nt_chal_resp != NULL) ? 1 : 0);
init_str_hdr(&id->hdr_lm_chal_resp, lm_chal_resp_len, lm_chal_resp_len, (lm_chal_resp != NULL) ? 1 : 0);
depth++;
if (UNMARSHALLING(ps)) {
- ctr = *pp_ctr = (NET_ID_INFO_CTR *)prs_alloc_mem(ps, sizeof(NET_ID_INFO_CTR));
+ ctr = *pp_ctr = PRS_ALLOC_MEM(ps, NET_ID_INFO_CTR, 1);
if (ctr == NULL)
return False;
}
uint16 logon_count, uint16 bad_pw_count,
uint32 num_groups, const DOM_GID *gids,
- uint32 user_flgs, uchar nt_session_key[16],
+ uint32 user_flgs, uchar user_session_key[16],
uchar lm_session_key[16],
const char *logon_srv, const char *logon_dom,
const DOM_SID *dom_sid, const char *other_sids)
usr->buffer_groups = 1; /* indicates fill in groups, below, even if there are none */
usr->user_flgs = user_flgs;
- if (nt_session_key != NULL)
- memcpy(usr->user_sess_key, nt_session_key, sizeof(usr->user_sess_key));
+ if (user_session_key != NULL)
+ memcpy(usr->user_sess_key, user_session_key, sizeof(usr->user_sess_key));
else
memset((char *)usr->user_sess_key, '\0', sizeof(usr->user_sess_key));
usr->buffer_dom_id = dom_sid ? 1 : 0; /* yes, we're bothering to put a domain SID in */
- memset((char *)usr->padding, '\0', sizeof(usr->padding));
+ memset((char *)usr->lm_sess_key, '\0', sizeof(usr->lm_sess_key));
+ memset(&usr->acct_flags, '\0', sizeof(usr->acct_flags));
-#if 0 /* JRATEST - exchange auth test. */
- if (lm_session_key != NULL)
- memcpy(usr->padding, lm_session_key, sizeof(usr->user_sess_key));
-#endif
+ for (i=0; i<7; i++) {
+ memset(&usr->unknown[i], '\0', sizeof(usr->unknown));
+ }
+
+ if (lm_session_key != NULL) {
+ memcpy(usr->lm_sess_key, lm_session_key, sizeof(usr->lm_sess_key));
+ }
num_other_sids = init_dom_sid2s(ctx, other_sids, &usr->other_sids);
usr->num_groups2 = num_groups;
- usr->gids = (DOM_GID *)talloc_zero(ctx,sizeof(DOM_GID) * (num_groups));
+ usr->gids = TALLOC_ZERO_ARRAY(ctx,DOM_GID,num_groups);
if (usr->gids == NULL && num_groups>0)
return;
********************************************************************/
BOOL net_io_user_info3(const char *desc, NET_USER_INFO_3 *usr, prs_struct *ps,
- int depth, uint16 validation_level)
+ int depth, uint16 validation_level, BOOL kerb_validation_level)
{
unsigned int i;
if(!prs_uint32("buffer_dom_id ", ps, depth, &usr->buffer_dom_id)) /* undocumented logon domain id pointer */
return False;
- if(!prs_uint8s (False, "padding ", ps, depth, usr->padding, 40)) /* unused padding bytes? */
+
+ if(!prs_uint8s(False, "lm_sess_key", ps, depth, usr->lm_sess_key, 8)) /* lm session key */
+ return False;
+
+ if(!prs_uint32("acct_flags ", ps, depth, &usr->acct_flags)) /* Account flags */
return False;
+ for (i = 0; i < 7; i++)
+ {
+ if (!prs_uint32("unkown", ps, depth, &usr->unknown[i])) /* unknown */
+ return False;
+ }
+
if (validation_level == 3) {
if(!prs_uint32("num_other_sids", ps, depth, &usr->num_other_sids)) /* 0 - num_sids */
return False;
}
}
+ /* get kerb validation info (not really part of user_info_3) - Guenther */
+
+ if (kerb_validation_level) {
+
+ if(!prs_uint32("ptr_res_group_dom_sid", ps, depth, &usr->ptr_res_group_dom_sid))
+ return False;
+ if(!prs_uint32("res_group_count", ps, depth, &usr->res_group_count))
+ return False;
+ if(!prs_uint32("ptr_res_groups", ps, depth, &usr->ptr_res_groups))
+ return False;
+ }
+
if(!smb_io_unistr2("uni_user_name", &usr->uni_user_name, usr->hdr_user_name.buffer, ps, depth)) /* username unicode string */
return False;
if(!smb_io_unistr2("uni_full_name", &usr->uni_full_name, usr->hdr_full_name.buffer, ps, depth)) /* user's full name unicode string */
return False;
if (UNMARSHALLING(ps) && usr->num_groups2 > 0) {
- usr->gids = (DOM_GID *)prs_alloc_mem(ps, sizeof(DOM_GID)*usr->num_groups2);
+ usr->gids = PRS_ALLOC_MEM(ps, DOM_GID, usr->num_groups2);
if (usr->gids == NULL)
return False;
}
if(!smb_io_unistr2("uni_logon_srv", &usr->uni_logon_srv, usr->hdr_logon_srv.buffer, ps, depth)) /* logon server unicode string */
return False;
- if(!smb_io_unistr2("uni_logon_dom", &usr->uni_logon_dom, usr->hdr_logon_srv.buffer, ps, depth)) /* logon domain unicode string */
+ if(!smb_io_unistr2("uni_logon_dom", &usr->uni_logon_dom, usr->hdr_logon_dom.buffer, ps, depth)) /* logon domain unicode string */
return False;
if(!smb_io_dom_sid2("", &usr->dom_sid, ps, depth)) /* domain SID */
return False;
- if (usr->num_other_sids) {
+ if (usr->buffer_other_sids) {
- if (UNMARSHALLING(ps)) {
- usr->other_sids = (DOM_SID2 *)prs_alloc_mem(ps, sizeof(DOM_SID2)*usr->num_other_sids);
- if (usr->other_sids == NULL)
- return False;
+ uint32 num_other_sids = usr->num_other_sids;
+
+ if (!(usr->user_flgs & LOGON_EXTRA_SIDS)) {
+ DEBUG(10,("net_io_user_info3: user_flgs attribute does not have LOGON_EXTRA_SIDS\n"));
+ /* return False; */
}
-
- if(!prs_uint32("num_other_groups", ps, depth, &usr->num_other_groups))
+
+ if (!prs_uint32("num_other_sids", ps, depth,
+ &num_other_sids))
return False;
- if (UNMARSHALLING(ps) && usr->num_other_groups > 0) {
- usr->other_gids = (DOM_GID *)prs_alloc_mem(ps, sizeof(DOM_GID)*usr->num_other_groups);
- if (usr->other_gids == NULL)
+ if (num_other_sids != usr->num_other_sids)
+ return False;
+
+ if (UNMARSHALLING(ps)) {
+ usr->other_sids = PRS_ALLOC_MEM(ps, DOM_SID2, usr->num_other_sids);
+ usr->other_sids_attrib =
+ PRS_ALLOC_MEM(ps, uint32, usr->num_other_sids);
+
+ if ((num_other_sids != 0) &&
+ ((usr->other_sids == NULL) ||
+ (usr->other_sids_attrib == NULL)))
return False;
}
-
- for (i = 0; i < usr->num_other_groups; i++) {
- if(!smb_io_gid("", &usr->other_gids[i], ps, depth)) /* other GIDs */
+
+ /* First the pointers to the SIDS and attributes */
+
+ depth++;
+
+ for (i=0; i<usr->num_other_sids; i++) {
+ uint32 ptr = 1;
+
+ if (!prs_uint32("sid_ptr", ps, depth, &ptr))
+ return False;
+
+ if (UNMARSHALLING(ps) && (ptr == 0))
+ return False;
+
+ if (!prs_uint32("attribute", ps, depth,
+ &usr->other_sids_attrib[i]))
return False;
}
+
for (i = 0; i < usr->num_other_sids; i++) {
if(!smb_io_dom_sid2("", &usr->other_sids[i], ps, depth)) /* other domain SIDs */
return False;
}
+
+ depth--;
}
return True;
if(!prs_uint32("buffer_creds", ps, depth, &r_l->buffer_creds)) /* undocumented buffer pointer */
return False;
- if(!smb_io_cred("", &r_l->srv_creds, ps, depth)) /* server credentials. server time stamp appears to be ignored. */
- return False;
+ if (&r_l->buffer_creds) {
+ if(!smb_io_cred("", &r_l->srv_creds, ps, depth)) /* server credentials. server time stamp appears to be ignored. */
+ return False;
+ }
if(!prs_uint16("switch_value", ps, depth, &r_l->switch_value))
return False;
return False;
#if 1 /* W2k always needs this - even for bad passwd. JRA */
- if(!net_io_user_info3("", r_l->user, ps, depth, r_l->switch_value))
+ if(!net_io_user_info3("", r_l->user, ps, depth, r_l->switch_value, False))
return False;
#else
if (r_l->switch_value != 0) {
- if(!net_io_user_info3("", r_l->user, ps, depth, r_l->switch_value))
+ if(!net_io_user_info3("", r_l->user, ps, depth, r_l->switch_value, False))
return False;
}
#endif
return False;
if (!smb_io_time("creation_time", &info->creation_time, ps, depth))
return False;
-
- if (!smb_io_bufhdr2("hdr_sec_desc", &info->hdr_sec_desc, ps, depth))
- return False;
- if (!smb_io_unihdr("hdr_unknown", &info->hdr_unknown, ps, depth))
- return False;
-
- if (ps->data_offset + 40 > ps->buffer_size)
- return False;
- ps->data_offset += 40;
+ if (!prs_uint32("security_information", ps, depth, &info->security_information))
+ return False;
+ if (!smb_io_bufhdr4("hdr_sec_desc", &info->hdr_sec_desc, ps, depth))
+ return False;
+ if (!smb_io_lockout_string_hdr("hdr_account_lockout_string", &info->hdr_account_lockout, ps, depth))
+ return False;
+ if (!smb_io_unihdr("hdr_unknown2", &info->hdr_unknown2, ps, depth))
+ return False;
+ if (!smb_io_unihdr("hdr_unknown3", &info->hdr_unknown3, ps, depth))
+ return False;
+ if (!smb_io_unihdr("hdr_unknown4", &info->hdr_unknown4, ps, depth))
+ return False;
+ if (!prs_uint32("logon_chgpass", ps, depth, &info->logon_chgpass))
+ return False;
+ if (!prs_uint32("unknown6", ps, depth, &info->unknown6))
+ return False;
+ if (!prs_uint32("unknown7", ps, depth, &info->unknown7))
+ return False;
+ if (!prs_uint32("unknown8", ps, depth, &info->unknown8))
+ return False;
if (!smb_io_unistr2("uni_dom_name", &info->uni_dom_name,
info->hdr_dom_name.buffer, ps, depth))
info->hdr_oem_info.buffer, ps, depth))
return False;
- if (!smb_io_buffer4("buf_sec_desc", &info->buf_sec_desc,
- info->hdr_sec_desc.buffer, ps, depth))
- return False;
- if (!smb_io_unistr2("buf_unknown", &info->buf_unknown,
- info->hdr_unknown.buffer, ps, depth))
+ if (!smb_io_rpc_blob("buf_sec_desc", &info->buf_sec_desc, ps, depth))
return False;
+ if (!smb_io_account_lockout_str("account_lockout", &info->account_lockout,
+ info->hdr_account_lockout.buffer, ps, depth))
+ return False;
+
+ if (!smb_io_unistr2("buf_unknown2", &info->buf_unknown2,
+ info->hdr_unknown2.buffer, ps, depth))
+ return False;
+ if (!smb_io_unistr2("buf_unknown3", &info->buf_unknown3,
+ info->hdr_unknown3.buffer, ps, depth))
+ return False;
+ if (!smb_io_unistr2("buf_unknown4", &info->buf_unknown4,
+ info->hdr_unknown4.buffer, ps, depth))
+ return False;
+
return True;
}
if (!smb_io_unistr2("uni_grp_desc", &info->uni_grp_desc,
info->hdr_grp_desc.buffer, ps, depth))
return False;
- if (!smb_io_buffer4("buf_sec_desc", &info->buf_sec_desc,
- info->hdr_sec_desc.buffer, ps, depth))
+ if (!smb_io_rpc_blob("buf_sec_desc", &info->buf_sec_desc, ps, depth))
return False;
return True;
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_account_info(const char *desc, uint8 sess_key[16],
- SAM_ACCOUNT_INFO * info, prs_struct *ps,
- int depth)
+static BOOL net_io_sam_account_info(const char *desc, SAM_ACCOUNT_INFO *info,
+ prs_struct *ps, int depth)
{
BUFHDR2 hdr_priv_data;
uint32 i;
if (!prs_uint32("unknown2", ps, depth, &info->unknown2))
return False;
- if (!smb_io_buffer4("buf_logon_hrs", &info->buf_logon_hrs,
- info->ptr_logon_hrs, ps, depth))
+ if (!smb_io_rpc_blob("buf_logon_hrs", &info->buf_logon_hrs, ps, depth))
return False;
prs_align(ps);
if (!smb_io_unistr2("uni_comment", &info->uni_comment,
if (ps->io)
{
/* reading */
- if (!prs_hash1(ps, ps->data_offset, sess_key, len))
+ if (!prs_hash1(ps, ps->data_offset, len))
return False;
}
if (!net_io_sam_passwd_info("pass", &info->pass,
if (!ps->io)
{
/* writing */
- if (!prs_hash1(ps, old_offset, sess_key, len))
+ if (!prs_hash1(ps, old_offset, len))
return False;
}
}
return False;
ps->data_offset = old_offset + len;
}
- if (!smb_io_buffer4("buf_sec_desc", &info->buf_sec_desc,
- info->hdr_sec_desc.buffer, ps, depth))
+ if (!smb_io_rpc_blob("buf_sec_desc", &info->buf_sec_desc, ps, depth))
return False;
prs_align(ps);
if (!smb_io_unistr2("uni_profile", &info->uni_profile,
return False;
}
- info->rids = talloc(ps->mem_ctx, sizeof(uint32) *
- info->num_members2);
+ info->rids = TALLOC_ARRAY(ps->mem_ctx, uint32, info->num_members2);
if (info->rids == NULL) {
DEBUG(0, ("out of memory allocating %d rids\n",
return False;
}
- info->attribs = talloc(ps->mem_ctx, sizeof(uint32) *
- info->num_members3);
+ info->attribs = TALLOC_ARRAY(ps->mem_ctx, uint32, info->num_members3);
if (info->attribs == NULL) {
DEBUG(0, ("out of memory allocating %d attribs\n",
if (!smb_io_unistr2("uni_als_name", &info->uni_als_name,
info->hdr_als_name.buffer, ps, depth))
return False;
- if (!smb_io_buffer4("buf_sec_desc", &info->buf_sec_desc,
- info->hdr_sec_desc.buffer, ps, depth))
+ if (!smb_io_rpc_blob("buf_sec_desc", &info->buf_sec_desc, ps, depth))
return False;
- if (info->hdr_als_desc.buffer != 0) {
- if (!smb_io_unistr2("uni_als_desc", &info->uni_als_desc,
- info->hdr_als_name.buffer, ps, depth))
- return False;
- }
+ if (!smb_io_unistr2("uni_als_desc", &info->uni_als_desc,
+ info->hdr_als_desc.buffer, ps, depth))
+ return False;
return True;
}
return False;
}
- info->ptr_sids = talloc(ps->mem_ctx, sizeof(uint32) *
- info->num_sids);
+ info->ptr_sids = TALLOC_ARRAY(ps->mem_ctx, uint32, info->num_sids);
if (info->ptr_sids == NULL) {
DEBUG(0, ("out of memory allocating %d ptr_sids\n",
return False;
}
- info->sids = talloc(ps->mem_ctx, sizeof(DOM_SID2) *
- info->num_sids);
+ info->sids = TALLOC_ARRAY(ps->mem_ctx, DOM_SID2, info->num_sids);
if (info->sids == NULL) {
DEBUG(0, ("error allocating %d sids\n",
if(!smb_io_dom_sid2("domain_sid", &info->domain_sid, ps, depth))
return False;
- if (!smb_io_buffer4("buf_sec_desc", &info->buf_sec_desc,
- info->hdr_sec_desc.buffer, ps, depth))
+ if (!smb_io_rpc_blob("buf_sec_desc", &info->buf_sec_desc, ps, depth))
return False;
if(!prs_uint32("attribute_count", ps, depth, &info->attribute_count))
return False;
- info->attributes = talloc(ps->mem_ctx, sizeof(uint32) * info->attribute_count);
+ info->attributes = TALLOC_ARRAY(ps->mem_ctx, uint32, info->attribute_count);
for (i=0; i<info->attribute_count; i++)
if(!prs_uint32("attributes", ps, depth, &info->attributes[i]))
if(!prs_uint32("privlist_count", ps, depth, &info->privlist_count))
return False;
- info->hdr_privslist = talloc(ps->mem_ctx, sizeof(UNIHDR) * info->privlist_count);
- info->uni_privslist = talloc(ps->mem_ctx, sizeof(UNISTR2) * info->privlist_count);
+ info->hdr_privslist = TALLOC_ARRAY(ps->mem_ctx, UNIHDR, info->privlist_count);
+ info->uni_privslist = TALLOC_ARRAY(ps->mem_ctx, UNISTR2, info->privlist_count);
for (i=0; i<info->privlist_count; i++)
if(!smb_io_unihdr("hdr_privslist", &info->hdr_privslist[i], ps, depth))
if (!smb_io_unistr2("uni_privslist", &info->uni_privslist[i], True, ps, depth))
return False;
- if (!smb_io_buffer4("buf_sec_desc", &info->buf_sec_desc,
- info->hdr_sec_desc.buffer, ps, depth))
+ if (!smb_io_rpc_blob("buf_sec_desc", &info->buf_sec_desc, ps, depth))
return False;
return True;
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_delta_ctr(const char *desc, uint8 sess_key[16],
+static BOOL net_io_sam_delta_ctr(const char *desc,
SAM_DELTA_CTR * delta, uint16 type,
prs_struct *ps, int depth)
{
break;
case SAM_DELTA_ACCOUNT_INFO:
- if (!net_io_sam_account_info("", sess_key, &delta->account_info, ps, depth))
+ if (!net_io_sam_account_info("", &delta->account_info, ps, depth))
return False;
break;
/*******************************************************************
reads or writes a structure.
********************************************************************/
-BOOL net_io_r_sam_sync(const char *desc, uint8 sess_key[16],
+BOOL net_io_r_sam_sync(const char *desc,
NET_R_SAM_SYNC * r_s, prs_struct *ps, int depth)
{
uint32 i;
}
if (r_s->num_deltas2 > 0) {
- r_s->hdr_deltas = (SAM_DELTA_HDR *)
- talloc(ps->mem_ctx, r_s->num_deltas2 *
- sizeof(SAM_DELTA_HDR));
-
+ r_s->hdr_deltas = TALLOC_ARRAY(ps->mem_ctx, SAM_DELTA_HDR, r_s->num_deltas2);
if (r_s->hdr_deltas == NULL) {
DEBUG(0, ("error tallocating memory "
"for %d delta headers\n",
}
if (r_s->num_deltas2 > 0) {
- r_s->deltas = (SAM_DELTA_CTR *)
- talloc(ps->mem_ctx, r_s->num_deltas2 *
- sizeof(SAM_DELTA_CTR));
-
+ r_s->deltas = TALLOC_ARRAY(ps->mem_ctx, SAM_DELTA_CTR, r_s->num_deltas2);
if (r_s->deltas == NULL) {
DEBUG(0, ("error tallocating memory "
"for %d deltas\n",
for (i = 0; i < r_s->num_deltas2; i++)
{
if (!net_io_sam_delta_ctr(
- "", sess_key, &r_s->deltas[i],
+ "", &r_s->deltas[i],
r_s->hdr_deltas[i].type3,
ps, depth)) {
DEBUG(0, ("hmm, failed on i=%d\n", i));
/*******************************************************************
reads or writes a structure.
********************************************************************/
-BOOL net_io_r_sam_deltas(const char *desc, uint8 sess_key[16],
+BOOL net_io_r_sam_deltas(const char *desc,
NET_R_SAM_DELTAS *r_s, prs_struct *ps, int depth)
{
unsigned int i;
if (r_s->ptr_deltas != 0)
{
if (r_s->num_deltas > 0) {
- r_s->hdr_deltas = (SAM_DELTA_HDR *)
- talloc(ps->mem_ctx, r_s->num_deltas *
- sizeof(SAM_DELTA_HDR));
+ r_s->hdr_deltas = TALLOC_ARRAY(ps->mem_ctx, SAM_DELTA_HDR, r_s->num_deltas);
if (r_s->hdr_deltas == NULL) {
DEBUG(0, ("error tallocating memory "
"for %d delta headers\n",
}
if (r_s->num_deltas > 0) {
- r_s->deltas = (SAM_DELTA_CTR *)
- talloc(ps->mem_ctx, r_s->num_deltas *
- sizeof(SAM_DELTA_CTR));
-
+ r_s->deltas = TALLOC_ARRAY(ps->mem_ctx, SAM_DELTA_CTR, r_s->num_deltas);
if (r_s->deltas == NULL) {
DEBUG(0, ("error tallocating memory "
"for %d deltas\n",
for (i = 0; i < r_s->num_deltas; i++)
{
if (!net_io_sam_delta_ctr(
- "", sess_key,
+ "",
&r_s->deltas[i],
r_s->hdr_deltas[i].type2,
ps, depth))