DATA_BLOB names_blob, chal, lm_resp, nt_resp;
int i;
struct dcerpc_binding_handle *b = p->binding_handle;
+ enum dcerpc_AuthType auth_type = DCERPC_AUTH_TYPE_NONE;
+ enum dcerpc_AuthLevel auth_level = DCERPC_AUTH_LEVEL_NONE;
int flags = CLI_CRED_NTLM_AUTH;
if (lpcfg_client_lanman_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_LANMAN_AUTH;
flags |= CLI_CRED_NTLMv2_AUTH;
}
+ dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
+
cli_credentials_get_ntlm_username_domain(samba_cmdline_get_creds(),
tctx,
&ninfo.identity_info.account_name.string,
"LogonSamLogon failed");
torture_assert_ntstatus_ok(tctx, r.out.result, "LogonSamLogon failed");
- torture_assert(tctx, netlogon_creds_client_check(creds,
- &r.out.return_authenticator->cred),
+ status = netlogon_creds_client_verify(creds,
+ &r.out.return_authenticator->cred,
+ auth_type,
+ auth_level);
+ torture_assert_ntstatus_ok(tctx, status,
"Credential chaining failed");
torture_assert_int_equal(tctx, *r.out.authoritative, 1,
"LogonSamLogon invalid *r.out.authoritative");
"LogonSamLogon failed");
torture_assert_ntstatus_ok(tctx, r.out.result, "LogonSamLogon failed");
- torture_assert(tctx, netlogon_creds_client_check(creds,
- &r.out.return_authenticator->cred),
+ status = netlogon_creds_client_verify(creds,
+ &r.out.return_authenticator->cred,
+ auth_type,
+ auth_level);
+ torture_assert_ntstatus_ok(tctx, status,
"Credential chaining failed");
torture_assert_int_equal(tctx, *r.out.authoritative, 1,
"LogonSamLogon invalid *r.out.authoritative");
"LogonSamLogon failed");
torture_assert_ntstatus_ok(tctx, r.out.result, "LogonSamLogon failed");
- torture_assert(tctx, netlogon_creds_client_check(creds,
- &r.out.return_authenticator->cred),
+ status = netlogon_creds_client_verify(creds,
+ &r.out.return_authenticator->cred,
+ auth_type,
+ auth_level);
+ torture_assert_ntstatus_ok(tctx, status,
"Credential chaining failed");
torture_assert_int_equal(tctx, *r.out.authoritative, 1,
"LogonSamLogon invalid *r.out.authoritative");
struct netr_Authenticator auth, return_auth;
struct netlogon_creds_CredentialState tmp_creds;
struct dcerpc_binding_handle *b = p->binding_handle;
+ enum dcerpc_AuthType auth_type = DCERPC_AUTH_TYPE_NONE;
+ enum dcerpc_AuthLevel auth_level = DCERPC_AUTH_LEVEL_NONE;
+
+ dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.in.computer_name = cli_credentials_get_workstation(credentials);
*creds = tmp_creds;
- torture_assert(tctx, netlogon_creds_client_check(creds,
- &r.out.return_authenticator->cred),
+ status = netlogon_creds_client_verify(creds,
+ &r.out.return_authenticator->cred,
+ auth_type,
+ auth_level);
+ torture_assert_ntstatus_ok(tctx, status,
"Credential chaining failed");
torture_assert_int_equal(tctx, creds->negotiate_flags,
*creds = tmp_creds;
- torture_assert(tctx, netlogon_creds_client_check(creds,
- &r.out.return_authenticator->cred),
+ status = netlogon_creds_client_verify(creds,
+ &r.out.return_authenticator->cred,
+ auth_type,
+ auth_level);
+ torture_assert_ntstatus_ok(tctx, status,
"Credential chaining failed");
torture_assert_int_equal(tctx, requested_flags,
}
return status;
}
- if (!r->out.return_authenticator ||
- !netlogon_creds_client_check(samlogon_state->creds, &r->out.return_authenticator->cred)) {
- torture_comment(samlogon_state->tctx, "Credential chaining failed\n");
+ if (r->out.return_authenticator == NULL) {
+ status = NT_STATUS_INVALID_NETWORK_RESPONSE;
+ if (error_string) {
+ *error_string = strdup(nt_errstr(status));
+ }
+ return status;
+ }
+ status = netlogon_creds_client_verify(samlogon_state->creds,
+ &r->out.return_authenticator->cred,
+ auth_type,
+ auth_level);
+ if (!NT_STATUS_IS_OK(status)) {
+ if (error_string) {
+ *error_string = strdup(nt_errstr(status));
+ }
+ return status;
}
if (!NT_STATUS_IS_OK(r->out.result)) {
if (error_string) {
}
return status;
}
- if (!r_flags->out.return_authenticator ||
- !netlogon_creds_client_check(samlogon_state->creds, &r_flags->out.return_authenticator->cred)) {
- torture_comment(samlogon_state->tctx, "Credential chaining failed\n");
+ if (r_flags->out.return_authenticator == NULL) {
+ status = NT_STATUS_INVALID_NETWORK_RESPONSE;
+ if (error_string) {
+ *error_string = strdup(nt_errstr(status));
+ }
+ return status;
+ }
+ status = netlogon_creds_client_verify(samlogon_state->creds,
+ &r_flags->out.return_authenticator->cred,
+ auth_type,
+ auth_level);
+ if (!NT_STATUS_IS_OK(status)) {
+ if (error_string) {
+ *error_string = strdup(nt_errstr(status));
+ }
+ return status;
}
if (!NT_STATUS_IS_OK(r_flags->out.result)) {
if (error_string) {
torture_fail(tctx, "no authenticator returned");
}
- torture_assert_goto(tctx,
- netlogon_creds_client_check(creds, &r.out.return_authenticator->cred),
- ret, failed,
+ status = netlogon_creds_client_verify(creds,
+ &r.out.return_authenticator->cred,
+ auth_type,
+ auth_level);
+ torture_assert_ntstatus_ok_goto(tctx, status, ret, failed,
"Credential chaining failed\n");
torture_assert_ntstatus_equal(tctx, r.out.result, expected_error,