const char *domain,
const char *workstation,
const uint64_t logon_id,
- const uint8_t chal[8],
+ DATA_BLOB chal,
DATA_BLOB lm_response,
DATA_BLOB nt_response,
enum netr_LogonInfoClass logon_type,
network_info->identity_info.account_name.string = username;
network_info->identity_info.workstation.string = workstation_name_slash;
- memcpy(network_info->challenge, chal, 8);
+ if (chal.length != 8) {
+ DBG_WARNING("Invalid challenge length %zd\n", chal.length);
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ memcpy(network_info->challenge, chal.data, chal.length);
network_info->nt = nt;
network_info->lm = lm;
const char *domain,
const char *workstation,
const uint64_t logon_id,
- const uint8_t chal[8],
+ DATA_BLOB chal,
DATA_BLOB lm_response,
DATA_BLOB nt_response,
enum netr_LogonInfoClass logon_type,
struct winbindd_domain *domain;
NTSTATUS status;
struct netr_IdentityInfo *identity_info = NULL;
- const uint8_t chal_zero[8] = {0, };
- const uint8_t *challenge = chal_zero;
DATA_BLOB lm_response, nt_response;
+ DATA_BLOB challenge = data_blob_null;
uint32_t flags = 0;
uint16_t validation_level;
union netr_Validation *validation = NULL;
interactive = true;
identity_info = &r->in.logon.password->identity_info;
- challenge = chal_zero;
+ challenge = data_blob_null;
lm_response = data_blob_talloc(p->mem_ctx,
r->in.logon.password->lmpassword.hash,
sizeof(r->in.logon.password->lmpassword.hash));
interactive = false;
identity_info = &r->in.logon.network->identity_info;
- challenge = r->in.logon.network->challenge;
+ challenge = data_blob_talloc(p->mem_ctx,
+ r->in.logon.network->challenge,
+ 8);
lm_response = data_blob_talloc(p->mem_ctx,
r->in.logon.network->lm.data,
r->in.logon.network->lm.length);
const char *workstation,
const uint64_t logon_id,
bool plaintext_given,
- const uint8_t chal[8],
+ DATA_BLOB chal,
DATA_BLOB lm_response,
DATA_BLOB nt_response,
bool interactive,
lp_netbios_name(),
logon_id,
true, /* plaintext_given */
- NULL,
+ data_blob_null,
data_blob_null, data_blob_null,
true, /* interactive */
&authoritative,
const uint64_t logon_id,
const char* client_name,
const int client_pid,
- const uint8_t chal[8],
+ DATA_BLOB chal_blob,
DATA_BLOB lm_response,
DATA_BLOB nt_response,
const struct tsocket_address *remote,
* we need to check against domain->name.
*/
if (!skip_sam && strequal(domain->name, get_global_sam_name())) {
- DATA_BLOB chal_blob = data_blob_const(
- chal, 8);
struct netr_SamInfo3 *info3 = NULL;
result = winbindd_dual_auth_passdb(
workstation, /* We carefully set this above so use it... */
logon_id,
false, /* plaintext_given */
- chal,
+ chal_blob,
lm_response,
nt_response,
interactive,
uint16_t validation_level = UINT16_MAX;
union netr_Validation *validation = NULL;
DATA_BLOB lm_resp = { 0 }, nt_resp = { 0 };
+ DATA_BLOB chal = data_blob_null;
const struct timeval start_time = timeval_current();
const struct tsocket_address *remote = NULL;
const struct tsocket_address *local = NULL;
state->request->data.auth_crap.nt_resp,
state->request->data.auth_crap.nt_resp_len);
}
+ chal = data_blob_const(state->request->data.auth_crap.chal, 8);
result = winbind_dual_SamLogon(domain,
state->mem_ctx,
logon_id,
state->request->client_name,
state->request->pid,
- state->request->data.auth_crap.chal,
+ chal,
lm_resp,
nt_resp,
remote,
const uint64_t logon_id,
const char *client_name,
const int pid,
- const uint8_t chal[8],
+ DATA_BLOB chal,
DATA_BLOB lm_response,
DATA_BLOB nt_response,
const struct tsocket_address *remote,