Changeset 134 for branches/samba-3.0/source/libsmb/smb_signing.c
- Timestamp:
- May 23, 2008, 6:56:41 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/libsmb/smb_signing.c
r124 r134 27 27 uint16 mid; 28 28 uint32 reply_seq_num; 29 BOOL can_delete; /* Set to False in trans state. */ 29 30 }; 30 31 … … 43 44 for (t = *list; t; t = t->next) { 44 45 if (t->mid == mid) { 45 DLIST_REMOVE(*list, t); 46 SAFE_FREE(t); 47 break; 46 return False; 48 47 } 49 48 } … … 54 53 t->mid = mid; 55 54 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 DLIST_REMOVE(*list, t); 83 SAFE_FREE(t); 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; 84 99 return True; 85 100 } … … 590 605 591 606 /*********************************************************** 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 /*********************************************************** 592 661 SMB signing - Server implementation - send the MAC. 593 662 ************************************************************/
Note:
See TracChangeset
for help on using the changeset viewer.