libcli/raw: give the caller the chance to do the signing checks on its own.
authorStefan Metzmacher <metze@samba.org>
Tue, 9 Sep 2008 15:54:13 +0000 (17:54 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 9 Sep 2008 19:11:23 +0000 (21:11 +0200)
metze

source/libcli/raw/libcliraw.h
source/libcli/raw/smb_signing.c

index c9cafedd4c9105f9d7293de76c54fa0c819cad58..bd9bda0db1b120001b7eceaa32fe35a8d50f11d3 100644 (file)
@@ -261,6 +261,9 @@ struct smbcli_request {
           counter by one */
        uint_t sign_single_increment:1;
 
+       /* the caller wants to do the signing check */
+       bool sign_caller_checks;
+
        /* give the caller a chance to prevent the talloc_free() in the _recv() function */
        bool do_not_free;
 
index 1d03686d9ab67e8fb033cb6dc33913f9e8fa7f7f..ae17dadf33560f072377609ca9ed848341f3a8f6 100644 (file)
@@ -298,6 +298,13 @@ bool smbcli_request_check_sign_mac(struct smbcli_request *req)
 {
        bool good;
 
+       if (!req->transport->negotiate.sign_info.doing_signing &&
+           req->sign_caller_checks) {
+               return true;
+       }
+
+       req->sign_caller_checks = false;
+
        switch (req->transport->negotiate.sign_info.signing_state) 
        {
        case SMB_SIGNING_ENGINE_OFF: