replace all data_blob(NULL, 0) calls.
static const uint8 *get_ntlm_challenge(struct auth_context *auth_context)
{
- DATA_BLOB challenge = data_blob(NULL, 0);
+ DATA_BLOB challenge = data_blob_null;
const char *challenge_set_by = NULL;
auth_methods *auth_method;
TALLOC_CTX *mem_ctx;
BOOL password_ok(char *smb_name, DATA_BLOB password_blob)
{
- DATA_BLOB null_password = data_blob(NULL, 0);
+ DATA_BLOB null_password = data_blob_null;
BOOL encrypted = (global_encrypted_passwords_negotiated && (password_blob.length == 24 || password_blob.length > 46));
if (encrypted) {
BOOL ret;
NTSTATUS nt_status;
NTSTATUS update_login_attempts_status;
- DATA_BLOB user_sess_key = data_blob(NULL, 0);
- DATA_BLOB lm_sess_key = data_blob(NULL, 0);
+ DATA_BLOB user_sess_key = data_blob_null;
+ DATA_BLOB lm_sess_key = data_blob_null;
BOOL updated_autolock = False, updated_badpw = False;
if (!user_info || !auth_context) {
to pass that unencrypted password over */
*my_private_data =
(void *)make_server_security_state(cli);
- return data_blob(NULL, 0);
+ return data_blob_null;
} else if (cli->secblob.length < 8) {
/* We can't do much if we don't get a full challenge */
DEBUG(2,("make_auth_info_server: Didn't receive a full challenge from server\n"));
cli_shutdown(cli);
- return data_blob(NULL, 0);
+ return data_blob_null;
}
if (!(*my_private_data = (void *)make_server_security_state(cli))) {
- return data_blob(NULL,0);
+ return data_blob_null;
}
/* The return must be allocated on the caller's mem_ctx, as our own will be
destoyed just after the call. */
return data_blob_talloc(auth_context->mem_ctx, cli->secblob.data,8);
} else {
- return data_blob(NULL, 0);
+ return data_blob_null;
}
}
/* We can't do an NT hash here, as the password needs to be
case insensitive */
- local_nt_blob = data_blob(NULL, 0);
+ local_nt_blob = data_blob_null;
} else {
- local_lm_blob = data_blob(NULL, 0);
- local_nt_blob = data_blob(NULL, 0);
+ local_lm_blob = data_blob_null;
+ local_nt_blob = data_blob_null;
}
ret = make_user_info_map(
/* ensure we are never given NULL session keys */
if (memcmp(info3->user_sess_key, zeros, sizeof(zeros)) == 0) {
- result->user_session_key = data_blob(NULL, 0);
+ result->user_session_key = data_blob_null;
} else {
result->user_session_key = data_blob_talloc(
result, info3->user_sess_key,
}
if (memcmp(info3->lm_sess_key, zeros, 8) == 0) {
- result->lm_session_key = data_blob(NULL, 0);
+ result->lm_session_key = data_blob_null;
} else {
result->lm_session_key = data_blob_talloc(
result, info3->lm_sess_key,
void (*free)(struct data_blob_ *data_blob);
} DATA_BLOB;
+extern const DATA_BLOB data_blob_null;
+
/*
* Structure used to keep directory state information around.
* Used in NT change-notify code.
#include "includes.h"
+const DATA_BLOB data_blob_null = { NULL, 0, NULL };
+
/*******************************************************************
Free() a data blob.
*******************************************************************/
{
int ret;
ASN1_DATA data;
- DATA_BLOB blob = data_blob(NULL, 0);
- DATA_BLOB os1 = data_blob(NULL, 0);
- DATA_BLOB os2 = data_blob(NULL, 0);
- DATA_BLOB os3 = data_blob(NULL, 0);
+ DATA_BLOB blob = data_blob_null;
+ DATA_BLOB os1 = data_blob_null;
+ DATA_BLOB os2 = data_blob_null;
+ DATA_BLOB os3 = data_blob_null;
int i1;
/* half the time of a regular ldap timeout, not less than 3 seconds. */
unsigned int al_secs = MAX(3,lp_ldap_timeout()/2);
*principal = NULL;
*pac_data = NULL;
- *ap_rep = data_blob(NULL,0);
- *session_key = data_blob(NULL,0);
+ *ap_rep = data_blob_null;
+ *session_key = data_blob_null;
initialize_krb5_error_table();
ret = krb5_init_context(&context);
realm = c;
} else {
/* We must have a realm component. */
- return data_blob(NULL, 0);
+ return data_blob_null;
}
memset(&req, 0, sizeof(req));
*/
static ADS_STATUS ads_sasl_spnego_ntlmssp_bind(ADS_STRUCT *ads)
{
- DATA_BLOB msg1 = data_blob(NULL, 0);
- DATA_BLOB blob = data_blob(NULL, 0);
- DATA_BLOB blob_in = data_blob(NULL, 0);
- DATA_BLOB blob_out = data_blob(NULL, 0);
+ DATA_BLOB msg1 = data_blob_null;
+ DATA_BLOB blob = data_blob_null;
+ DATA_BLOB blob_in = data_blob_null;
+ DATA_BLOB blob_out = data_blob_null;
struct berval cred, *scred = NULL;
int rc;
NTSTATUS nt_status;
return ADS_ERROR_NT(nt_status);
}
- blob_in = data_blob(NULL, 0);
+ blob_in = data_blob_null;
do {
nt_status = ntlmssp_update(ntlmssp_state,
blob = data_blob(scred->bv_val, scred->bv_len);
ber_bvfree(scred);
} else {
- blob = data_blob(NULL, 0);
+ blob = data_blob_null;
}
} else {
if ((turn == 1) &&
(rc == LDAP_SASL_BIND_IN_PROGRESS)) {
- DATA_BLOB tmp_blob = data_blob(NULL, 0);
+ DATA_BLOB tmp_blob = data_blob_null;
/* the server might give us back two challenges */
if (!spnego_parse_challenge(blob, &blob_in,
&tmp_blob)) {
*/
static ADS_STATUS ads_sasl_spnego_krb5_bind(ADS_STRUCT *ads, const char *principal)
{
- DATA_BLOB blob = data_blob(NULL, 0);
+ DATA_BLOB blob = data_blob_null;
struct berval cred, *scred = NULL;
- DATA_BLOB session_key = data_blob(NULL, 0);
+ DATA_BLOB session_key = data_blob_null;
int rc;
rc = spnego_gen_negTokenTarg(principal, ads->auth.time_offset, &blob, &session_key, 0,
const char *pass, size_t passlen,
const char *workgroup)
{
- DATA_BLOB session_key = data_blob(NULL, 0);
- DATA_BLOB lm_response = data_blob(NULL, 0);
+ DATA_BLOB session_key = data_blob_null;
+ DATA_BLOB lm_response = data_blob_null;
fstring pword;
char *p;
const char *workgroup)
{
uint32 capabilities = cli_session_setup_capabilities(cli);
- DATA_BLOB lm_response = data_blob(NULL, 0);
- DATA_BLOB nt_response = data_blob(NULL, 0);
- DATA_BLOB session_key = data_blob(NULL, 0);
+ DATA_BLOB lm_response = data_blob_null;
+ DATA_BLOB nt_response = data_blob_null;
+ DATA_BLOB session_key = data_blob_null;
NTSTATUS result;
char *p;
E_md4hash(pass, nt_hash);
#ifdef LANMAN_ONLY
- nt_response = data_blob(NULL, 0);
+ nt_response = data_blob_null;
#else
nt_response = data_blob(NULL, 24);
SMBNTencrypt(pass,cli->secblob.data,nt_response.data);
static DATA_BLOB cli_session_setup_blob_receive(struct cli_state *cli)
{
- DATA_BLOB blob2 = data_blob(NULL, 0);
+ DATA_BLOB blob2 = data_blob_null;
char *p;
size_t len;
{
int32 remaining = blob.length;
int32 cur = 0;
- DATA_BLOB send_blob = data_blob(NULL, 0);
+ DATA_BLOB send_blob = data_blob_null;
int32 max_blob_size = 0;
- DATA_BLOB receive_blob = data_blob(NULL, 0);
+ DATA_BLOB receive_blob = data_blob_null;
if (cli->max_xmit < BASE_SESSSETUP_BLOB_PACKET_SIZE + 1) {
DEBUG(0,("cli_session_setup_blob: cli->max_xmit too small "
send_blob.length = max_blob_size;
remaining -= max_blob_size;
} else {
- DATA_BLOB null_blob = data_blob(NULL, 0);
+ DATA_BLOB null_blob = data_blob_null;
send_blob.length = remaining;
remaining = 0;
NTSTATUS nt_status;
int turn = 1;
DATA_BLOB msg1;
- DATA_BLOB blob = data_blob(NULL, 0);
- DATA_BLOB blob_in = data_blob(NULL, 0);
- DATA_BLOB blob_out = data_blob(NULL, 0);
+ DATA_BLOB blob = data_blob_null;
+ DATA_BLOB blob_in = data_blob_null;
+ DATA_BLOB blob_out = data_blob_null;
cli_temp_set_signing(cli);
}
} else if ((turn == 1) &&
NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
- DATA_BLOB tmp_blob = data_blob(NULL, 0);
+ DATA_BLOB tmp_blob = data_blob_null;
/* the server might give us back two challenges */
if (!spnego_parse_challenge(blob, &blob_in,
&tmp_blob)) {
DATA_BLOB key = data_blob(ntlmssp_state->session_key.data,
ntlmssp_state->session_key.length);
- DATA_BLOB null_blob = data_blob(NULL, 0);
+ DATA_BLOB null_blob = data_blob_null;
BOOL res;
fstrcpy(cli->server_domain, ntlmssp_state->server_domain);
return cli_nt_error(cli);
}
- *blob = data_blob(NULL, 0);
+ *blob = data_blob_null;
return NT_STATUS_OK;
}
const char *pass,
const char *domain)
{
- DATA_BLOB blob_in = data_blob(NULL, 0);
- DATA_BLOB blob_out = data_blob(NULL, 0);
- DATA_BLOB param_out = data_blob(NULL, 0);
+ DATA_BLOB blob_in = data_blob_null;
+ DATA_BLOB blob_out = data_blob_null;
+ DATA_BLOB param_out = data_blob_null;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
struct smb_trans_enc_state *es = make_cli_enc_state(SMB_TRANS_ENC_NTLM);
gss_buffer_desc input_name;
gss_buffer_desc *p_tok_in;
gss_buffer_desc tok_out, tok_in;
- DATA_BLOB blob_out = data_blob(NULL, 0);
- DATA_BLOB blob_in = data_blob(NULL, 0);
+ DATA_BLOB blob_out = data_blob_null;
+ DATA_BLOB blob_in = data_blob_null;
char *host_princ_s = NULL;
OM_uint32 ret_flags = 0;
NTSTATUS status = NT_STATUS_OK;
NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli)
{
- DATA_BLOB blob_recv = data_blob(NULL, 0);
- DATA_BLOB blob_send = data_blob(NULL, 0);
- DATA_BLOB param_out = data_blob(NULL, 0);
+ DATA_BLOB blob_recv = data_blob_null;
+ DATA_BLOB blob_send = data_blob_null;
+ DATA_BLOB param_out = data_blob_null;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
fstring fqdn;
const char *servicename;
asn1_check_enumerated(&data, negResult);
asn1_end_tag(&data);
- *auth = data_blob(NULL,0);
+ *auth = data_blob_null;
if (asn1_tag_remaining(&data)) {
asn1_start_tag(&data,ASN1_CONTEXT(1));
return NT_STATUS_INVALID_PARAMETER;
}
- *out = data_blob(NULL, 0);
+ *out = data_blob_null;
if (!in.length && ntlmssp_state->stored_response.length) {
input = ntlmssp_state->stored_response;
/* we only want to read the stored response once - overwrite it */
- ntlmssp_state->stored_response = data_blob(NULL, 0);
+ ntlmssp_state->stored_response = data_blob_null;
} else {
input = in;
}
NTLMSSP_NAME_TYPE_SERVER_DNS, dnsname,
0, "");
} else {
- struct_blob = data_blob(NULL, 0);
+ struct_blob = data_blob_null;
}
{
static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
const DATA_BLOB request, DATA_BLOB *reply)
{
- DATA_BLOB encrypted_session_key = data_blob(NULL, 0);
- DATA_BLOB user_session_key = data_blob(NULL, 0);
- DATA_BLOB lm_session_key = data_blob(NULL, 0);
- DATA_BLOB session_key = data_blob(NULL, 0);
+ DATA_BLOB encrypted_session_key = data_blob_null;
+ DATA_BLOB user_session_key = data_blob_null;
+ DATA_BLOB lm_session_key = data_blob_null;
+ DATA_BLOB session_key = data_blob_null;
uint32 ntlmssp_command, auth_flags;
NTSTATUS nt_status = NT_STATUS_OK;
char *workstation = NULL;
/* parse the NTLMSSP packet */
- *reply = data_blob(NULL, 0);
+ *reply = data_blob_null;
#if 0
file_save("ntlmssp_auth.dat", request.data, request.length);
} else {
DEBUG(10,("ntlmssp_server_auth: Failed to create NTLM2 session key.\n"));
- session_key = data_blob(NULL, 0);
+ session_key = data_blob_null;
}
} else if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_LM_KEY) {
if (lm_session_key.data && lm_session_key.length >= 8) {
session_key.length);
} else {
DEBUG(10,("ntlmssp_server_auth: Failed to create NTLM session key.\n"));
- session_key = data_blob(NULL, 0);
+ session_key = data_blob_null;
}
} else if (user_session_key.data) {
session_key = user_session_key;
dump_data_pw("unmodified session key:\n", session_key.data, session_key.length);
} else {
DEBUG(10,("ntlmssp_server_auth: Failed to create unmodified session key.\n"));
- session_key = data_blob(NULL, 0);
+ session_key = data_blob_null;
}
/* With KEY_EXCH, the client supplies the proposed session key,
}
if (!NT_STATUS_IS_OK(nt_status)) {
- ntlmssp_state->session_key = data_blob(NULL, 0);
+ ntlmssp_state->session_key = data_blob_null;
} else if (ntlmssp_state->session_key.length) {
nt_status = ntlmssp_sign_init(ntlmssp_state);
}
uint32 chal_flags, ntlmssp_command, unkn1, unkn2;
DATA_BLOB server_domain_blob;
DATA_BLOB challenge_blob;
- DATA_BLOB struct_blob = data_blob(NULL, 0);
+ DATA_BLOB struct_blob = data_blob_null;
char *server_domain;
const char *chal_parse_string;
const char *auth_gen_string;
- DATA_BLOB lm_response = data_blob(NULL, 0);
- DATA_BLOB nt_response = data_blob(NULL, 0);
- DATA_BLOB session_key = data_blob(NULL, 0);
- DATA_BLOB encrypted_session_key = data_blob(NULL, 0);
+ DATA_BLOB lm_response = data_blob_null;
+ DATA_BLOB nt_response = data_blob_null;
+ DATA_BLOB session_key = data_blob_null;
+ DATA_BLOB encrypted_session_key = data_blob_null;
NTSTATUS nt_status = NT_STATUS_OK;
if (!msrpc_parse(&reply, "CdBd",
b = (DATA_BLOB *)va_arg(ap, void *);
if (len1 == 0 && len2 == 0) {
- *b = data_blob(NULL, 0);
+ *b = data_blob_null;
} else {
/* make sure its in the right format - be strict */
if ((len1 != len2) || (ptr + len1 < ptr) || (ptr + len1 < len1) || (ptr + len1 > blob->length)) {
DATA_BLOB NTLMv2_generate_names_blob(const char *hostname,
const char *domain)
{
- DATA_BLOB names_blob = data_blob(NULL, 0);
+ DATA_BLOB names_blob = data_blob_null;
msrpc_gen(&names_blob, "aaa",
NTLMSSP_NAME_TYPE_DOMAIN, domain,
static DATA_BLOB NTLMv2_generate_client_data(const DATA_BLOB *names_blob)
{
uchar client_chal[8];
- DATA_BLOB response = data_blob(NULL, 0);
+ DATA_BLOB response = data_blob_null;
char long_date[8];
generate_random_buffer(client_chal, sizeof(client_chal));
Since we have a copy of the initial message that the client sent, we could
resolve any discrepancies if we had to.
*/
- dummy_msg = data_blob(NULL, 0);
- reply = data_blob(NULL, 0);
+ dummy_msg = data_blob_null;
+ reply = data_blob_null;
status = ntlmssp_update(ntlmssp_state, dummy_msg, &reply);
data_blob_free(&dummy_msg);
data_blob_free(&reply);
local_lm_response,
sizeof(local_lm_response));
} else {
- lm_resp = data_blob(NULL, 0);
+ lm_resp = data_blob_null;
}
SMBNTencrypt(state->request.data.auth.pass,
chal,
sampass->nt_pw =
data_blob_talloc(sampass, pwd, NT_HASH_LEN);
} else {
- sampass->nt_pw = data_blob(NULL, 0);
+ sampass->nt_pw = data_blob_null;
}
return pdb_set_init_flags(sampass, PDB_NTPASSWD, flag);
if (pwd && lp_lanman_auth() ) {
sampass->lm_pw = data_blob_talloc(sampass, pwd, LM_HASH_LEN);
} else {
- sampass->lm_pw = data_blob(NULL, 0);
+ sampass->lm_pw = data_blob_null;
}
return pdb_set_init_flags(sampass, PDB_LMPASSWD, flag);
*/
/* Null password is ok - we are already an authenticated user... */
- null_pw = data_blob(NULL, 0);
+ null_pw = data_blob_null;
fstrcpy(res_type, "A:");
become_root();
conn = make_connection_with_chdir("print$", null_pw, res_type, user->vuid, &nt_status);
* Note we must be root to do this.
*/
- null_pw = data_blob(NULL, 0);
+ null_pw = data_blob_null;
fstrcpy(res_type, "A:");
become_root();
conn = make_connection_with_chdir("print$", null_pw, res_type, user->vuid, &nt_status);
* do this.
*/
- null_pw = data_blob( NULL, 0 );
+ null_pw = data_blob_null;
fstrcpy(res_type, "A:");
become_root();
conn = make_connection_with_chdir( "print$", null_pw, res_type, user->vuid, &nt_status );
#ifdef HAVE_KRB5
int ret;
struct kerberos_auth_struct *a = cli->auth.a_u.kerberos_auth;
- DATA_BLOB tkt = data_blob(NULL, 0);
- DATA_BLOB tkt_wrapped = data_blob(NULL, 0);
+ DATA_BLOB tkt = data_blob_null;
+ DATA_BLOB tkt_wrapped = data_blob_null;
/* We may change the pad length before marshalling. */
init_rpc_hdr_auth(pauth_out, RPC_KRB5_AUTH_TYPE, (int)auth_level, 0, 1);
prs_struct *auth_data)
{
NTSTATUS nt_status;
- DATA_BLOB null_blob = data_blob(NULL, 0);
- DATA_BLOB request = data_blob(NULL, 0);
- DATA_BLOB spnego_msg = data_blob(NULL, 0);
+ DATA_BLOB null_blob = data_blob_null;
+ DATA_BLOB request = data_blob_null;
+ DATA_BLOB spnego_msg = data_blob_null;
/* We may change the pad length before marshalling. */
init_rpc_hdr_auth(pauth_out, RPC_SPNEGO_AUTH_TYPE, (int)auth_level, 0, 1);
prs_struct *auth_data)
{
NTSTATUS nt_status;
- DATA_BLOB null_blob = data_blob(NULL, 0);
- DATA_BLOB request = data_blob(NULL, 0);
+ DATA_BLOB null_blob = data_blob_null;
+ DATA_BLOB request = data_blob_null;
/* We may change the pad length before marshalling. */
init_rpc_hdr_auth(pauth_out, RPC_NTLMSSP_AUTH_TYPE, (int)auth_level, 0, 1);
{
RPC_HDR_AUTH auth_info;
NTSTATUS status;
- DATA_BLOB auth_blob = data_blob(NULL, 0);
+ DATA_BLOB auth_blob = data_blob_null;
uint16 data_and_pad_len = prs_offset(outgoing_pdu) - RPC_HEADER_LEN - RPC_HDR_RESP_LEN;
if (!cli->auth.a_u.ntlmssp_state) {
enum pipe_auth_type auth_type,
enum pipe_auth_level auth_level)
{
- DATA_BLOB server_response = data_blob(NULL,0);
- DATA_BLOB client_reply = data_blob(NULL,0);
+ DATA_BLOB server_response = data_blob_null;
+ DATA_BLOB client_reply = data_blob_null;
RPC_HDR_AUTH hdr_auth;
NTSTATUS nt_status;
prs_struct rpc_out;
enum pipe_auth_type auth_type,
enum pipe_auth_level auth_level)
{
- DATA_BLOB server_spnego_response = data_blob(NULL,0);
- DATA_BLOB server_ntlm_response = data_blob(NULL,0);
- DATA_BLOB client_reply = data_blob(NULL,0);
- DATA_BLOB tmp_blob = data_blob(NULL, 0);
+ DATA_BLOB server_spnego_response = data_blob_null;
+ DATA_BLOB server_ntlm_response = data_blob_null;
+ DATA_BLOB client_reply = data_blob_null;
+ DATA_BLOB tmp_blob = data_blob_null;
RPC_HDR_AUTH hdr_auth;
NTSTATUS nt_status;
prs_struct rpc_out;
tmp_blob = spnego_gen_auth(client_reply);
data_blob_free(&client_reply);
client_reply = tmp_blob;
- tmp_blob = data_blob(NULL,0); /* Ensure it's safe to free this just in case. */
+ tmp_blob = data_blob_null; /* Ensure it's safe to free this just in case. */
/* Now prepare the alter context pdu. */
prs_init(&rpc_out, 0, prs_get_mem_context(rbuf), MARSHALL);
if (munged_dial) {
munged_dial_blob = base64_decode_data_blob(munged_dial);
} else {
- munged_dial_blob = data_blob(NULL, 0);
+ munged_dial_blob = data_blob_null;
}
/* Create NTTIME structs */
if (munged_dial) {
blob = base64_decode_data_blob(munged_dial);
} else {
- blob = data_blob(NULL, 0);
+ blob = data_blob_null;
}
init_unistr2_from_datablob(&usr->uni_munged_dial, &blob);
/* Null password is ok - we are already an authenticated user... */
- null_pw = data_blob(NULL, 0);
+ null_pw = data_blob_null;
become_root();
conn = make_connection(r->in.share, null_pw, "A:", p->pipe_user.vuid, &nt_status);
ZERO_STRUCT(st);
/* Null password is ok - we are already an authenticated user... */
- null_pw = data_blob(NULL, 0);
+ null_pw = data_blob_null;
become_root();
conn = make_connection(r->in.share, null_pw, "A:", p->pipe_user.vuid, &nt_status);
strlower_m(myname);
asprintf(&host_princ_s, "cifs/%s@%s", myname, lp_realm());
if (host_princ_s == NULL) {
- blob = data_blob(NULL, 0);
+ blob = data_blob_null;
return blob;
}
blob = spnego_gen_negTokenInit(guid, OIDs_krb5, host_princ_s);
OM_uint32 flags = 0;
gss_buffer_desc in_buf, out_buf;
struct smb_tran_enc_state_gss *gss_state;
- DATA_BLOB auth_reply = data_blob(NULL,0);
- DATA_BLOB response = data_blob(NULL,0);
+ DATA_BLOB auth_reply = data_blob_null;
+ DATA_BLOB response = data_blob_null;
NTSTATUS status;
if (!partial_srv_trans_enc_ctx) {
static NTSTATUS srv_enc_ntlm_negotiate(unsigned char **ppdata, size_t *p_data_size, DATA_BLOB secblob, BOOL spnego_wrap)
{
NTSTATUS status;
- DATA_BLOB chal = data_blob(NULL, 0);
- DATA_BLOB response = data_blob(NULL, 0);
+ DATA_BLOB chal = data_blob_null;
+ DATA_BLOB response = data_blob_null;
status = make_srv_encryption_context(SMB_TRANS_ENC_NTLM, &partial_srv_trans_enc_ctx);
if (!NT_STATUS_IS_OK(status)) {
size_t *p_param_size)
{
NTSTATUS status;
- DATA_BLOB blob = data_blob(NULL,0);
- DATA_BLOB secblob = data_blob(NULL, 0);
+ DATA_BLOB blob = data_blob_null;
+ DATA_BLOB secblob = data_blob_null;
BOOL got_kerberos_mechanism = False;
blob = data_blob_const(*ppdata, *p_data_size);
size_t *p_param_size)
{
NTSTATUS status;
- DATA_BLOB blob = data_blob(NULL,0);
- DATA_BLOB auth = data_blob(NULL,0);
- DATA_BLOB auth_reply = data_blob(NULL,0);
- DATA_BLOB response = data_blob(NULL,0);
+ DATA_BLOB blob = data_blob_null;
+ DATA_BLOB auth = data_blob_null;
+ DATA_BLOB auth_reply = data_blob_null;
+ DATA_BLOB response = data_blob_null;
struct smb_srv_trans_enc_ctx *ec = partial_srv_trans_enc_ctx;
/* We must have a partial context here. */
{
NTSTATUS status;
DATA_BLOB blob = data_blob_const(*ppdata, *p_data_size);
- DATA_BLOB response = data_blob(NULL,0);
+ DATA_BLOB response = data_blob_null;
struct smb_srv_trans_enc_ctx *ec;
if (!partial_srv_trans_enc_ctx) {
if (strequal(service_in,HOMES_NAME)) {
if(lp_security() != SEC_SHARE) {
- DATA_BLOB no_pw = data_blob(NULL, 0);
+ DATA_BLOB no_pw = data_blob_null;
if (vuser->homes_snum == -1) {
DEBUG(2, ("[homes] share not available for "
"this user because it was not found "
} else if ((lp_security() != SEC_SHARE) && (vuser->homes_snum != -1)
&& strequal(service_in,
lp_servicename(vuser->homes_snum))) {
- DATA_BLOB no_pw = data_blob(NULL, 0);
+ DATA_BLOB no_pw = data_blob_null;
DEBUG(5, ("making a connection to 'homes' service [%s] "
"created at session setup time\n", service_in));
return make_connection_snum(vuser->homes_snum,
char *host_princ_s = NULL;
BOOL ret = False;
- *pblob_out = data_blob(NULL,0);
+ *pblob_out = data_blob_null;
initialize_krb5_error_table();
kerr = krb5_init_context(&context);
PAC_DATA *pac_data;
DATA_BLOB ap_rep, ap_rep_wrapped, response;
auth_serversupplied_info *server_info = NULL;
- DATA_BLOB session_key = data_blob(NULL, 0);
+ DATA_BLOB session_key = data_blob_null;
uint8 tok_id[2];
- DATA_BLOB nullblob = data_blob(NULL, 0);
+ DATA_BLOB nullblob = data_blob_null;
fstring real_username;
BOOL map_domainuser_to_guest = False;
BOOL username_was_mapped;
if (NT_STATUS_IS_OK(ret)) {
ap_rep_wrapped = spnego_gen_krb5_wrap(ap_rep, TOK_ID_KRB_AP_REP);
} else {
- ap_rep_wrapped = data_blob(NULL, 0);
+ ap_rep_wrapped = data_blob_null;
}
response = spnego_gen_auth_response(&ap_rep_wrapped, ret, OID_KERBEROS5_OLD);
reply_sesssetup_blob(conn, inbuf, outbuf, response, ret);
if (NT_STATUS_IS_OK(nt_status)) {
int sess_vuid;
- DATA_BLOB nullblob = data_blob(NULL, 0);
+ DATA_BLOB nullblob = data_blob_null;
DATA_BLOB session_key = data_blob((*auth_ntlmssp_state)->ntlmssp_state->session_key.data, (*auth_ntlmssp_state)->ntlmssp_state->session_key.length);
/* register_vuid keeps the server info */
DATA_BLOB blob1,
AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
{
- DATA_BLOB auth = data_blob(NULL,0);
- DATA_BLOB auth_reply = data_blob(NULL,0);
- DATA_BLOB secblob = data_blob(NULL,0);
+ DATA_BLOB auth = data_blob_null;
+ DATA_BLOB auth_reply = data_blob_null;
+ DATA_BLOB secblob = data_blob_null;
NTSTATUS status = NT_STATUS_INVALID_PARAMETER;
if (!spnego_parse_auth(blob1, &auth)) {
}
if (!vuser) {
- vuid = register_vuid(NULL, data_blob(NULL, 0), data_blob(NULL, 0), NULL);
+ vuid = register_vuid(NULL, data_blob_null, data_blob_null, NULL);
if (vuid == UID_FIELD_INVALID ) {
data_blob_free(&blob1);
return ERROR_NT(nt_status_squash(NT_STATUS_INVALID_PARAMETER));
if (server_info->user_session_key.data) {
session_key = data_blob(server_info->user_session_key.data, server_info->user_session_key.length);
} else {
- session_key = data_blob(NULL, 0);
+ session_key = data_blob_null;
}
data_blob_clear_free(&plaintext_password);
}
request = base64_decode_data_blob(buf + 3);
} else {
- request = data_blob(NULL, 0);
+ request = data_blob_null;
}
if ((strncmp(buf, "PW ", 3) == 0)) {
}
request = base64_decode_data_blob(buf + 3);
} else {
- request = data_blob(NULL, 0);
+ request = data_blob_null;
}
if (strncmp(buf, "PW ", 3) == 0) {
if (!ntlmssp_state && use_cached_creds) {
/* check whether credentials are usable. */
- DATA_BLOB empty_blob = data_blob(NULL, 0);
+ DATA_BLOB empty_blob = data_blob_null;
nt_status = do_ccache_ntlm_auth(empty_blob, empty_blob, NULL);
if (!NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
}
ntlmssp_want_feature_list(ntlmssp_state, want_feature_list);
first = True;
- initial_message = data_blob(NULL, 0);
+ initial_message = data_blob_null;
}
DEBUG(10, ("got NTLMSSP packet:\n"));
response.type = SPNEGO_NEG_TOKEN_TARG;
response.negTokenTarg.supportedMech = SMB_STRDUP(OID_NTLMSSP);
- response.negTokenTarg.mechListMIC = data_blob(NULL, 0);
+ response.negTokenTarg.mechListMIC = data_blob_null;
status = ntlmssp_update(ntlmssp_state,
request.negTokenInit.mechToken,
response.type = SPNEGO_NEG_TOKEN_TARG;
response.negTokenTarg.supportedMech = SMB_STRDUP(OID_KERBEROS5_OLD);
- response.negTokenTarg.mechListMIC = data_blob(NULL, 0);
- response.negTokenTarg.responseToken = data_blob(NULL, 0);
+ response.negTokenTarg.mechListMIC = data_blob_null;
+ response.negTokenTarg.responseToken = data_blob_null;
status = ads_verify_ticket(mem_ctx, lp_realm(), 0,
&request.negTokenInit.mechToken,
response.type = SPNEGO_NEG_TOKEN_TARG;
response.negTokenTarg.supportedMech = SMB_STRDUP(OID_NTLMSSP);
- response.negTokenTarg.mechListMIC = data_blob(NULL, 0);
+ response.negTokenTarg.mechListMIC = data_blob_null;
if (NT_STATUS_IS_OK(status)) {
user = SMB_STRDUP(ntlmssp_state->user);
static BOOL manage_client_ntlmssp_init(SPNEGO_DATA spnego)
{
NTSTATUS status;
- DATA_BLOB null_blob = data_blob(NULL, 0);
+ DATA_BLOB null_blob = data_blob_null;
DATA_BLOB to_server;
char *to_server_base64;
const char *my_mechs[] = {OID_NTLMSSP, NULL};
static void manage_client_ntlmssp_targ(SPNEGO_DATA spnego)
{
NTSTATUS status;
- DATA_BLOB null_blob = data_blob(NULL, 0);
+ DATA_BLOB null_blob = data_blob_null;
DATA_BLOB request;
DATA_BLOB to_server;
char *to_server_base64;
{
char *principal;
DATA_BLOB tkt, to_server;
- DATA_BLOB session_key_krb5 = data_blob(NULL, 0);
+ DATA_BLOB session_key_krb5 = data_blob_null;
SPNEGO_DATA reply;
char *reply_base64;
int retval;
reply.negTokenInit.mechTypes = my_mechs;
reply.negTokenInit.reqFlags = 0;
reply.negTokenInit.mechToken = tkt;
- reply.negTokenInit.mechListMIC = data_blob(NULL, 0);
+ reply.negTokenInit.mechListMIC = data_blob_null;
len = write_spnego_data(&to_server, &reply);
data_blob_free(&tkt);
}
}
/* clear out the state */
- challenge = data_blob(NULL, 0);
- nt_response = data_blob(NULL, 0);
- lm_response = data_blob(NULL, 0);
+ challenge = data_blob_null;
+ nt_response = data_blob_null;
+ lm_response = data_blob_null;
SAFE_FREE(full_username);
SAFE_FREE(username);
SAFE_FREE(domain);
x_fprintf(x_stdout, "Error: hex decode of %s failed! (got %d bytes, expected 8)\n.\n",
parameter,
(int)challenge.length);
- challenge = data_blob(NULL, 0);
+ challenge = data_blob_null;
}
} else if (strequal(request, "NT-Response")) {
nt_response = strhex_to_data_blob(NULL, parameter);
x_fprintf(x_stdout, "Error: hex decode of %s failed! (only got %d bytes, needed at least 24)\n.\n",
parameter,
(int)nt_response.length);
- nt_response = data_blob(NULL, 0);
+ nt_response = data_blob_null;
}
} else if (strequal(request, "LANMAN-Response")) {
lm_response = strhex_to_data_blob(NULL, parameter);
x_fprintf(x_stdout, "Error: hex decode of %s failed! (got %d bytes, expected 24)\n.\n",
parameter,
(int)lm_response.length);
- lm_response = data_blob(NULL, 0);
+ lm_response = data_blob_null;
}
} else if (strequal(request, "Password")) {
plaintext_password = smb_xstrdup(parameter);
SAFE_FREE(error_string);
}
/* clear out the state */
- new_nt_pswd = data_blob(NULL, 0);
- old_nt_hash_enc = data_blob(NULL, 0);
- new_lm_pswd = data_blob(NULL, 0);
- old_nt_hash_enc = data_blob(NULL, 0);
+ new_nt_pswd = data_blob_null;
+ old_nt_hash_enc = data_blob_null;
+ new_lm_pswd = data_blob_null;
+ old_nt_hash_enc = data_blob_null;
SAFE_FREE(full_username);
SAFE_FREE(username);
SAFE_FREE(domain);
"(got %d bytes, expected 516)\n.\n",
parameter,
(int)new_nt_pswd.length);
- new_nt_pswd = data_blob(NULL, 0);
+ new_nt_pswd = data_blob_null;
}
} else if (strequal(request, "old-nt-hash-blob")) {
old_nt_hash_enc = strhex_to_data_blob(NULL, parameter);
"(got %d bytes, expected 16)\n.\n",
parameter,
(int)old_nt_hash_enc.length);
- old_nt_hash_enc = data_blob(NULL, 0);
+ old_nt_hash_enc = data_blob_null;
}
} else if (strequal(request, "new-lm-password-blob")) {
new_lm_pswd = strhex_to_data_blob(NULL, parameter);
"(got %d bytes, expected 516)\n.\n",
parameter,
(int)new_lm_pswd.length);
- new_lm_pswd = data_blob(NULL, 0);
+ new_lm_pswd = data_blob_null;
}
}
else if (strequal(request, "old-lm-hash-blob")) {
"(got %d bytes, expected 16)\n.\n",
parameter,
(int)old_lm_hash_enc.length);
- old_lm_hash_enc = data_blob(NULL, 0);
+ old_lm_hash_enc = data_blob_null;
}
} else if (strequal(request, "nt-domain")) {
domain = smb_xstrdup(parameter);
BOOL pass = True;
NTSTATUS nt_status;
uint32 flags = 0;
- DATA_BLOB ntlmv2_response = data_blob(NULL, 0);
- DATA_BLOB lmv2_response = data_blob(NULL, 0);
- DATA_BLOB ntlmv2_session_key = data_blob(NULL, 0);
+ DATA_BLOB ntlmv2_response = data_blob_null;
+ DATA_BLOB lmv2_response = data_blob_null;
+ DATA_BLOB ntlmv2_session_key = data_blob_null;
DATA_BLOB names_blob = NTLMv2_generate_names_blob(get_winbind_netbios_name(), get_winbind_domain());
uchar user_session_key[16];
{
NTSTATUS nt_status;
uint32 flags = 0;
- DATA_BLOB nt_response = data_blob(NULL, 0);
- DATA_BLOB lm_response = data_blob(NULL, 0);
+ DATA_BLOB nt_response = data_blob_null;
+ DATA_BLOB lm_response = data_blob_null;
char *password;
smb_ucs2_t *nt_response_ucs2;