r69: Global rename of 'nt_session_key' -> 'user_session_key'. The session key could
authorAndrew Bartlett <abartlet@samba.org>
Tue, 6 Apr 2004 08:11:16 +0000 (08:11 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:51:06 +0000 (10:51 -0500)
be anything, and may not be based on anything 'NT'.  This is also what microsoft
calls it.
(This used to be commit 724e8d3f33719543146280062435c69a835c491e)

12 files changed:
source3/auth/auth_ntlmssp.c
source3/auth/auth_sam.c
source3/auth/auth_util.c
source3/include/auth.h
source3/libsmb/ntlmssp.c
source3/libsmb/smbencrypt.c
source3/nsswitch/winbindd_nss.h
source3/nsswitch/winbindd_pam.c
source3/rpc_parse/parse_net.c
source3/rpc_server/srv_netlog_nt.c
source3/smbd/sesssetup.c
source3/utils/ntlm_auth.c

index 498a7b1a39aa8e8e2df7b1ac9034fd2b4ed8f37a..4b425056b11bf1252c0f92ed0b1559b4b7b3cd0b 100644 (file)
@@ -75,7 +75,7 @@ static NTSTATUS auth_ntlmssp_set_challenge(struct ntlmssp_state *ntlmssp_state,
  * Return the session keys used on the connection.
  */
 
-static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *nt_session_key, DATA_BLOB *lm_session_key) 
+static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key) 
 {
        AUTH_NTLMSSP_STATE *auth_ntlmssp_state = ntlmssp_state->auth_context;
        auth_usersupplied_info *user_info = NULL;
@@ -113,11 +113,11 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state,
        if (!NT_STATUS_IS_OK(nt_status)) {
                return nt_status;
        }
-       if (auth_ntlmssp_state->server_info->nt_session_key.length) {
-               DEBUG(10, ("Got NT session key of length %u\n", auth_ntlmssp_state->server_info->nt_session_key.length));
-               *nt_session_key = data_blob_talloc(auth_ntlmssp_state->mem_ctx, 
-                                                  auth_ntlmssp_state->server_info->nt_session_key.data,
-                                                  auth_ntlmssp_state->server_info->nt_session_key.length);
+       if (auth_ntlmssp_state->server_info->user_session_key.length) {
+               DEBUG(10, ("Got NT session key of length %u\n", auth_ntlmssp_state->server_info->user_session_key.length));
+               *user_session_key = data_blob_talloc(auth_ntlmssp_state->mem_ctx, 
+                                                  auth_ntlmssp_state->server_info->user_session_key.data,
+                                                  auth_ntlmssp_state->server_info->user_session_key.length);
        }
        if (auth_ntlmssp_state->server_info->lm_session_key.length) {
                DEBUG(10, ("Got LM session key of length %u\n", auth_ntlmssp_state->server_info->lm_session_key.length));
index 5efc51b21ae4634c9f7716596f507b43436ab896..2f9ff6265c9913c0d1abca0b91d67cd2d42ca578 100644 (file)
@@ -261,7 +261,7 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
                return nt_status;
        }
 
-       (*server_info)->nt_session_key = user_sess_key;
+       (*server_info)->user_session_key = user_sess_key;
        (*server_info)->lm_session_key = lm_sess_key;
 
        return nt_status;
index 9df587398378f15a48bd5640c13224d923c7ff7a..3f1ac9c9758342c8bf2b0646a7a75198e8007c9c 100644 (file)
@@ -912,7 +912,7 @@ NTSTATUS make_server_info_guest(auth_serversupplied_info **server_info)
                
                /* annoying, but the Guest really does have a session key, 
                   and it is all zeros! */
-               (*server_info)->nt_session_key = data_blob(zeros, sizeof(zeros));
+               (*server_info)->user_session_key = data_blob(zeros, sizeof(zeros));
                (*server_info)->lm_session_key = data_blob(zeros, sizeof(zeros));
        }
 
@@ -1276,9 +1276,9 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
        /* ensure we are never given NULL session keys */
        
        if (memcmp(info3->user_sess_key, zeros, sizeof(zeros)) == 0) {
-               (*server_info)->nt_session_key = data_blob(NULL, 0);
+               (*server_info)->user_session_key = data_blob(NULL, 0);
        } else {
-               (*server_info)->nt_session_key = data_blob(info3->user_sess_key, sizeof(info3->user_sess_key));
+               (*server_info)->user_session_key = data_blob(info3->user_sess_key, sizeof(info3->user_sess_key));
        }
 
        if (memcmp(info3->padding, zeros, sizeof(zeros)) == 0) {
@@ -1330,7 +1330,7 @@ void free_server_info(auth_serversupplied_info **server_info)
                SAFE_FREE((*server_info)->groups);
                SAFE_FREE((*server_info)->unix_name);
                data_blob_free(&(*server_info)->lm_session_key);
-               data_blob_free(&(*server_info)->nt_session_key);
+               data_blob_free(&(*server_info)->user_session_key);
                ZERO_STRUCT(**server_info);
        }
        SAFE_FREE(*server_info);
index 8f52512e6a05dd37ba154962b91fdc289833d231..188cf58643dff733a3412f3e13be244295828b0f 100644 (file)
@@ -67,7 +67,7 @@ typedef struct auth_serversupplied_info
        
        NT_USER_TOKEN *ptok;
        
-       DATA_BLOB nt_session_key;
+       DATA_BLOB user_session_key;
        DATA_BLOB lm_session_key;
        
        uint32 sam_fill_level;  /* How far is this structure filled? */
index ddc2e0325fd80712ba87303d351e2a374043e1c0..7f451176ecd1c8c57e4d322179ac5fcd391f4b8c 100644 (file)
@@ -500,7 +500,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
                                    const DATA_BLOB request, DATA_BLOB *reply) 
 {
        DATA_BLOB encrypted_session_key = data_blob(NULL, 0);
-       DATA_BLOB nt_session_key = data_blob(NULL, 0);
+       DATA_BLOB user_session_key = data_blob(NULL, 0);
        DATA_BLOB lm_session_key = data_blob(NULL, 0);
        DATA_BLOB session_key = data_blob(NULL, 0);
        uint32 ntlmssp_command, auth_flags;
@@ -663,19 +663,19 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
        /* Finally, actually ask if the password is OK */
 
        if (!NT_STATUS_IS_OK(nt_status = ntlmssp_state->check_password(ntlmssp_state, 
-                                                                      &nt_session_key, &lm_session_key))) {
+                                                                      &user_session_key, &lm_session_key))) {
                data_blob_free(&encrypted_session_key);
                return nt_status;
        }
 
