summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-07-25 11:21:31 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-03 18:48:03 +1000
commitda4345a8d1da94ac879b876ad826fa4ea7b95efd (patch)
treeff7b25a10a1c1573df22eb4313bc31063c14f37e /source3/utils
parent779573a5b3c6b8e91a08cc08ff516a957e539722 (diff)
downloadsamba-da4345a8d1da94ac879b876ad826fa4ea7b95efd.tar.gz
samba-da4345a8d1da94ac879b876ad826fa4ea7b95efd.tar.bz2
samba-da4345a8d1da94ac879b876ad826fa4ea7b95efd.zip
s3-ntlmssp Remove rpccli_get_pwd_hash and auth_ntlmssp_get_nt_hash
The session key we want here (the only one that is availble to the encryption layer) is the one obtained by cli_get_session_key(), as NTLMSSP creates a per-session session key via key exchange and NTLMv2 negotiation. The key was never directly the NT hash anyway (this is simply a mistake, the extra MD4() was lost during my previous cleanup f28f113d8e76824b080359c90efd9c92de533740 in 2008), but was MD4(NT hash) in early implementations of NTLMSSP. However, regardless this call is not available on domain trusts between AD domains and Windows 2003 R2, making this less useful. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 592885ac7c..c2fc08693c 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -6436,8 +6436,7 @@ static NTSTATUS vampire_trusted_domain(struct rpc_pipe_client *pipe_hnd,
NTSTATUS nt_status, result;
union lsa_TrustedDomainInfo *info = NULL;
char *cleartextpwd = NULL;
- uint8_t session_key[16];
- DATA_BLOB session_key_blob;
+ DATA_BLOB session_key;
DATA_BLOB data = data_blob_null;
struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
@@ -6462,13 +6461,14 @@ static NTSTATUS vampire_trusted_domain(struct rpc_pipe_client *pipe_hnd,
data = data_blob(info->password.password->data,
info->password.password->length);
- if (!rpccli_get_pwd_hash(pipe_hnd, session_key)) {
- DEBUG(0, ("Could not retrieve password hash\n"));
+ nt_status = cli_get_session_key(mem_ctx, pipe_hnd, &session_key);
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ DEBUG(0, ("Could not retrieve session key: %s\n", nt_errstr(nt_status)));
goto done;
}
- session_key_blob = data_blob_const(session_key, sizeof(session_key));
- cleartextpwd = sess_decrypt_string(mem_ctx, &data, &session_key_blob);
+ cleartextpwd = sess_decrypt_string(mem_ctx, &data, &session_key);
+ data_blob_free(&session_key);
if (cleartextpwd == NULL) {
DEBUG(0,("retrieved NULL password\n"));