Ignore:
Timestamp:
Jan 15, 2017, 9:08:12 AM (9 years ago)
Author:
Paul Smedley
Message:

Add support for enabling/disabling encryption - fixes #289

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/client-3.0/src/smbwrp.c

    r1003 r1006  
    247247        int name_type= 0x20;
    248248        int flags = 0;
     249        int signing_state = SMB_SIGNING_DEFAULT;
    249250        enum protocol_types protocol;
    250251        const char *name = NULL;
     
    263264        }
    264265
     266        if (pRes->encryptionsupport) {
     267                signing_state = SMB_SIGNING_REQUIRED;
     268        }
     269
    265270        status = cli_connect_nb(
    266271                server, NULL, port, name_type, NULL,
    267                 SMB_SIGNING_DEFAULT, flags, &c);
     272                signing_state, flags, &c);
    268273
    269274        if (!NT_STATUS_IS_OK(status)) {
     
    417422                cli_shutdown(c);
    418423                return status;
     424        }
     425
     426        if (pRes->encryptionsupport) {
     427        debuglocal(4,"Attempting to force encryption\n");
     428                status = cli_cm_force_encryption(c,
     429                                        srv->username,
     430                                        srv->password,
     431                                        workgroup,
     432                                        share);
     433                if (!NT_STATUS_IS_OK(status)) {
     434                        debuglocal(4,"cli_cm_force_encryption failed: %s\n", nt_errstr(status));
     435                        cli_shutdown(c);
     436                        return status;
     437                }
     438        debuglocal(4,"Forcing encryption succeeded!\n");
    419439        }
    420440
Note: See TracChangeset for help on using the changeset viewer.