summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-24 03:40:09 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-24 03:40:09 +0200
commit922a29992ee38b8e1c851192677b89a2cd59a91a (patch)
tree9ea2826f7fd77b27d16de8be61ca7940fb066bad /source4/libcli
parent23b04a31f14dca0a3f9bcd58181f84db4b6092c7 (diff)
downloadsamba-922a29992ee38b8e1c851192677b89a2cd59a91a.tar.gz
samba-922a29992ee38b8e1c851192677b89a2cd59a91a.tar.bz2
samba-922a29992ee38b8e1c851192677b89a2cd59a91a.zip
Remove iconv_convenience parameter from simple string push/pull
functions.
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/auth/smbencrypt.c18
-rw-r--r--source4/libcli/raw/rawrequest.c4
-rw-r--r--source4/libcli/smb_composite/sesssetup.c4
3 files changed, 12 insertions, 14 deletions
diff --git a/source4/libcli/auth/smbencrypt.c b/source4/libcli/auth/smbencrypt.c
index a78c444da7..2803aaff5e 100644
--- a/source4/libcli/auth/smbencrypt.c
+++ b/source4/libcli/auth/smbencrypt.c
@@ -67,7 +67,7 @@ bool E_md4hash(const char *passwd, uint8_t p16[16])
int len;
void *wpwd;
- len = push_ucs2_talloc(NULL, lp_iconv_convenience(global_loadparm), &wpwd, passwd);
+ len = push_ucs2_talloc(NULL, &wpwd, passwd);
if (len < 2) {
/* We don't want to return fixed data, as most callers
* don't check */
@@ -97,7 +97,7 @@ bool E_deshash(const char *passwd, uint8_t p16[16])
ZERO_STRUCT(dospwd);
/* Password must be converted to DOS charset - null terminated, uppercase. */
- push_string(lp_iconv_convenience(global_loadparm), dospwd, passwd, sizeof(dospwd), STR_ASCII|STR_UPPER|STR_TERMINATE);
+ push_string(dospwd, passwd, sizeof(dospwd), STR_ASCII|STR_UPPER|STR_TERMINATE);
/* Only the first 14 chars are considered, password need not be null terminated. */
E_P16((const uint8_t *)dospwd, p16);
@@ -124,7 +124,6 @@ bool ntv2_owf_gen(const uint8_t owf[16],
HMACMD5Context ctx;
TALLOC_CTX *mem_ctx = talloc_init("ntv2_owf_gen for %s\\%s", domain_in, user_in);
- struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(global_loadparm);
if (!mem_ctx) {
return false;
@@ -152,14 +151,14 @@ bool ntv2_owf_gen(const uint8_t owf[16],
}
}
- user_byte_len = push_ucs2_talloc(mem_ctx, iconv_convenience, &user, user_in);
+ user_byte_len = push_ucs2_talloc(mem_ctx, &user, user_in);
if (user_byte_len == (ssize_t)-1) {
DEBUG(0, ("push_uss2_talloc() for user returned -1 (probably talloc() failure)\n"));
talloc_free(mem_ctx);
return false;
}
- domain_byte_len = push_ucs2_talloc(mem_ctx, iconv_convenience, &domain, domain_in);
+ domain_byte_len = push_ucs2_talloc(mem_ctx, &domain, domain_in);
if (domain_byte_len == (ssize_t)-1) {
DEBUG(0, ("push_ucs2_talloc() for domain returned -1 (probably talloc() failure)\n"));
talloc_free(mem_ctx);
@@ -295,13 +294,12 @@ void SMBsesskeygen_lm_sess_key(const uint8_t lm_hash[16],
}
DATA_BLOB NTLMv2_generate_names_blob(TALLOC_CTX *mem_ctx,
- struct smb_iconv_convenience *iconv_convenience,
const char *hostname,
const char *domain)
{
DATA_BLOB names_blob = data_blob_talloc(mem_ctx, NULL, 0);
- msrpc_gen(mem_ctx, iconv_convenience, &names_blob,
+ msrpc_gen(mem_ctx, &names_blob,
"aaa",
NTLMSSP_NAME_TYPE_DOMAIN, domain,
NTLMSSP_NAME_TYPE_SERVER, hostname,
@@ -324,7 +322,7 @@ static DATA_BLOB NTLMv2_generate_client_data(TALLOC_CTX *mem_ctx, const DATA_BLO
/* See http://www.ubiqx.org/cifs/SMB.html#SMB.8.5 */
- msrpc_gen(mem_ctx, NULL, &response, "ddbbdb",
+ msrpc_gen(mem_ctx, &response, "ddbbdb",
0x00000101, /* Header */
0, /* 'Reserved' */
long_date, 8, /* Timestamp */
@@ -472,7 +470,7 @@ bool encode_pw_buffer(uint8_t buffer[516], const char *password, int string_flag
/* the incoming buffer can be any alignment. */
string_flags |= STR_NOALIGN;
- new_pw_len = push_string(lp_iconv_convenience(global_loadparm), new_pw,
+ new_pw_len = push_string(new_pw,
password,
sizeof(new_pw), string_flags);
@@ -525,7 +523,7 @@ bool decode_pw_buffer(uint8_t in_buffer[516], char *new_pwrd,
}
/* decode into the return buffer. Buffer length supplied */
- converted_pw_len = pull_string(lp_iconv_convenience(global_loadparm), new_pwrd, &in_buffer[512 - byte_len], new_pwrd_size,
+ converted_pw_len = pull_string(new_pwrd, &in_buffer[512 - byte_len], new_pwrd_size,
byte_len, string_flags);
if (converted_pw_len == -1) {
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c
index 353b66c622..caef28d7fc 100644
--- a/source4/libcli/raw/rawrequest.c
+++ b/source4/libcli/raw/rawrequest.c
@@ -430,7 +430,7 @@ size_t smbcli_req_append_string(struct smbcli_request *req, const char *str, uin
smbcli_req_grow_allocation(req, len + req->out.data_size);
- len = push_string(lp_iconv_convenience(global_loadparm), req->out.data + req->out.data_size, str, len, flags);
+ len = push_string(req->out.data + req->out.data_size, str, len, flags);
smbcli_req_grow_data(req, len + req->out.data_size);
@@ -977,7 +977,7 @@ size_t smbcli_blob_append_string(struct smbcli_session *session,
return 0;
}
- len = push_string(lp_iconv_convenience(global_loadparm), blob->data + blob->length, str, max_len, flags);
+ len = push_string(blob->data + blob->length, str, max_len, flags);
blob->length += len;
diff --git a/source4/libcli/smb_composite/sesssetup.c b/source4/libcli/smb_composite/sesssetup.c
index 645f5362ac..76c1f952e7 100644
--- a/source4/libcli/smb_composite/sesssetup.c
+++ b/source4/libcli/smb_composite/sesssetup.c
@@ -260,7 +260,7 @@ static NTSTATUS session_setup_nt1(struct composite_context *c,
{
NTSTATUS nt_status = NT_STATUS_INTERNAL_ERROR;
struct sesssetup_state *state = talloc_get_type(c->private_data, struct sesssetup_state);
- DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, lp_iconv_convenience(global_loadparm), session->transport->socket->hostname, lp_workgroup(global_loadparm));
+ DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, session->transport->socket->hostname, lp_workgroup(global_loadparm));
DATA_BLOB session_key = data_blob(NULL, 0);
int flags = CLI_CRED_NTLM_AUTH;
@@ -334,7 +334,7 @@ static NTSTATUS session_setup_old(struct composite_context *c,
NTSTATUS nt_status;
struct sesssetup_state *state = talloc_get_type(c->private_data, struct sesssetup_state);
const char *password = cli_credentials_get_password(io->in.credentials);
- DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, lp_iconv_convenience(global_loadparm), session->transport->socket->hostname, lp_workgroup(global_loadparm));
+ DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, session->transport->socket->hostname, lp_workgroup(global_loadparm));
DATA_BLOB session_key;
int flags = 0;
if (session->options.lanman_auth) {