summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-04-07 07:18:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:06 -0500
commita8a42e7f53c67b09954ea2232830c07c6e011aa0 (patch)
treedb68f2c2649d3eb84822b9ef34442f711cac7a6f
parent43caaa54e7ed0e72faed9e210a9f0e672e4e7d86 (diff)
downloadsamba-a8a42e7f53c67b09954ea2232830c07c6e011aa0.tar.gz
samba-a8a42e7f53c67b09954ea2232830c07c6e011aa0.tar.bz2
samba-a8a42e7f53c67b09954ea2232830c07c6e011aa0.zip
r100: remember the user session key during session setup so it can be used in various crypto
routines (This used to be commit f6cf9020c8899e784385ea0e14fa465685441ee6)
-rw-r--r--source4/include/cli_context.h4
-rw-r--r--source4/libcli/raw/clisession.c2
-rw-r--r--source4/libcli/raw/clitransport.c9
3 files changed, 15 insertions, 0 deletions
diff --git a/source4/include/cli_context.h b/source4/include/cli_context.h
index bffb6c9f6a..0e817c3cb0 100644
--- a/source4/include/cli_context.h
+++ b/source4/include/cli_context.h
@@ -66,6 +66,10 @@ struct cli_negotiate {
unsigned int writebraw_supported:1;
const char *server_domain;
+
+ /* remember the session key for data encryption in various sub-protocols
+ such as LSA */
+ uint8 user_session_key[16];
};
/* this is the context for a SMB socket associated with the socket itself */
diff --git a/source4/libcli/raw/clisession.c b/source4/libcli/raw/clisession.c
index c5d4888089..1c0af77d11 100644
--- a/source4/libcli/raw/clisession.c
+++ b/source4/libcli/raw/clisession.c
@@ -247,6 +247,8 @@ static void setup_nt1_signing(struct cli_transport *transport, const char *passw
SMBsesskeygen_ntv1(nt_hash, NULL, session_key);
nt_response = nt_blob(password, transport->negotiate.secblob);
+ cli_transport_set_session_key(transport, session_key);
+
cli_transport_simple_set_signing(transport, session_key, nt_response);
}
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 2d614cc3bd..62152bbe4d 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -222,3 +222,12 @@ BOOL cli_transport_select(struct cli_transport *transport)
return True;
}
+
+/*
+ store the user session key for a transport
+*/
+void cli_transport_set_session_key(struct cli_transport *transport,
+ const uint8 session_key[16])
+{
+ memcpy(transport->negotiate.user_session_key, session_key, 16);
+}