diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-05-14 12:16:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:22:01 -0500 |
commit | b4a7b7a8889737e2891fc1176feabd4ce47f2737 (patch) | |
tree | 6694c445bf83ead4e74cddcaf967a64491b57b4a /source3/libsmb | |
parent | ddf25a79f6a47fc3627f0dfdb74f47c0dffb7ff0 (diff) | |
download | samba-b4a7b7a8889737e2891fc1176feabd4ce47f2737.tar.gz samba-b4a7b7a8889737e2891fc1176feabd4ce47f2737.tar.bz2 samba-b4a7b7a8889737e2891fc1176feabd4ce47f2737.zip |
r22844: Introduce const DATA_BLOB data_blob_null = { NULL, 0, NULL }; and
replace all data_blob(NULL, 0) calls.
(This used to be commit 3d3d61687ef00181f4f04e001d42181d93ac931e)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/cliconnect.c | 30 | ||||
-rw-r--r-- | source3/libsmb/clifile.c | 2 | ||||
-rw-r--r-- | source3/libsmb/clifsinfo.c | 16 | ||||
-rw-r--r-- | source3/libsmb/clispnego.c | 2 | ||||
-rw-r--r-- | source3/libsmb/ntlmssp.c | 34 | ||||
-rw-r--r-- | source3/libsmb/ntlmssp_parse.c | 2 | ||||
-rw-r--r-- | source3/libsmb/smbencrypt.c | 4 |
7 files changed, 45 insertions, 45 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 6991905c58..86834ad081 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -61,8 +61,8 @@ static NTSTATUS cli_session_setup_lanman2(struct cli_state *cli, 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; @@ -299,9 +299,9 @@ static NTSTATUS cli_session_setup_nt1(struct cli_state *cli, const char *user, 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; @@ -334,7 +334,7 @@ static NTSTATUS cli_session_setup_nt1(struct cli_state *cli, const char *user, 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); @@ -485,7 +485,7 @@ static BOOL cli_session_setup_blob_send(struct cli_state *cli, DATA_BLOB blob) 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; @@ -534,9 +534,9 @@ static BOOL cli_session_setup_blob(struct cli_state *cli, DATA_BLOB blob, DATA_B { 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 " @@ -554,7 +554,7 @@ static BOOL cli_session_setup_blob(struct cli_state *cli, DATA_BLOB blob, DATA_B 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; @@ -656,9 +656,9 @@ static NTSTATUS cli_session_setup_ntlmssp(struct cli_state *cli, const char *use 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); @@ -715,7 +715,7 @@ static NTSTATUS cli_session_setup_ntlmssp(struct cli_state *cli, const char *use } } 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)) { @@ -743,7 +743,7 @@ static NTSTATUS cli_session_setup_ntlmssp(struct cli_state *cli, const char *use 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); diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 2e1c156f14..61c4347b5b 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -1505,7 +1505,7 @@ NTSTATUS cli_raw_ioctl(struct cli_state *cli, int fnum, uint32 code, DATA_BLOB * return cli_nt_error(cli); } - *blob = data_blob(NULL, 0); + *blob = data_blob_null; return NT_STATUS_OK; } diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c index 0bc4f7f2f2..d8ada1a896 100644 --- a/source3/libsmb/clifsinfo.c +++ b/source3/libsmb/clifsinfo.c @@ -395,9 +395,9 @@ NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli, 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); @@ -477,8 +477,8 @@ static NTSTATUS make_cli_gss_blob(struct smb_trans_enc_state *es, 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; @@ -569,9 +569,9 @@ static NTSTATUS make_cli_gss_blob(struct smb_trans_enc_state *es, 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; diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c index d2494cac86..5ea5cf3011 100644 --- a/source3/libsmb/clispnego.c +++ b/source3/libsmb/clispnego.c @@ -542,7 +542,7 @@ BOOL spnego_parse_auth_response(DATA_BLOB blob, NTSTATUS nt_status, 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)); diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c index 2bc2183add..7368070985 100644 --- a/source3/libsmb/ntlmssp.c +++ b/source3/libsmb/ntlmssp.c @@ -299,13 +299,13 @@ NTSTATUS ntlmssp_update(NTLMSSP_STATE *ntlmssp_state, 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; } @@ -582,7 +582,7 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state, NTLMSSP_NAME_TYPE_SERVER_DNS, dnsname, 0, ""); } else { - struct_blob = data_blob(NULL, 0); + struct_blob = data_blob_null; } { @@ -623,10 +623,10 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state, 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; @@ -642,7 +642,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state, 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); @@ -807,7 +807,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state, } 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) { @@ -834,7 +834,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state, 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; @@ -846,7 +846,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state, 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, @@ -877,7 +877,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state, } 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); } @@ -992,14 +992,14 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *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", diff --git a/source3/libsmb/ntlmssp_parse.c b/source3/libsmb/ntlmssp_parse.c index e71504867e..3d96fa5f1a 100644 --- a/source3/libsmb/ntlmssp_parse.c +++ b/source3/libsmb/ntlmssp_parse.c @@ -265,7 +265,7 @@ BOOL msrpc_parse(const DATA_BLOB *blob, 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)) { diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c index ad833374f3..2586128966 100644 --- a/source3/libsmb/smbencrypt.c +++ b/source3/libsmb/smbencrypt.c @@ -347,7 +347,7 @@ void SMBsesskeygen_lm_sess_key(const uchar lm_hash[16], 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, @@ -359,7 +359,7 @@ DATA_BLOB NTLMv2_generate_names_blob(const char *hostname, 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)); |