Changeset 124 for branches/samba-3.0/source/libsmb/smb_signing.c
- Timestamp:
- Mar 12, 2008, 9:08:18 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/libsmb/smb_signing.c
r1 r124 27 27 uint16 mid; 28 28 uint32 reply_seq_num; 29 BOOL can_delete; /* Set to False in trans state. */30 29 }; 31 30 … … 44 43 for (t = *list; t; t = t->next) { 45 44 if (t->mid == mid) { 46 return False; 45 DLIST_REMOVE(*list, t); 46 SAFE_FREE(t); 47 break; 47 48 } 48 49 } … … 53 54 t->mid = mid; 54 55 t->reply_seq_num = reply_seq_num; 55 t->can_delete = True;56 56 57 57 /* … … 80 80 DEBUG(10,("get_sequence_for_reply: found seq = %u mid = %u\n", 81 81 (unsigned int)t->reply_seq_num, (unsigned int)t->mid )); 82 if (t->can_delete) { 83 DLIST_REMOVE(*list, t); 84 SAFE_FREE(t); 85 } 86 return True; 87 } 88 } 89 return False; 90 } 91 92 static BOOL set_sequence_can_delete_flag(struct outstanding_packet_lookup **list, uint16 mid, BOOL can_delete_entry) 93 { 94 struct outstanding_packet_lookup *t; 95 96 for (t = *list; t; t = t->next) { 97 if (t->mid == mid) { 98 t->can_delete = can_delete_entry; 82 DLIST_REMOVE(*list, t); 83 SAFE_FREE(t); 99 84 return True; 100 85 } … … 605 590 606 591 /*********************************************************** 607 Enter trans/trans2/nttrans state.608 ************************************************************/609 610 BOOL client_set_trans_sign_state_on(struct cli_state *cli, uint16 mid)611 {612 struct smb_sign_info *si = &cli->sign_info;613 struct smb_basic_signing_context *data = (struct smb_basic_signing_context *)si->signing_context;614 615 if (!si->doing_signing) {616 return True;617 }618 619 if (!data) {620 return False;621 }622 623 if (!set_sequence_can_delete_flag(&data->outstanding_packet_list, mid, False)) {624 return False;625 }626 627 return True;628 }629 630 /***********************************************************631 Leave trans/trans2/nttrans state.632 ************************************************************/633 634 BOOL client_set_trans_sign_state_off(struct cli_state *cli, uint16 mid)635 {636 uint32 reply_seq_num;637 struct smb_sign_info *si = &cli->sign_info;638 struct smb_basic_signing_context *data = (struct smb_basic_signing_context *)si->signing_context;639 640 if (!si->doing_signing) {641 return True;642 }643 644 if (!data) {645 return False;646 }647 648 if (!set_sequence_can_delete_flag(&data->outstanding_packet_list, mid, True)) {649 return False;650 }651 652 /* Now delete the stored mid entry. */653 if (!get_sequence_for_reply(&data->outstanding_packet_list, mid, &reply_seq_num)) {654 return False;655 }656 657 return True;658 }659 660 /***********************************************************661 592 SMB signing - Server implementation - send the MAC. 662 593 ************************************************************/
Note:
See TracChangeset
for help on using the changeset viewer.