From 96b46e99072f0c31ade85a5fa539cafc021fb42c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 4 Dec 2007 09:41:28 +0100 Subject: r26285: Add IDL and torture test for netr_ServerPasswordGet(). Guenther (This used to be commit d64244cfe871cd549a991ac2a708263fc77d2fef) --- source4/librpc/idl/netlogon.idl | 10 ++++++++- source4/rpc_server/netlogon/dcerpc_netlogon.c | 8 +++---- source4/samba4-knownfail | 1 + source4/torture/rpc/netlogon.c | 30 +++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/source4/librpc/idl/netlogon.idl b/source4/librpc/idl/netlogon.idl index 9743f74b34..8e0950c2aa 100644 --- a/source4/librpc/idl/netlogon.idl +++ b/source4/librpc/idl/netlogon.idl @@ -1112,7 +1112,15 @@ interface netlogon /****************/ /* Function 0x1f */ - WERROR netr_NETRSERVERPASSWORDGET(); + WERROR netr_ServerPasswordGet( + [in] [string,charset(UTF16)] uint16 *server_name, + [in] [string,charset(UTF16)] uint16 account_name[], + [in] netr_SchannelType secure_channel_type, + [in] [string,charset(UTF16)] uint16 computer_name[], + [in,ref] netr_Authenticator *credential, + [out,ref] netr_Authenticator *return_authenticator, + [out,ref] samr_Password *password + ); /****************/ /* Function 0x20 */ diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 1c6a1d0588..d2390a8de0 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -946,11 +946,11 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal -/* - netr_NETRSERVERPASSWORDGET +/* + netr_ServerPasswordGet */ -static WERROR dcesrv_netr_NETRSERVERPASSWORDGET(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, - struct netr_NETRSERVERPASSWORDGET *r) +static WERROR dcesrv_netr_ServerPasswordGet(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, + struct netr_ServerPasswordGet *r) { DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); } diff --git a/source4/samba4-knownfail b/source4/samba4-knownfail index e9226f86a7..11726383d1 100644 --- a/source4/samba4-knownfail +++ b/source4/samba4-knownfail @@ -29,5 +29,6 @@ RPC-NETLOGON.*/NetrEnumerateTrustedDomainsEx RPC-NETLOGON.*/DsrGetDcSiteCoverageW RPC-NETLOGON.*/DsRAddressToSitenamesW RPC-NETLOGON.*/DsRAddressToSitenamesExW +RPC-NETLOGON.*/GetPassword BASE-CHARSET.*/Testing partial surrogate .*NET-API-DELSHARE.* # DelShare isn't implemented yet diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 92fd27b8ce..c0b26e0d87 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -438,6 +438,36 @@ static bool test_SetPassword2(struct torture_context *tctx, return true; } +static bool test_GetPassword(struct torture_context *tctx, + struct dcerpc_pipe *p, + struct cli_credentials *machine_credentials) +{ + struct netr_ServerPasswordGet r; + struct creds_CredentialState *creds; + struct netr_Authenticator credential; + NTSTATUS status; + struct netr_Authenticator return_authenticator; + struct samr_Password password; + + if (!test_SetupCredentials(p, tctx, machine_credentials, &creds)) { + return false; + } + + creds_client_authenticator(creds, &credential); + + r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); + r.in.account_name = talloc_asprintf(tctx, "%s$", TEST_MACHINE_NAME); + r.in.secure_channel_type = SEC_CHAN_BDC; + r.in.computer_name = TEST_MACHINE_NAME; + r.in.credential = &credential; + r.out.return_authenticator = &return_authenticator; + r.out.password = &password; + + status = dcerpc_netr_ServerPasswordGet(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "ServerPasswordGet"); + + return true; +} /* try a netlogon SamLogon */ -- cgit