diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-11-11 07:23:45 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:46:10 -0500 |
commit | 7a78d2d6b083fbd408c766116693d01b57628f28 (patch) | |
tree | 5b6d81c28a4b6343703ca30f6e537d39ff2ce3c7 /source4/torture | |
parent | 86c1370cb03a244fd5644d30732a1fbda762fe6a (diff) | |
download | samba-7a78d2d6b083fbd408c766116693d01b57628f28.tar.gz samba-7a78d2d6b083fbd408c766116693d01b57628f28.tar.bz2 samba-7a78d2d6b083fbd408c766116693d01b57628f28.zip |
r11668: yay! we get a successful session setup with SMB2, and get back a 64bit uid
(This used to be commit 72b34a7c1b66af6be02f66639efc55a19c73e387)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/smb2/connect.c | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/source4/torture/smb2/connect.c b/source4/torture/smb2/connect.c index 43029dd04d..49b9582d4d 100644 --- a/source4/torture/smb2/connect.c +++ b/source4/torture/smb2/connect.c @@ -76,6 +76,8 @@ static struct smb2_transport *torture_smb2_negprot(TALLOC_CTX *mem_ctx, const ch printf("current_time = %s\n", nt_time_string(mem_ctx, io.out.current_time)); printf("boot_time = %s\n", nt_time_string(mem_ctx, io.out.boot_time)); + transport->negotiate.secblob = io.out.secblob; + return transport; } @@ -89,12 +91,12 @@ static struct smb2_session *torture_smb2_session(struct smb2_transport *transpor struct smb2_session_setup io; NTSTATUS status; TALLOC_CTX *tmp_ctx = talloc_new(transport); + DATA_BLOB secblob; ZERO_STRUCT(io); io.in.unknown1 = 0x11; io.in.unknown2 = 0xF; io.in.unknown3 = 0x00; - io.in.unknown4 = 0x50; session = smb2_session_init(transport, transport, True); @@ -126,21 +128,39 @@ static struct smb2_session *torture_smb2_session(struct smb2_transport *transpor return NULL; } - status = gensec_update(session->gensec, tmp_ctx, - session->transport->negotiate.secblob, - &io.in.secblob); - if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED) && - !NT_STATUS_IS_OK(status)) { - DEBUG(1, ("Failed initial gensec_update : %s\n", nt_errstr(status))); - return NULL; - } + secblob = session->transport->negotiate.secblob; + + do { + NTSTATUS status1; + + status1 = gensec_update(session->gensec, tmp_ctx, secblob, &io.in.secblob); + if (!NT_STATUS_EQUAL(status1, NT_STATUS_MORE_PROCESSING_REQUIRED) && + !NT_STATUS_IS_OK(status1)) { + DEBUG(1, ("Failed initial gensec_update : %s\n", + nt_errstr(status1))); + status = status1; + break; + } + + status = smb2_session_setup(session, tmp_ctx, &io); + secblob = io.out.secblob; + + session->uid = io.out.uid; + + if (NT_STATUS_IS_OK(status) && + NT_STATUS_EQUAL(status1, NT_STATUS_MORE_PROCESSING_REQUIRED)) { + status = gensec_update(session->gensec, tmp_ctx, secblob, + &io.in.secblob); + } + } while (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)); - status = smb2_session_setup(session, tmp_ctx, &io); if (!NT_STATUS_IS_OK(status)) { printf("session setup failed - %s\n", nt_errstr(status)); return NULL; } + printf("Session setup gave UID 0x%llx\n", session->uid); + return session; } |