*/
bool test_netlogon_capabilities(struct dcerpc_pipe *p, struct torture_context *tctx,
struct cli_credentials *credentials,
+ uint32_t requested_flags,
struct netlogon_creds_CredentialState *creds)
{
NTSTATUS status;
&r.out.return_authenticator->cred),
"Credential chaining failed");
- torture_assert_int_equal(tctx, creds->negotiate_flags,
- capabilities.server_capabilities,
+ torture_assert_int_equal(tctx, requested_flags,
+ capabilities.requested_flags,
"negotiate flags");
return true;
#include "libcli/security/security.h"
#include "system/filesys.h"
#include "param/param.h"
+#include "param/loadparm.h"
#include "librpc/rpc/dcerpc_proto.h"
#include "libcli/composite/composite.h"
#include "lib/events/events.h"
struct netlogon_creds_CredentialState *creds;
struct cli_credentials *credentials;
enum dcerpc_transport_t transport;
+ uint32_t requested_flags;
join_ctx = torture_join_domain(tctx,
talloc_asprintf(tctx, "%s%d", TEST_MACHINE_NAME, i),
creds = cli_credentials_get_netlogon_creds(credentials);
torture_assert(tctx, (creds != NULL), "schannel creds");
+ requested_flags = NETLOGON_NEG_AUTH2_FLAGS;
+ if (dcerpc_flags & DCERPC_SCHANNEL_128) {
+ requested_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
+ }
+ if (dcerpc_flags & DCERPC_SCHANNEL_AES) {
+ requested_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
+ requested_flags |= NETLOGON_NEG_SUPPORTS_AES;
+ }
+ if (dcerpc_flags & DCERPC_SCHANNEL_AUTO) {
+ requested_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
+ requested_flags |= NETLOGON_NEG_SUPPORTS_AES;
+ }
+ if (lpcfg_weak_crypto(tctx->lp_ctx) == SAMBA_WEAK_CRYPTO_DISALLOWED) {
+ requested_flags &= ~NETLOGON_NEG_ARCFOUR;
+ requested_flags |= NETLOGON_NEG_SUPPORTS_AES;
+ }
+
/* checks the capabilities */
- torture_assert(tctx, test_netlogon_capabilities(p_netlogon, tctx, credentials, creds),
+ torture_assert(tctx,
+ test_netlogon_capabilities(p_netlogon, tctx, credentials, requested_flags, creds),
"Failed to process schannel secured capability ops (on fresh connection)");
/* do a couple of logins */
tctx, &p_netlogon2);
torture_assert_ntstatus_ok(tctx, status, "Failed to create secondary connection");
+ requested_flags = NETLOGON_NEG_AUTH2_FLAGS;
+ if (dcerpc_flags & DCERPC_SCHANNEL_128) {
+ requested_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
+ }
+ if (dcerpc_flags & DCERPC_SCHANNEL_AES) {
+ requested_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
+ requested_flags |= NETLOGON_NEG_SUPPORTS_AES;
+ }
+ if (dcerpc_flags & DCERPC_SCHANNEL_AUTO) {
+ requested_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
+ requested_flags |= NETLOGON_NEG_SUPPORTS_AES;
+ }
+ if (lpcfg_weak_crypto(tctx->lp_ctx) == SAMBA_WEAK_CRYPTO_DISALLOWED) {
+ requested_flags &= ~NETLOGON_NEG_ARCFOUR;
+ requested_flags |= NETLOGON_NEG_SUPPORTS_AES;
+ }
+
/* checks the capabilities */
- torture_assert(tctx, test_netlogon_capabilities(p_netlogon2, tctx, credentials, creds),
+ torture_assert(tctx,
+ test_netlogon_capabilities(p_netlogon2, tctx, credentials, requested_flags, creds),
"Failed to process schannel secured capability ops (on fresh connection)");
/* Try the schannel-only SamLogonEx operation */