From cba7662da1fd9ed8bd9f9969417adf1fe5f0d33b Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 7 Oct 1999 22:10:29 +0000 Subject: - added rudimentary CAP_UNICODE support because i thought it was part of a problem i was having. - added rudimentary CAP_STATUS32 support for same reason. - added hard-coded, copy-the-same-data-from-over-the-wire version of CAP_EXTENDED_SECURITY, which is a security-blob to encapsulate GSSAPI which encodes SPNEGO which is used to negotiate Kerberos or NTLMSSP. i have implemented NTLMSSP which negotiates NTLMv1 or NTLMv2 and 40-bit or 128-bit etc. i have implemented NTLMv1 / 40-bit. *whew*. (This used to be commit e5b80bd2f76fda70e41e4a9007eb035dab92ed8e) --- source3/rpc_client/cli_pipe.c | 45 +++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index d5745adb55..0453bb3125 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -473,6 +473,34 @@ static BOOL create_rpc_bind_req(prs_struct *rhdr, return True; } +/******************************************************************* + creates a DCE/RPC bind authentication response + + - initialises the parse structure. + - dynamically allocates the header data structure + - caller is expected to free the header data structure once used. + + ********************************************************************/ +void create_ntlmssp_resp(struct pwd_info *pwd, + char *domain, char *user_name, char *my_name, + uint32 ntlmssp_cli_flgs, + prs_struct *auth_resp) +{ + RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; + unsigned char lm_owf[24]; + unsigned char nt_owf[128]; + size_t nt_owf_len; + + pwd_get_lm_nt_owf(pwd, lm_owf, nt_owf, &nt_owf_len); + + make_rpc_auth_ntlmssp_resp(&ntlmssp_resp, + lm_owf, nt_owf, nt_owf_len, + domain, user_name, my_name, + ntlmssp_cli_flgs); + + smb_io_rpc_auth_ntlmssp_resp("ntlmssp_resp", &ntlmssp_resp, auth_resp, 0); + mem_realloc_data(auth_resp->data, auth_resp->offset); +} /******************************************************************* creates a DCE/RPC bind authentication response @@ -482,7 +510,7 @@ static BOOL create_rpc_bind_req(prs_struct *rhdr, - caller is expected to free the header data structure once used. ********************************************************************/ -static BOOL create_rpc_bind_resp(struct pwd_info *pwd, +BOOL create_rpc_bind_resp(struct pwd_info *pwd, char *domain, char *user_name, char *my_name, uint32 ntlmssp_cli_flgs, uint32 rpc_call_id, @@ -490,13 +518,9 @@ static BOOL create_rpc_bind_resp(struct pwd_info *pwd, prs_struct *rhdr_autha, prs_struct *auth_resp) { - unsigned char lm_owf[24]; - unsigned char nt_owf[128]; - size_t nt_owf_len; RPC_HDR hdr; RPC_HDR_AUTHA hdr_autha; RPC_AUTH_NTLMSSP_VERIFIER auth_verifier; - RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; make_rpc_hdr_autha(&hdr_autha, 0x1630, 0x1630, 0x0a, 0x06, 0x00); smb_io_rpc_hdr_autha("hdr_autha", &hdr_autha, rhdr_autha, 0); @@ -508,15 +532,8 @@ static BOOL create_rpc_bind_resp(struct pwd_info *pwd, smb_io_rpc_auth_ntlmssp_verifier("auth_verifier", &auth_verifier, auth_resp, 0); mem_realloc_data(auth_resp->data, auth_resp->offset); - pwd_get_lm_nt_owf(pwd, lm_owf, nt_owf, &nt_owf_len); - - make_rpc_auth_ntlmssp_resp(&ntlmssp_resp, - lm_owf, nt_owf, nt_owf_len, - domain, user_name, my_name, - ntlmssp_cli_flgs); - - smb_io_rpc_auth_ntlmssp_resp("ntlmssp_resp", &ntlmssp_resp, auth_resp, 0); - mem_realloc_data(auth_resp->data, auth_resp->offset); + create_ntlmssp_resp(pwd, domain, user_name, my_name, ntlmssp_cli_flgs, + auth_resp); /* create the request RPC_HDR */ make_rpc_hdr(&hdr, RPC_BINDRESP, 0x0, rpc_call_id, -- cgit