struct ntlmssp_state *ntlmssp_state =
(struct ntlmssp_state *)ads->ldap.wrap_private_data;
- ntlmssp_end(&ntlmssp_state);
+ TALLOC_FREE(ntlmssp_state);
ads->ldap.wrap_ops = NULL;
ads->ldap.wrap_private_data = NULL;
ber_bvfree(scred);
}
- ntlmssp_end(&ntlmssp_state);
+ TALLOC_FREE(ntlmssp_state);
return ADS_ERROR(rc);
}
if (scred) {
} else {
- ntlmssp_end(&ntlmssp_state);
+ TALLOC_FREE(ntlmssp_state);
data_blob_free(&blob_out);
return ADS_ERROR_NT(nt_status);
}
if (!spnego_parse_challenge(blob, &blob_in,
&tmp_blob)) {
- ntlmssp_end(&ntlmssp_state);
+ TALLOC_FREE(ntlmssp_state);
data_blob_free(&blob);
DEBUG(3,("Failed to parse challenges\n"));
return ADS_ERROR_NT(NT_STATUS_INVALID_PARAMETER);
if (!spnego_parse_auth_response(blob, nt_status, OID_NTLMSSP,
&blob_in)) {
- ntlmssp_end(&ntlmssp_state);
+ TALLOC_FREE(ntlmssp_state);
data_blob_free(&blob);
DEBUG(3,("Failed to parse auth response\n"));
return ADS_ERROR_NT(NT_STATUS_INVALID_PARAMETER);
if (!ADS_ERR_OK(status)) {
DEBUG(0, ("ads_setup_sasl_wrapping() failed: %s\n",
ads_errstr(status)));
- ntlmssp_end(&ntlmssp_state);
+ TALLOC_FREE(ntlmssp_state);
return status;
}
} else {
- ntlmssp_end(&ntlmssp_state);
+ TALLOC_FREE(ntlmssp_state);
}
return ADS_ERROR(rc);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Could not start NTLMSSP client: %s\n",
nt_errstr(status)));
- ntlmssp_end(client_ntlmssp_state);
+ TALLOC_FREE(*client_ntlmssp_state);
return status;
}
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Could not set username: %s\n",
nt_errstr(status)));
- ntlmssp_end(client_ntlmssp_state);
+ TALLOC_FREE(*client_ntlmssp_state);
return status;
}
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Could not set domain: %s\n",
nt_errstr(status)));
- ntlmssp_end(client_ntlmssp_state);
+ TALLOC_FREE(*client_ntlmssp_state);
return status;
}
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Could not set password: %s\n",
nt_errstr(status)));
- ntlmssp_end(client_ntlmssp_state);
+ TALLOC_FREE(*client_ntlmssp_state);
return status;
}
}
if (strncmp(buf, "YR", 2) == 0) {
if (state->ntlmssp_state)
- ntlmssp_end(&state->ntlmssp_state);
+ TALLOC_FREE(state->ntlmssp_state);
state->svr_state = SERVER_INITIAL;
} else if (strncmp(buf, "KK", 2) == 0) {
/* No special preprocessing required */
x_fprintf(x_stdout, "BH %s\n", nt_errstr(nt_status));
DEBUG(0, ("NTLMSSP BH: %s\n", nt_errstr(nt_status)));
- ntlmssp_end(&state->ntlmssp_state);
+ TALLOC_FREE(state->ntlmssp_state);
} else if (!NT_STATUS_IS_OK(nt_status)) {
x_fprintf(x_stdout, "NA %s\n", nt_errstr(nt_status));
DEBUG(10, ("NTLMSSP %s\n", nt_errstr(nt_status)));
if (strncmp(buf, "YR", 2) == 0) {
if (state->ntlmssp_state)
- ntlmssp_end(&state->ntlmssp_state);
+ TALLOC_FREE(state->ntlmssp_state);
state->cli_state = CLIENT_INITIAL;
} else if (strncmp(buf, "TT", 2) == 0) {
/* No special preprocessing required */
DEBUG(10, ("NTLMSSP OK!\n"));
state->cli_state = CLIENT_FINISHED;
if (state->ntlmssp_state)
- ntlmssp_end(&state->ntlmssp_state);
+ TALLOC_FREE(state->ntlmssp_state);
} else {
x_fprintf(x_stdout, "BH %s\n", nt_errstr(nt_status));
DEBUG(0, ("NTLMSSP BH: %s\n", nt_errstr(nt_status)));
state->cli_state = CLIENT_ERROR;
if (state->ntlmssp_state)
- ntlmssp_end(&state->ntlmssp_state);
+ TALLOC_FREE(state->ntlmssp_state);
}
data_blob_free(&request);
if (strncmp(buf, "YR", 2) == 0) {
if (ntlmssp_state)
- ntlmssp_end(&ntlmssp_state);
+ TALLOC_FREE(ntlmssp_state);
} else if (strncmp(buf, "KK", 2) == 0) {
;
} else {
x_fprintf(x_stdout, "BH Client wants a new "
"NTLMSSP challenge, but "
"already got one\n");
- ntlmssp_end(&ntlmssp_state);
+ TALLOC_FREE(ntlmssp_state);
return;
}
if (NT_STATUS_IS_OK(status)) {
user = SMB_STRDUP(ntlmssp_state->user);
domain = SMB_STRDUP(ntlmssp_state->domain);
- ntlmssp_end(&ntlmssp_state);
+ TALLOC_FREE(ntlmssp_state);
}
}
NT_STATUS_IS_OK(status)) ) {
DEBUG(1, ("Expected OK or MORE_PROCESSING_REQUIRED, got: %s\n",
nt_errstr(status)));
- ntlmssp_end(&client_ntlmssp_state);
+ TALLOC_FREE(client_ntlmssp_state);
return False;
}
if (spnego.negTokenTarg.negResult == SPNEGO_REJECT) {
x_fprintf(x_stdout, "NA\n");
- ntlmssp_end(&client_ntlmssp_state);
+ TALLOC_FREE(client_ntlmssp_state);
return;
}
if (spnego.negTokenTarg.negResult == SPNEGO_ACCEPT_COMPLETED) {
x_fprintf(x_stdout, "AF\n");
- ntlmssp_end(&client_ntlmssp_state);
+ TALLOC_FREE(client_ntlmssp_state);
return;
}
x_fprintf(x_stdout, "BH Expected MORE_PROCESSING_REQUIRED from "
"ntlmssp_client_update\n");
data_blob_free(&request);
- ntlmssp_end(&client_ntlmssp_state);
+ TALLOC_FREE(client_ntlmssp_state);
return;
}
"negResult\n");
}
- ntlmssp_end(&client_ntlmssp_state);
+ TALLOC_FREE(client_ntlmssp_state);
goto out;
}