]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2016-2115: s3:libsmb: add signing constant SMB_SIGNING_IPC_DEFAULT
authorRalph Boehme <slow@samba.org>
Wed, 16 Dec 2015 08:55:37 +0000 (09:55 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 30 Mar 2016 02:08:00 +0000 (04:08 +0200)
SMB_SIGNING_IPC_DEFAULT must be used from s3 client code when opening
RPC connections.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11756

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/param/loadparm.c
libcli/smb/smbXcli_base.c
libcli/smb/smb_constants.h
source3/libsmb/clientgen.c
source4/smb_server/smb2/negprot.c

index 13835f1a12bcf9b503c3307229698fa604124054..b2159b6d9c9c783861b2a264cd0e8ced8ebd1524 100644 (file)
@@ -3255,10 +3255,13 @@ bool lpcfg_server_signing_allowed(struct loadparm_context *lp_ctx, bool *mandato
        case SMB_SIGNING_DESIRED:
        case SMB_SIGNING_IF_REQUIRED:
                break;
-       case SMB_SIGNING_DEFAULT:
        case SMB_SIGNING_OFF:
                allowed = false;
                break;
+       case SMB_SIGNING_DEFAULT:
+       case SMB_SIGNING_IPC_DEFAULT:
+               smb_panic(__location__);
+               break;
        }
 
        return allowed;
index b00afbc2d5af2912b2efed10845f6715e303e8cf..7bf48c80437f8b96604cda49a594301327e6d726 100644 (file)
@@ -363,6 +363,7 @@ struct smbXcli_conn *smbXcli_conn_create(TALLOC_CTX *mem_ctx,
                conn->desire_signing = true;
                conn->mandatory_signing = false;
                break;
+       case SMB_SIGNING_IPC_DEFAULT:
        case SMB_SIGNING_REQUIRED:
                /* always */
                conn->allow_signing = true;
index 9b570782b64f664e2262f2794de931f122d650e1..c68c9b34d3c7282ad067ab3ff4eaf884141bc06e 100644 (file)
@@ -93,6 +93,7 @@ enum protocol_types {
 #define PROTOCOL_LATEST PROTOCOL_SMB3_02
 
 enum smb_signing_setting {
+       SMB_SIGNING_IPC_DEFAULT = -2, /* Only used in C code */
        SMB_SIGNING_DEFAULT = -1,
        SMB_SIGNING_OFF = 0,
        SMB_SIGNING_IF_REQUIRED = 1,
index 6bed5105b0280acc623cbe6d3df327ad6304c226..79e1392c5db95a63700659a43406a1bb4bacb883 100644 (file)
@@ -231,6 +231,15 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
                use_level_II_oplocks = true;
        }
 
+       if (signing_state == SMB_SIGNING_IPC_DEFAULT) {
+               /*
+                * Ensure for IPC/RPC the default is to require
+                * signing unless explicitly turned off by the
+                * administrator.
+                */
+               signing_state = lp_client_ipc_signing();
+       }
+
        if (signing_state == SMB_SIGNING_DEFAULT) {
                signing_state = lp_client_signing();
        }
index e654392ccbf503478edd8270db0de0a14ee1c651..addd278eb4c2068a3448274139975a564abbc0b2 100644 (file)
@@ -147,6 +147,7 @@ static NTSTATUS smb2srv_negprot_backend(struct smb2srv_request *req, struct smb2
 
        switch (signing_setting) {
        case SMB_SIGNING_DEFAULT:
+       case SMB_SIGNING_IPC_DEFAULT:
                smb_panic(__location__);
                break;
        case SMB_SIGNING_OFF: