Ignore:
Timestamp:
Mar 12, 2008, 9:08:18 AM (17 years ago)
Author:
Paul Smedley
Message:

Update source to 3.0.28a

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/libsmb/smb_signing.c

    r1 r124  
    2727        uint16 mid;
    2828        uint32 reply_seq_num;
    29         BOOL can_delete; /* Set to False in trans state. */
    3029};
    3130
     
    4443        for (t = *list; t; t = t->next) {
    4544                if (t->mid == mid) {
    46                         return False;
     45                        DLIST_REMOVE(*list, t);
     46                        SAFE_FREE(t);
     47                        break;
    4748                }
    4849        }
     
    5354        t->mid = mid;
    5455        t->reply_seq_num = reply_seq_num;
    55         t->can_delete = True;
    5656
    5757        /*
     
    8080                        DEBUG(10,("get_sequence_for_reply: found seq = %u mid = %u\n",
    8181                                (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);
    9984                        return True;
    10085                }
     
    605590
    606591/***********************************************************
    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 /***********************************************************
    661592 SMB signing - Server implementation - send the MAC.
    662593************************************************************/
Note: See TracChangeset for help on using the changeset viewer.