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

Add support for enabling/disabling encryption - fixes #289

Location:
branches/client-3.0/src
Files:
6 edited

Legend:

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

    r1002 r1006  
    112112        {ND_PROP_ULONG, 0, "KRB5SUPPORT", "0"},
    113113        {ND_PROP_ULONG, 0, "NTLMv1SUPPORT", "0"},
     114        {ND_PROP_ULONG, 0, "ENCRYPTIONSUPPORT", "0"},
    114115        {ND_PROP_STRING, 0, NULL, NULL}
    115116};
     
    368369        pRes->krb5support = 0;
    369370        pRes->ntlmv1support = 0;
     371        pRes->encryptionsupport = 0;
    370372        pRes->pdc = NULL;
    371373
     
    498500                }
    499501        }
    500 
     502        t = 0;
     503        rc = ph->fsphQueryUlongProperty (properties, "ENCRYPTIONSUPPORT", &t);
     504        if (!rc)
     505        {
     506                if (t > 1)
     507                {
     508                        rc = ERROR_INVALID_PARAMETER;
     509                }
     510                else
     511                {
     512                        pRes->encryptionsupport = t;
     513                }
     514        }
    501515        t = 0;
    502516        rc = ph->fsphQueryUlongProperty (properties, "CTO", &t);
  • branches/client-3.0/src/rc/rc.dlg

    r931 r1006  
    3030                        WS_VISIBLE
    3131        ENTRYFIELD      "", ENT_MASTER, 147, 60, 90, 8, ES_MARGIN
    32         LTEXT           "Supports EA", LBL_EASUPPORT, 195, 130, 52, 10,
     32        LTEXT           "Supports EA", LBL_EASUPPORT, 190, 130, 52, 10,
    3333                        DT_WORDBREAK
    3434        AUTOCHECKBOX    "", CHK_EASUPPORT, 180, 132, 10, 10, WS_GROUP
    35         LTEXT           "Supports KRB5", LBL_KRB5SUPPORT, 195, 140, 52, 10,
     35        LTEXT           "Supports KRB5", LBL_KRB5SUPPORT, 190, 140, 52, 10,
    3636                        DT_WORDBREAK
    3737        AUTOCHECKBOX    "", CHK_KRB5SUPPORT, 180, 142, 10, 10, WS_GROUP
    38         LTEXT           "Support NTLMv1", LBL_NTLMv1SUPPORT, 195, 150, 52, 10,
     38        LTEXT           "Support NTLMv1", LBL_NTLMv1SUPPORT, 190, 150, 52, 10,
    3939                        DT_WORDBREAK
    4040        AUTOCHECKBOX    "", CHK_NTLMv1SUPPORT, 180, 152, 10, 10, WS_GROUP
     41        LTEXT           "Support Encryption", LBL_ENCRYPTIONSUPPORT, 190, 160, 58, 10,
     42                        DT_WORDBREAK
     43        AUTOCHECKBOX    "", CHK_ENCRYPTIONSUPPORT, 180, 162, 10, 10, WS_GROUP
    4144        PUSHBUTTON      "Cancel", DID_CANCEL, 7, 6, 56, 14
    4245                        PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold"
  • branches/client-3.0/src/rc/rc.h

    r931 r1006  
    2727#define LBL_NTLMv1SUPPORT               1030
    2828#define CHK_NTLMv1SUPPORT               1031
     29#define LBL_ENCRYPTIONSUPPORT               1032
     30#define CHK_ENCRYPTIONSUPPORT               1033
    2931#define LBL_CACHETIMEOUT        1014
    3032#define SPIN_CACHETIMEOUT       1015
  • branches/client-3.0/src/rc/rc.rc_

    r935 r1006  
    4747   "    master - name of master server or master workgroup\r\n"
    4848   "    mastertype - 0 if 'master' is the name of master server, 1 if 'master' is the name of master workgroup\r\n"
     49   "    encryption - 0 to not support encryption (default), 1 to support\r\n"
     50   "    NTLMv1 auth support - 0 to not support NTLMv1 authentication (default), 1 to support\r\n"
     51   "    krb5support - 0 to not support kerberos authentication, 1 to support\r\n"
    4952   "    easupport - 0 to not support EA, 1 to support\r\n"
    50    "    krb5support - 0 to not support kerberos authentication, 1 to support\r\n"
    51    "    NTLMv1 auth support - 0 to not support NTLMv1 authentication (default), 1 to support\r\n"
    5253   "\r\n"
    5354}
     
    136137RCDATA (DLG_ID + 13)
    137138{
     139    CHK_ENCRYPTIONSUPPORT, PARMTYPE_INT, 0L, 1L, "encryptionsupport", "%d", 0L
     140}
     141
     142RCDATA (DLG_ID + 14)
     143{
    138144    1
    139145}
  • 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
  • branches/client-3.0/src/smbwrp.h

    r933 r1006  
    141141        int krb5support;
    142142        int ntlmv1support;
     143        int encryptionsupport;
    143144        int cachetimeout;
    144145        int cachedepth;
Note: See TracChangeset for help on using the changeset viewer.