-       dump_data_pw("NT session key:\n", nt_session_key.data, nt_session_key.length);
+       dump_data_pw("NT session key:\n", user_session_key.data, user_session_key.length);
        dump_data_pw("LM first-8:\n", lm_session_key.data, lm_session_key.length);
 
        /* Handle the different session key derivation for NTLM2 */
        if (doing_ntlm2) {
-               if (nt_session_key.data && nt_session_key.length == 16) {
+               if (user_session_key.data && user_session_key.length == 16) {
                        session_key = data_blob_talloc(ntlmssp_state->mem_ctx, NULL, 16);
-                       hmac_md5(nt_session_key.data, session_nonce, 
+                       hmac_md5(user_session_key.data, session_nonce, 
                                 sizeof(session_nonce), session_key.data);
                        DEBUG(10,("ntlmssp_server_auth: Created NTLM2 session key.\n"));
                        dump_data_pw("NTLM2 session key:\n", session_key.data, session_key.length);
@@ -702,8 +702,8 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
                        DEBUG(10,("ntlmssp_server_auth: Failed to create NTLM session key.\n"));
                        session_key = data_blob(NULL, 0);
                }
-       } else if (nt_session_key.data) {
-               session_key = nt_session_key;
+       } else if (user_session_key.data) {
+               session_key = user_session_key;
                DEBUG(10,("ntlmssp_server_auth: Using unmodified nt session key.\n"));
                dump_data_pw("unmodified session key:\n", session_key.data, session_key.length);
        } else if (lm_session_key.data) {
@@ -958,7 +958,7 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
                uchar nt_hash[16];
                uchar session_nonce[16];
                uchar session_nonce_hash[16];
-               uchar nt_session_key[16];
+               uchar user_session_key[16];
                E_md4hash(ntlmssp_state->password, nt_hash);
                
                lm_response = data_blob_talloc(ntlmssp_state->mem_ctx, NULL, 24);
@@ -984,8 +984,8 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
 
                session_key = data_blob_talloc(ntlmssp_state->mem_ctx, NULL, 16);
 
-               SMBsesskeygen_ntv1(nt_hash, NULL, nt_session_key);
-               hmac_md5(nt_session_key, session_nonce, sizeof(session_nonce), session_key.data);
+               SMBsesskeygen_ntv1(nt_hash, NULL, user_session_key);
+               hmac_md5(user_session_key, session_nonce, sizeof(session_nonce), session_key.data);
                dump_data_pw("NTLM2 session key:\n", session_key.data, session_key.length);
        } else {
                
index 270a659e57fba818c8e0889c5af43c3856f8d3c5..3b8a375bea5927724e230271015e5b36fe454611 100644 (file)
@@ -420,7 +420,7 @@ BOOL SMBNTLMv2encrypt(const char *user, const char *domain, const char *password
                      const DATA_BLOB *server_chal, 
                      const DATA_BLOB *names_blob,
                      DATA_BLOB *lm_response, DATA_BLOB *nt_response, 
-                     DATA_BLOB *nt_session_key) 
+                     DATA_BLOB *user_session_key) 
 {
        uchar nt_hash[16];
        uchar ntlm_v2_hash[16];
@@ -437,12 +437,12 @@ BOOL SMBNTLMv2encrypt(const char *user, const char *domain, const char *password
        if (nt_response) {
                *nt_response = NTLMv2_generate_response(ntlm_v2_hash, server_chal,
                                                        names_blob); 
-               if (nt_session_key) {
-                       *nt_session_key = data_blob(NULL, 16);
+               if (user_session_key) {
+                       *user_session_key = data_blob(NULL, 16);
                        
                        /* The NTLMv2 calculations also provide a session key, for signing etc later */
                        /* use only the first 16 bytes of nt_response for session key */
-                       SMBsesskeygen_ntv2(ntlm_v2_hash, nt_response->data, nt_session_key->data);
+                       SMBsesskeygen_ntv2(ntlm_v2_hash, nt_response->data, user_session_key->data);
                }
        }
        
index c8fe5c826c144883a5cd24e55976ab6e7efc6089..d0c80412dfe9afcea1b87451bc9e36e49a50ee40 100644 (file)
@@ -150,7 +150,7 @@ typedef struct winbindd_gr {
 
 #define WBFLAG_PAM_INFO3_NDR           0x0001
 #define WBFLAG_PAM_INFO3_TEXT          0x0002
-#define WBFLAG_PAM_NTKEY               0x0004
+#define WBFLAG_PAM_USER_SESSION_KEY     0x0004
 #define WBFLAG_PAM_LMKEY               0x0008
 #define WBFLAG_PAM_CONTACT_TRUSTDOM    0x0010
 #define WBFLAG_QUERY_ONLY              0x0020
@@ -264,7 +264,7 @@ struct winbindd_response {
                        fstring nt_status_string;
                        fstring error_string;
                        int pam_error;
-                       char nt_session_key[16];
+                       char user_session_key[16];
                        char first_8_lm_hash[8];
                } auth;
                uint32 rid;     /* create user or group */
index 1d232edfe3100cfa2bf87c9be12b07b98c69d59e..f3e7daa6bf469d3cd6460a3d91c974d7c1b0ba6d 100644 (file)
@@ -464,8 +464,8 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
                        state->response.length +=  strlen(state->response.extra_data)+1;
                }
                
-               if (state->request.flags & WBFLAG_PAM_NTKEY) {
-                       memcpy(state->response.data.auth.nt_session_key, info3.user_sess_key, sizeof(state->response.data.auth.nt_session_key) /* 16 */);
+               if (state->request.flags & WBFLAG_PAM_USER_SESSION_KEY) {
+                       memcpy(state->response.data.auth.user_session_key, info3.user_sess_key, sizeof(state->response.data.auth.user_session_key) /* 16 */);
                }
                if (state->request.flags & WBFLAG_PAM_LMKEY) {
                        memcpy(state->response.data.auth.first_8_lm_hash, info3.padding, sizeof(state->response.data.auth.first_8_lm_hash) /* 8 */);
index a98738b51f0adbe45754ae770f42fca7d70b2ecc..36d55c7bf675d20793e7c88ffcb96501657a944c 100644 (file)
@@ -1349,7 +1349,7 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr,
                         
                         uint16 logon_count, uint16 bad_pw_count,
                         uint32 num_groups, const DOM_GID *gids,
-                        uint32 user_flgs, uchar nt_session_key[16],
+                        uint32 user_flgs, uchar user_session_key[16],
                         uchar lm_session_key[16],
                         const char *logon_srv, const char *logon_dom,
                         const DOM_SID *dom_sid, const char *other_sids)
@@ -1392,8 +1392,8 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr,
        usr->buffer_groups = 1; /* indicates fill in groups, below, even if there are none */
        usr->user_flgs = user_flgs;
 
-       if (nt_session_key != NULL)
-               memcpy(usr->user_sess_key, nt_session_key, sizeof(usr->user_sess_key));
+       if (user_session_key != NULL)
+               memcpy(usr->user_sess_key, user_session_key, sizeof(usr->user_sess_key));
        else
                memset((char *)usr->user_sess_key, '\0', sizeof(usr->user_sess_key));
 
index bf0e81f5c82aa4e65818ea83eb334beb2a9e30f0..e3f687be1322357c118bd92172cc25bf83b8609d 100644 (file)
@@ -691,7 +691,7 @@ NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *
                pstring my_name;
                fstring user_sid_string;
                fstring group_sid_string;
-               uchar nt_session_key[16];
+               uchar user_session_key[16];
                uchar lm_session_key[16];
                uchar netlogon_sess_key[16];
 
@@ -727,10 +727,10 @@ NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *
 
                ZERO_STRUCT(netlogon_sess_key);
                memcpy(netlogon_sess_key, p->dc.sess_key, 8);
-               if (server_info->nt_session_key.length) {
-                       memcpy(nt_session_key, server_info->nt_session_key.data, 
-                              MIN(sizeof(nt_session_key), server_info->nt_session_key.length));
-                       SamOEMhash(nt_session_key, netlogon_sess_key, 16);
+               if (server_info->user_session_key.length) {
+                       memcpy(user_session_key, server_info->user_session_key.data, 
+                              MIN(sizeof(user_session_key), server_info->user_session_key.length));
+                       SamOEMhash(user_session_key, netlogon_sess_key, 16);
                }
                if (server_info->lm_session_key.length) {
                        memcpy(lm_session_key, server_info->lm_session_key.data, 
@@ -760,7 +760,7 @@ NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *
                                    num_gids,    /* uint32 num_groups */
                                    gids    , /* DOM_GID *gids */
                                    0x20    , /* uint32 user_flgs (?) */
-                                   server_info->nt_session_key.length ? nt_session_key : NULL,
+                                   server_info->user_session_key.length ? user_session_key : NULL,
                                    server_info->lm_session_key.length ? lm_session_key : NULL,
                                    my_name     , /* char *logon_srv */
                                    pdb_get_domain(sampw),
@@ -768,7 +768,7 @@ NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *
                                    /* Should be users domain sid, not servers - for trusted domains */
                                  
                                    NULL); /* char *other_sids */
-               ZERO_STRUCT(nt_session_key);
+               ZERO_STRUCT(user_session_key);
                ZERO_STRUCT(lm_session_key);
        }
        free_server_info(&server_info);
index abb9c24d41b462f2832985dcafe4f1b08dfd4d8a..902db2d2886094733ace1d98e2050cc84ae47325 100644 (file)
@@ -881,8 +881,8 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,
                return ERROR_NT(nt_status_squash(nt_status));
        }
 
-       if (server_info->nt_session_key.data) {
-               session_key = data_blob(server_info->nt_session_key.data, server_info->nt_session_key.length);
+       if (server_info->user_session_key.data) {
+               session_key = data_blob(server_info->user_session_key.data, server_info->user_session_key.length);
        } else {
                session_key = data_blob(NULL, 0);
        }
index e33bca363bf1a5712ff9c815d3475eeef88060de..c06290c24e8563b4dfc0f78cfb2c783af150a905 100644 (file)
@@ -297,11 +297,11 @@ static NTSTATUS contact_winbind_auth_crap(const char *username,
                memcpy(lm_key, response.data.auth.first_8_lm_hash, 
                        sizeof(response.data.auth.first_8_lm_hash));
        }
-       if ((flags & WBFLAG_PAM_NTKEY) && nt_key
-                   && (memcmp(zeros, response.data.auth.nt_session_key, 
-                              sizeof(response.data.auth.nt_session_key)) != 0)) {
-               memcpy(nt_key, response.data.auth.nt_session_key, 
-                       sizeof(response.data.auth.nt_session_key));
+       if ((flags & WBFLAG_PAM_USER_SESSION_KEY) && nt_key
+                   && (memcmp(zeros, response.data.auth.user_session_key, 
+                              sizeof(response.data.auth.user_session_key)) != 0)) {
+               memcpy(nt_key, response.data.auth.user_session_key, 
+                       sizeof(response.data.auth.user_session_key));
        }
 
        if (flags & WBFLAG_PAM_UNIX_NAME) {
@@ -313,7 +313,7 @@ static NTSTATUS contact_winbind_auth_crap(const char *username,
        return nt_status;
 }
                                   
-static NTSTATUS winbind_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *nt_session_key, DATA_BLOB *lm_session_key) 
+static NTSTATUS winbind_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key) 
 {
        static const char zeros[16];
        NTSTATUS nt_status;
@@ -327,7 +327,7 @@ static NTSTATUS winbind_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB
                                              &ntlmssp_state->chal,
                                              &ntlmssp_state->lm_resp,
                                              &ntlmssp_state->nt_resp, 
-                                             WBFLAG_PAM_LMKEY | WBFLAG_PAM_NTKEY | WBFLAG_PAM_UNIX_NAME,
+                                             WBFLAG_PAM_LMKEY | WBFLAG_PAM_USER_SESSION_KEY | WBFLAG_PAM_UNIX_NAME,
                                              lm_key, nt_key, 
                                              &error_string, &unix_name);
 
@@ -339,7 +339,7 @@ static NTSTATUS winbind_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB
                }
                
                if (memcmp(nt_key, zeros, 16) != 0) {
-                       *nt_session_key = data_blob(nt_key, 16);
+                       *user_session_key = data_blob(nt_key, 16);
                }
                ntlmssp_state->auth_context = talloc_strdup(ntlmssp_state->mem_ctx, unix_name);
                SAFE_FREE(unix_name);
@@ -352,7 +352,7 @@ static NTSTATUS winbind_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB
        return nt_status;
 }
 
-static NTSTATUS local_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *nt_session_key, DATA_BLOB *lm_session_key) 
+static NTSTATUS local_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key) 
 {
        static const char zeros[16];
        NTSTATUS nt_status;
@@ -370,7 +370,7 @@ static NTSTATUS local_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *n
                                        ntlmssp_state->user, 
                                        ntlmssp_state->user, 
                                        ntlmssp_state->domain,
-                                       lm_pw, nt_pw, nt_session_key, lm_session_key);
+                                       lm_pw, nt_pw, user_session_key, lm_session_key);
        
        if (NT_STATUS_IS_OK(nt_status)) {
                if (memcmp(lm_key, zeros, 8) != 0) {
@@ -380,7 +380,7 @@ static NTSTATUS local_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *n
                }
                
                if (memcmp(nt_key, zeros, 16) != 0) {
-                       *nt_session_key = data_blob(nt_key, 16);
+                       *user_session_key = data_blob(nt_key, 16);
                }
                ntlmssp_state->auth_context = talloc_asprintf(ntlmssp_state->mem_ctx, "%s%c%s", ntlmssp_state->domain, *lp_winbind_separator(), ntlmssp_state->user);
        } else {
@@ -1379,7 +1379,7 @@ static BOOL check_auth_crap(void)
                flags |= WBFLAG_PAM_LMKEY;
 
        if (request_nt_key) 
-               flags |= WBFLAG_PAM_NTKEY;
+               flags |= WBFLAG_PAM_USER_SESSION_KEY;
 
        nt_status = contact_winbind_auth_crap(opt_username, opt_domain, 
                                              opt_workstation,
@@ -1462,7 +1462,7 @@ static BOOL test_lm_ntlm_broken(enum ntlm_break break_which)
        ZERO_STRUCT(nt_key);
 
        flags |= WBFLAG_PAM_LMKEY;
-       flags |= WBFLAG_PAM_NTKEY;
+       flags |= WBFLAG_PAM_USER_SESSION_KEY;
 
        SMBencrypt(opt_password,chall.data,lm_response.data);
        E_deshash(opt_password, lm_hash); 
@@ -1582,7 +1582,7 @@ static BOOL test_ntlm_in_lm(void)
        ZERO_STRUCT(nt_key);
 
        flags |= WBFLAG_PAM_LMKEY;
-       flags |= WBFLAG_PAM_NTKEY;
+       flags |= WBFLAG_PAM_USER_SESSION_KEY;
 
        SMBNTencrypt(opt_password,chall.data,nt_response.data);
 
@@ -1651,7 +1651,7 @@ static BOOL test_ntlm_in_both(void)
        ZERO_STRUCT(nt_key);
 
        flags |= WBFLAG_PAM_LMKEY;
-       flags |= WBFLAG_PAM_NTKEY;
+       flags |= WBFLAG_PAM_USER_SESSION_KEY;
 
        SMBNTencrypt(opt_password,chall.data,nt_response.data);
        E_md4hash(opt_password, (unsigned char *)nt_hash);
@@ -1713,7 +1713,7 @@ static BOOL test_lmv2_ntlmv2_broken(enum ntlm_break break_which)
        uint32 flags = 0;
        DATA_BLOB ntlmv2_response = data_blob(NULL, 0);
        DATA_BLOB lmv2_response = data_blob(NULL, 0);
-       DATA_BLOB nt_session_key = data_blob(NULL, 0);
+       DATA_BLOB user_session_key = data_blob(NULL, 0);
        DATA_BLOB names_blob = NTLMv2_generate_names_blob(get_winbind_netbios_name(), get_winbind_domain());
 
        uchar nt_key[16];
@@ -1722,12 +1722,12 @@ static BOOL test_lmv2_ntlmv2_broken(enum ntlm_break break_which)
 
        ZERO_STRUCT(nt_key);
        
-       flags |= WBFLAG_PAM_NTKEY;
+       flags |= WBFLAG_PAM_USER_SESSION_KEY;
 
        if (!SMBNTLMv2encrypt(opt_username, opt_domain, opt_password, &chall,
                              &names_blob,
                              &lmv2_response, &ntlmv2_response, 
-                             &nt_session_key)) {
+                             &user_session_key)) {
                data_blob_free(&names_blob);
                return False;
        }
@@ -1771,13 +1771,13 @@ static BOOL test_lmv2_ntlmv2_broken(enum ntlm_break break_which)
                return break_which == BREAK_NT;
        }
 
-       if (break_which != NO_NT && break_which != BREAK_NT && memcmp(nt_session_key.data, nt_key, 
+       if (break_which != NO_NT && break_which != BREAK_NT && memcmp(user_session_key.data, nt_key, 
                   sizeof(nt_key)) != 0) {
-               DEBUG(1, ("NT Session Key does not match expectations!\n"));
+               DEBUG(1, ("USER Session Key does not match expectations!\n"));
                DEBUG(1, ("nt_key:\n"));
                dump_data(1, (const char *)nt_key, 16);
                DEBUG(1, ("expected:\n"));
-               dump_data(1, (const char *)nt_session_key.data, nt_session_key.length);
+               dump_data(1, (const char *)user_session_key.data, user_session_key.length);
                pass = False;
        }
         return pass;
@@ -1851,8 +1851,8 @@ static BOOL test_plaintext(enum ntlm_break break_which)
 
        ZERO_STRUCT(nt_key);
        
-       flags |= WBFLAG_PAM_NTKEY;
        flags |= WBFLAG_PAM_LMKEY;
+       flags |= WBFLAG_PAM_USER_SESSION_KEY;
 
        if ((push_ucs2_allocate((smb_ucs2_t **)&nt_response.data, opt_password)) == -1) {
                DEBUG(0, ("push_ucs2_allocate failed!\n"));