Ignore:
Timestamp:
Nov 29, 2012, 2:06:31 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.9 2nd part

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/libcli/auth/ntlm_check.c

    r745 r752  
    8888                                 const DATA_BLOB *sec_blob,
    8989                                 const char *user, const char *domain,
    90                                  bool upper_case_domain, /* should the domain be transformed into upper case? */
    9190                                 DATA_BLOB *user_sess_key)
    9291{
     
    123122        */
    124123
    125         if (!ntv2_owf_gen(part_passwd, user, domain, upper_case_domain, kr)) {
     124        if (!ntv2_owf_gen(part_passwd, user, domain, kr)) {
    126125                return false;
    127126        }
     
    162161                                const DATA_BLOB *sec_blob,
    163162                                const char *user, const char *domain,
    164                                 bool upper_case_domain, /* should the domain be transformed into upper case? */
    165163                                DATA_BLOB *user_sess_key)
    166164{
     
    193191        client_key_data = data_blob_talloc(mem_ctx, ntv2_response->data+16, ntv2_response->length-16);
    194192
    195         if (!ntv2_owf_gen(part_passwd, user, domain, upper_case_domain, kr)) {
     193        if (!ntv2_owf_gen(part_passwd, user, domain, kr)) {
    196194                return false;
    197195        }
     
    298296        const static uint8_t zeros[8];
    299297        DATA_BLOB tmp_sess_key;
     298        const char *upper_client_domain = NULL;
     299
     300        if (client_domain != NULL) {
     301                upper_client_domain = talloc_strdup_upper(mem_ctx, client_domain);
     302                if (upper_client_domain == NULL) {
     303                        return NT_STATUS_NO_MEMORY;
     304                }
     305        }
    300306
    301307        if (stored_nt == NULL) {
     
    349355                   use it
    350356                */
    351                 DEBUG(4,("ntlm_password_check: Checking NTLMv2 password with domain [%s]\n", client_domain));
     357                DEBUG(4,("ntlm_password_check: Checking NTLMv2 password with domain [%s]\n",
     358                        client_domain ? client_domain : "<NULL>"));
    352359                if (smb_pwd_check_ntlmv2(mem_ctx,
    353360                                         nt_response,
     
    355362                                         client_username,
    356363                                         client_domain,
    357                                          false,
    358364                                         user_sess_key)) {
    359365                        if (user_sess_key->length) {
     
    363369                }
    364370
    365                 DEBUG(4,("ntlm_password_check: Checking NTLMv2 password with uppercased version of domain [%s]\n", client_domain));
     371                DEBUG(4,("ntlm_password_check: Checking NTLMv2 password with uppercased version of domain [%s]\n",
     372                        upper_client_domain ? upper_client_domain : "<NULL>"));
    366373                if (smb_pwd_check_ntlmv2(mem_ctx,
    367374                                         nt_response,
    368375                                         stored_nt->hash, challenge,
    369376                                         client_username,
    370                                          client_domain,
    371                                          true,
     377                                         upper_client_domain,
    372378                                         user_sess_key)) {
    373379                        if (user_sess_key->length) {
     
    383389                                         client_username,
    384390                                         "",
    385                                          false,
    386391                                         user_sess_key)) {
    387392                        if (user_sess_key->length) {
     
    471476           - related to Win9X, legacy NAS pass-though authentication
    472477        */
    473         DEBUG(4,("ntlm_password_check: Checking LMv2 password with domain %s\n", client_domain));
     478        DEBUG(4,("ntlm_password_check: Checking LMv2 password with domain %s\n",
     479                client_domain ? client_domain : "<NULL>"));
    474480        if (smb_pwd_check_ntlmv2(mem_ctx,
    475481                                 lm_response,
     
    477483                                 client_username,
    478484                                 client_domain,
    479                                  false,
    480485                                 &tmp_sess_key)) {
    481486                if (nt_response->length > 24) {
     
    489494                                            client_username,
    490495                                            client_domain,
    491                                             false,
    492496                                            user_sess_key);
    493497                } else {
     
    501505        }
    502506
    503         DEBUG(4,("ntlm_password_check: Checking LMv2 password with upper-cased version of domain %s\n", client_domain));
     507        DEBUG(4,("ntlm_password_check: Checking LMv2 password with upper-cased version of domain %s\n",
     508                upper_client_domain ? upper_client_domain : "<NULL>"));
    504509        if (smb_pwd_check_ntlmv2(mem_ctx,
    505510                                 lm_response,
    506511                                 stored_nt->hash, challenge,
    507512                                 client_username,
    508                                  client_domain,
    509                                  true,
     513                                 upper_client_domain,
    510514                                 &tmp_sess_key)) {
    511515                if (nt_response->length > 24) {
     
    518522                                            stored_nt->hash, challenge,
    519523                                            client_username,
    520                                             client_domain,
    521                                             true,
     524                                            upper_client_domain,
    522525                                            user_sess_key);
    523526                } else {
     
    537540                                 client_username,
    538541                                 "",
    539                                  false,
    540542                                 &tmp_sess_key)) {
    541543                if (nt_response->length > 24) {
     
    549551                                            client_username,
    550552                                            "",
    551                                             false,
    552553                                            user_sess_key);
    553554                } else {
Note: See TracChangeset for help on using the changeset viewer.