summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-05-20 19:57:37 +0200
committerStefan Metzmacher <metze@samba.org>2009-05-20 19:58:37 +0200
commit04ceabf56f9372b953448d27ca18d9895b1d4c52 (patch)
treef06baefd3e7e86efe5c06cc1de19db5eca1aea7b /source4/libcli
parent540b7130750f82d52a514a5117237e1b3e90e97b (diff)
downloadsamba-04ceabf56f9372b953448d27ca18d9895b1d4c52.tar.gz
samba-04ceabf56f9372b953448d27ca18d9895b1d4c52.tar.bz2
samba-04ceabf56f9372b953448d27ca18d9895b1d4c52.zip
s4:libcli/smb2: fix session setup with raw NTLMSSP
metze
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/smb2/session.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/source4/libcli/smb2/session.c b/source4/libcli/smb2/session.c
index cf50ba6831..9db32c4dfc 100644
--- a/source4/libcli/smb2/session.c
+++ b/source4/libcli/smb2/session.c
@@ -149,27 +149,31 @@ static void session_request_handler(struct smb2_request *req)
struct smb2_session_state *state = talloc_get_type(c->private_data,
struct smb2_session_state);
struct smb2_session *session = req->session;
+ NTSTATUS session_key_err;
+ DATA_BLOB session_key;
+ NTSTATUS peer_status;
c->status = smb2_session_setup_recv(req, c, &state->io);
- if (NT_STATUS_EQUAL(c->status, NT_STATUS_MORE_PROCESSING_REQUIRED) ||
- (NT_STATUS_IS_OK(c->status) &&
+ peer_status = c->status;
+
+ if (NT_STATUS_EQUAL(peer_status, NT_STATUS_MORE_PROCESSING_REQUIRED) ||
+ (NT_STATUS_IS_OK(peer_status) &&
NT_STATUS_EQUAL(state->gensec_status, NT_STATUS_MORE_PROCESSING_REQUIRED))) {
- NTSTATUS session_key_err;
- DATA_BLOB session_key;
c->status = gensec_update(session->gensec, c,
state->io.out.secblob,
&state->io.in.secblob);
state->gensec_status = c->status;
- session_key_err = gensec_session_key(session->gensec, &session_key);
- if (NT_STATUS_IS_OK(session_key_err)) {
- session->session_key = session_key;
- }
+ session->uid = state->io.out.uid;
}
- session->uid = state->io.out.uid;
+ if (!NT_STATUS_IS_OK(c->status) &&
+ !NT_STATUS_EQUAL(c->status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+ composite_error(c, c->status);
+ return;
+ }
- if (NT_STATUS_EQUAL(c->status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+ if (NT_STATUS_EQUAL(peer_status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
state->req = smb2_session_setup_send(session, &state->io);
if (state->req == NULL) {
composite_error(c, NT_STATUS_NO_MEMORY);
@@ -181,9 +185,9 @@ static void session_request_handler(struct smb2_request *req)
return;
}
- if (!NT_STATUS_IS_OK(c->status)) {
- composite_error(c, c->status);
- return;
+ session_key_err = gensec_session_key(session->gensec, &session_key);
+ if (NT_STATUS_IS_OK(session_key_err)) {
+ session->session_key = session_key;
}
if (session->transport->signing_required) {