diff options
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth_ntlmssp.c | 12 | ||||
-rw-r--r-- | source3/auth/auth_util.c | 22 | ||||
-rw-r--r-- | source3/auth/check_samsec.c | 2 | ||||
-rw-r--r-- | source3/auth/server_info.c | 18 |
4 files changed, 27 insertions, 27 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index 99f4564cdf..58974210dd 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -102,7 +102,7 @@ static NTSTATUS auth_ntlmssp_set_challenge(struct ntlmssp_state *ntlmssp_state, */ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state, TALLOC_CTX *mem_ctx, - DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key) + DATA_BLOB *session_key, DATA_BLOB *lm_session_key) { struct auth_ntlmssp_state *auth_ntlmssp_state = (struct auth_ntlmssp_state *)ntlmssp_state->callback_private; @@ -154,12 +154,12 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state, * NTLMSSP code will decide on the final correct session key, * and put it back here at the end of * auth_ntlmssp_steal_server_info */ - if (auth_ntlmssp_state->server_info->user_session_key.length) { + if (auth_ntlmssp_state->server_info->session_key.length) { DEBUG(10, ("Got NT session key of length %u\n", - (unsigned int)auth_ntlmssp_state->server_info->user_session_key.length)); - *user_session_key = auth_ntlmssp_state->server_info->user_session_key; - talloc_steal(mem_ctx, auth_ntlmssp_state->server_info->user_session_key.data); - auth_ntlmssp_state->server_info->user_session_key = data_blob_null; + (unsigned int)auth_ntlmssp_state->server_info->session_key.length)); + *session_key = auth_ntlmssp_state->server_info->session_key; + talloc_steal(mem_ctx, auth_ntlmssp_state->server_info->session_key.data); + auth_ntlmssp_state->server_info->session_key = data_blob_null; } if (auth_ntlmssp_state->server_info->lm_session_key.length) { DEBUG(10, ("Got LM session key of length %u\n", diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 8666b55b47..e2a687ddf4 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -465,11 +465,11 @@ NTSTATUS create_local_token(TALLOC_CTX *mem_ctx, } if (session_key) { - data_blob_free(&session_info->user_session_key); - session_info->user_session_key = data_blob_talloc(session_info, + data_blob_free(&session_info->session_key); + session_info->session_key = data_blob_talloc(session_info, session_key->data, session_key->length); - if (!session_info->user_session_key.data && session_key->length) { + if (!session_info->session_key.data && session_key->length) { return NT_STATUS_NO_MEMORY; } } @@ -788,7 +788,7 @@ static NTSTATUS make_new_server_info_guest(struct auth_serversupplied_info **ses /* annoying, but the Guest really does have a session key, and it is all zeros! */ - (*session_info)->user_session_key = data_blob(zeros, sizeof(zeros)); + (*session_info)->session_key = data_blob(zeros, sizeof(zeros)); (*session_info)->lm_session_key = data_blob(zeros, sizeof(zeros)); alpha_strcpy(tmp, (*session_info)->info3->base.account_name.string, @@ -909,8 +909,8 @@ struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx, } } - dst->user_session_key = data_blob_talloc( dst, src->user_session_key.data, - src->user_session_key.length); + dst->session_key = data_blob_talloc( dst, src->session_key.data, + src->session_key.length); dst->lm_session_key = data_blob_talloc(dst, src->lm_session_key.data, src->lm_session_key.length); @@ -945,12 +945,12 @@ struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx, bool session_info_set_session_key(struct auth_serversupplied_info *info, DATA_BLOB session_key) { - TALLOC_FREE(info->user_session_key.data); + TALLOC_FREE(info->session_key.data); - info->user_session_key = data_blob_talloc( + info->session_key = data_blob_talloc( info, session_key.data, session_key.length); - return (info->user_session_key.data != NULL); + return (info->session_key.data != NULL); } static struct auth_serversupplied_info *guest_info = NULL; @@ -1295,9 +1295,9 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx, /* ensure we are never given NULL session keys */ if (memcmp(info3->base.key.key, zeros, sizeof(zeros)) == 0) { - result->user_session_key = data_blob_null; + result->session_key = data_blob_null; } else { - result->user_session_key = data_blob_talloc( + result->session_key = data_blob_talloc( result, info3->base.key.key, sizeof(info3->base.key.key)); } diff --git a/source3/auth/check_samsec.c b/source3/auth/check_samsec.c index f918dc0db1..c4bcda4b1b 100644 --- a/source3/auth/check_samsec.c +++ b/source3/auth/check_samsec.c @@ -492,7 +492,7 @@ NTSTATUS check_sam_security(const DATA_BLOB *challenge, goto done; } - (*server_info)->user_session_key = + (*server_info)->session_key = data_blob_talloc(*server_info, user_sess_key.data, user_sess_key.length); data_blob_free(&user_sess_key); diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c index 3190b756c4..440e45c8e5 100644 --- a/source3/auth/server_info.c +++ b/source3/auth/server_info.c @@ -80,11 +80,11 @@ NTSTATUS serverinfo_to_SamInfo2(struct auth_serversupplied_info *server_info, return NT_STATUS_NO_MEMORY; } - if (server_info->user_session_key.length) { + if (server_info->session_key.length) { memcpy(info3->base.key.key, - server_info->user_session_key.data, + server_info->session_key.data, MIN(sizeof(info3->base.key.key), - server_info->user_session_key.length)); + server_info->session_key.length)); if (pipe_session_key) { arcfour_crypt(info3->base.key.key, pipe_session_key, 16); @@ -123,11 +123,11 @@ NTSTATUS serverinfo_to_SamInfo3(const struct auth_serversupplied_info *server_in return NT_STATUS_NO_MEMORY; } - if (server_info->user_session_key.length) { + if (server_info->session_key.length) { memcpy(info3->base.key.key, - server_info->user_session_key.data, + server_info->session_key.data, MIN(sizeof(info3->base.key.key), - server_info->user_session_key.length)); + server_info->session_key.length)); if (pipe_session_key) { arcfour_crypt(info3->base.key.key, pipe_session_key, 16); @@ -181,11 +181,11 @@ NTSTATUS serverinfo_to_SamInfo6(struct auth_serversupplied_info *server_info, return NT_STATUS_NO_MEMORY; } - if (server_info->user_session_key.length) { + if (server_info->session_key.length) { memcpy(info3->base.key.key, - server_info->user_session_key.data, + server_info->session_key.data, MIN(sizeof(info3->base.key.key), - server_info->user_session_key.length)); + server_info->session_key.length)); if (pipe_session_key) { arcfour_crypt(info3->base.key.key, pipe_session_key, 16); |