summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_pipe.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-10-07 22:10:29 +0000
committerLuke Leighton <lkcl@samba.org>1999-10-07 22:10:29 +0000
commitcba7662da1fd9ed8bd9f9969417adf1fe5f0d33b (patch)
treeeae7890b1c9c03c86e86dd86a2966fc5a585b99a /source3/rpc_client/cli_pipe.c
parenteb9268550f2330d4a9a3381f560bd7d70743e19a (diff)
downloadsamba-cba7662da1fd9ed8bd9f9969417adf1fe5f0d33b.tar.gz
samba-cba7662da1fd9ed8bd9f9969417adf1fe5f0d33b.tar.bz2
samba-cba7662da1fd9ed8bd9f9969417adf1fe5f0d33b.zip
- 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)
Diffstat (limited to 'source3/rpc_client/cli_pipe.c')
-rw-r--r--source3/rpc_client/cli_pipe.c45
1 files changed, 31 insertions, 14 deletions
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,