diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-05-09 12:42:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:51:51 -0500 |
commit | dce84ffd379012812170f68f7de8aab73123f0b3 (patch) | |
tree | c5f6973838572fd06c07d6771f5286bc2073b569 /source4/librpc/rpc/dcerpc_util.c | |
parent | 55fa62be31c9027d84be0e4caad3ee59d78ca1b0 (diff) | |
download | samba-dce84ffd379012812170f68f7de8aab73123f0b3.tar.gz samba-dce84ffd379012812170f68f7de8aab73123f0b3.tar.bz2 samba-dce84ffd379012812170f68f7de8aab73123f0b3.zip |
r610: - Merge the Samba3 'ntlm_auth --diagnostics' testsuite to Samba4.
- This required using NETLOGON_NEG_AUTH2_FLAGS for the
SetupCredentials2 negotiation flags, which is what Samba3 does,
because otherwise the server uses different crypto.
- This tests the returned session keys, which we decrypt.
- Update the Samba4 notion of a 'session key' to be a DATA_BLOB in
most places.
- Fix session key code to return NT_STATUS_NO_SESSION_KEY if none is
available.
- Remove a useless argument to SMBsesskeygen_ntv1
- move netr_CredentialState from the .idl to the new credentials.h
Andrew Bartlett
(This used to be commit 44f8b5b53e6abd4de8a676f78d729988fadff320)
Diffstat (limited to 'source4/librpc/rpc/dcerpc_util.c')
-rw-r--r-- | source4/librpc/rpc/dcerpc_util.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index 0e045e0033..dce325d7e1 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -673,27 +673,21 @@ NTSTATUS dcerpc_secondary_smb(struct dcerpc_pipe *p, struct dcerpc_pipe **p2, only works for the ncacn_np transport */ NTSTATUS dcerpc_fetch_session_key(struct dcerpc_pipe *p, - uint8 session_key[16]) + DATA_BLOB *session_key) { struct cli_tree *tree; - memset(session_key, 0, 16); - + if (p->security_state) { + return p->security_state->session_key(p->security_state, session_key); + } + tree = dcerpc_smb_tree(p); if (tree) { - memcpy(session_key, - tree->session->transport->negotiate.user_session_key, - 16); - } - - if (p->security_state) { - NTSTATUS status; - - status = p->security_state->session_key(p->security_state, session_key); - if (!NT_STATUS_IS_OK(status)) { - return status; + if (tree->session->user_session_key.data) { + *session_key = tree->session->user_session_key; + return NT_STATUS_OK; } } - - return NT_STATUS_OK; + + return NT_STATUS_NO_USER_SESSION_KEY; } |