summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-10-18 03:24:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:02 -0500
commit8d7c88667190fe286971ac4fffb64ee5bd9eeeb0 (patch)
treed5b2f0850d63a07e051c03a7abe1f10884598161 /source3/libsmb
parentafca439d19e3d9e67b127d7060df630e2218bcb2 (diff)
downloadsamba-8d7c88667190fe286971ac4fffb64ee5bd9eeeb0.tar.gz
samba-8d7c88667190fe286971ac4fffb64ee5bd9eeeb0.tar.bz2
samba-8d7c88667190fe286971ac4fffb64ee5bd9eeeb0.zip
r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box. Jeremy. (This used to be commit d720867a788c735e56d53d63265255830ec21208)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clirap.c6
-rw-r--r--source3/libsmb/clispnego.c2
-rw-r--r--source3/libsmb/credentials.c6
-rw-r--r--source3/libsmb/ntlm_check.c18
-rw-r--r--source3/libsmb/ntlmssp_sign.c10
-rw-r--r--source3/libsmb/smbdes.c2
-rw-r--r--source3/libsmb/smbencrypt.c24
-rw-r--r--source3/libsmb/spnego.c6
-rw-r--r--source3/libsmb/trusts_util.c4
9 files changed, 40 insertions, 38 deletions
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index b53e19ef98..34f73cfafe 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -294,7 +294,7 @@ BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char
const char *old_password)
{
pstring param;
- char data[532];
+ unsigned char data[532];
char *p = param;
unsigned char old_pw_hash[16];
unsigned char new_pw_hash[16];
@@ -332,7 +332,7 @@ BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char
#ifdef DEBUG_PASSWORD
DEBUG(100,("make_oem_passwd_hash\n"));
- dump_data(100, data, 516);
+ dump_data(100, (char *)data, 516);
#endif
SamOEMhash( (unsigned char *)data, (unsigned char *)old_pw_hash, 516);
@@ -350,7 +350,7 @@ BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char
0,0, /* fid, flags */
NULL,0,0, /* setup, length, max */
param,param_len,2, /* param, length, max */
- data,data_len,0 /* data, length, max */
+ (char *)data,data_len,0 /* data, length, max */
) == False) {
DEBUG(0,("cli_oem_change_password: Failed to send password change for user %s\n",
user ));
diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c
index 33fc265f79..6340a9bdcd 100644
--- a/source3/libsmb/clispnego.c
+++ b/source3/libsmb/clispnego.c
@@ -26,7 +26,7 @@
generate a negTokenInit packet given a GUID, a list of supported
OIDs (the mechanisms) and a principal name string
*/
-DATA_BLOB spnego_gen_negTokenInit(uint8 guid[16],
+DATA_BLOB spnego_gen_negTokenInit(char guid[16],
const char *OIDs[],
const char *principal)
{
diff --git a/source3/libsmb/credentials.c b/source3/libsmb/credentials.c
index 3f2dcd850b..edb242df7e 100644
--- a/source3/libsmb/credentials.c
+++ b/source3/libsmb/credentials.c
@@ -115,7 +115,7 @@ void creds_server_init(struct dcinfo *dc,
{
DEBUG(10,("creds_server_init: client chal : %s\n", credstr(clnt_chal->data) ));
DEBUG(10,("creds_server_init: server chal : %s\n", credstr(srv_chal->data) ));
- dump_data_pw("creds_server_init: machine pass", mach_pw, 16);
+ dump_data_pw("creds_server_init: machine pass", (const unsigned char *)mach_pw, 16);
/* Just in case this isn't already there */
memcpy(dc->mach_pw, mach_pw, 16);
@@ -205,14 +205,14 @@ BOOL creds_server_step(struct dcinfo *dc, const DOM_CRED *received_cred, DOM_CRE
void creds_client_init(struct dcinfo *dc,
DOM_CHAL *clnt_chal,
DOM_CHAL *srv_chal,
- const char mach_pw[16],
+ const unsigned char mach_pw[16],
DOM_CHAL *init_chal_out)
{
dc->sequence = time(NULL);
DEBUG(10,("creds_client_init: client chal : %s\n", credstr(clnt_chal->data) ));
DEBUG(10,("creds_client_init: server chal : %s\n", credstr(srv_chal->data) ));
- dump_data_pw("creds_client_init: machine pass", mach_pw, 16);
+ dump_data_pw("creds_client_init: machine pass", (const unsigned char *)mach_pw, 16);
/* Just in case this isn't already there */
memcpy(dc->mach_pw, mach_pw, 16);
diff --git a/source3/libsmb/ntlm_check.c b/source3/libsmb/ntlm_check.c
index 26e4c76fd3..212bc19767 100644
--- a/source3/libsmb/ntlm_check.c
+++ b/source3/libsmb/ntlm_check.c
@@ -65,13 +65,13 @@ static BOOL smb_pwd_check_ntlmv1(const DATA_BLOB *nt_response,
#ifdef DEBUG_PASSWORD
DEBUG(100,("Part password (P16) was |\n"));
- dump_data(100, part_passwd, 16);
+ dump_data(100, (const char *)part_passwd, 16);
DEBUGADD(100,("Password from client was |\n"));
- dump_data(100, nt_response->data, nt_response->length);
+ dump_data(100, (const char *)nt_response->data, nt_response->length);
DEBUGADD(100,("Given challenge was |\n"));
- dump_data(100, sec_blob->data, sec_blob->length);
+ dump_data(100, (const char *)sec_blob->data, sec_blob->length);
DEBUGADD(100,("Value from encryption was |\n"));
- dump_data(100, p24, 24);
+ dump_data(100, (const char *)p24, 24);
#endif
return (memcmp(p24, nt_response->data, 24) == 0);
}
@@ -136,15 +136,15 @@ static BOOL smb_pwd_check_ntlmv2(const DATA_BLOB *ntv2_response,
#if DEBUG_PASSWORD
DEBUG(100,("Part password (P16) was |\n"));
- dump_data(100, part_passwd, 16);
+ dump_data(100, (const char *)part_passwd, 16);
DEBUGADD(100,("Password from client was |\n"));
- dump_data(100, ntv2_response->data, ntv2_response->length);
+ dump_data(100, (const char *)ntv2_response->data, ntv2_response->length);
DEBUGADD(100,("Variable data from client was |\n"));
- dump_data(100, client_key_data.data, client_key_data.length);
+ dump_data(100, (const char *)client_key_data.data, client_key_data.length);
DEBUGADD(100,("Given challenge was |\n"));
- dump_data(100, sec_blob->data, sec_blob->length);
+ dump_data(100, (const char *)sec_blob->data, sec_blob->length);
DEBUGADD(100,("Value from encryption was |\n"));
- dump_data(100, value_from_encryption, 16);
+ dump_data(100, (const char *)value_from_encryption, 16);
#endif
data_blob_clear_free(&client_key_data);
res = (memcmp(value_from_encryption, client_response, 16) == 0);
diff --git a/source3/libsmb/ntlmssp_sign.c b/source3/libsmb/ntlmssp_sign.c
index 51023ca356..e41cd6437c 100644
--- a/source3/libsmb/ntlmssp_sign.c
+++ b/source3/libsmb/ntlmssp_sign.c
@@ -43,7 +43,7 @@ static void calc_ntlmv2_key(unsigned char subkey[16],
struct MD5Context ctx3;
MD5Init(&ctx3);
MD5Update(&ctx3, session_key.data, session_key.length);
- MD5Update(&ctx3, constant, strlen(constant)+1);
+ MD5Update(&ctx3, (const unsigned char *)constant, strlen(constant)+1);
MD5Final(subkey, &ctx3);
}
@@ -196,10 +196,10 @@ NTSTATUS ntlmssp_check_packet(NTLMSSP_STATE *ntlmssp_state,
if (local_sig.length != sig->length ||
memcmp(local_sig.data, sig->data, sig->length) != 0) {
DEBUG(5, ("BAD SIG NTLM2: wanted signature of\n"));
- dump_data(5, local_sig.data, local_sig.length);
+ dump_data(5, (const char *)local_sig.data, local_sig.length);
DEBUG(5, ("BAD SIG: got signature of\n"));
- dump_data(5, sig->data, sig->length);
+ dump_data(5, (const char *)sig->data, sig->length);
DEBUG(0, ("NTLMSSP NTLM2 packet check failed due to invalid signature!\n"));
data_blob_free(&local_sig);
@@ -209,10 +209,10 @@ NTSTATUS ntlmssp_check_packet(NTLMSSP_STATE *ntlmssp_state,
if (local_sig.length != sig->length ||
memcmp(local_sig.data + 8, sig->data + 8, sig->length - 8) != 0) {
DEBUG(5, ("BAD SIG NTLM1: wanted signature of\n"));
- dump_data(5, local_sig.data, local_sig.length);
+ dump_data(5, (const char *)local_sig.data, local_sig.length);
DEBUG(5, ("BAD SIG: got signature of\n"));
- dump_data(5, sig->data, sig->length);
+ dump_data(5, (const char *)sig->data, sig->length);
DEBUG(0, ("NTLMSSP NTLM1 packet check failed due to invalid signature!\n"));
data_blob_free(&local_sig);
diff --git a/source3/libsmb/smbdes.c b/source3/libsmb/smbdes.c
index dc49396d9e..4378385f3f 100644
--- a/source3/libsmb/smbdes.c
+++ b/source3/libsmb/smbdes.c
@@ -348,7 +348,7 @@ void cred_hash2(unsigned char *out, const unsigned char *in, const unsigned char
des_crypt56(out, buf, key2, 1);
}
-void cred_hash3(unsigned char *out, unsigned char *in, const unsigned char *key, int forw)
+void cred_hash3(unsigned char *out, const unsigned char *in, const unsigned char *key, int forw)
{
static unsigned char key2[8];
diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c
index 0c9eacfe4c..f99e48a0b9 100644
--- a/source3/libsmb/smbencrypt.c
+++ b/source3/libsmb/smbencrypt.c
@@ -44,9 +44,9 @@ BOOL SMBencrypt(const char *passwd, const uchar *c8, uchar p24[24])
#ifdef DEBUG_PASSWORD
DEBUG(100,("SMBencrypt: lm#, challenge, response\n"));
- dump_data(100, (char *)p21, 16);
+ dump_data(100, (const char *)p21, 16);
dump_data(100, (const char *)c8, 8);
- dump_data(100, (char *)p24, 24);
+ dump_data(100, (const char *)p24, 24);
#endif
return ret;
@@ -198,8 +198,8 @@ BOOL ntv2_owf_gen(const uchar owf[16],
DEBUG(100, ("ntv2_owf_gen: user, domain, owfkey, kr\n"));
dump_data(100, (const char *)user, user_byte_len);
dump_data(100, (const char *)domain, domain_byte_len);
- dump_data(100, owf, 16);
- dump_data(100, kr_buf, 16);
+ dump_data(100, (const char *)owf, 16);
+ dump_data(100, (const char *)kr_buf, 16);
#endif
SAFE_FREE(user);
@@ -271,9 +271,9 @@ void SMBOWFencrypt_ntv2(const uchar kr[16],
#ifdef DEBUG_PASSWORD
DEBUG(100, ("SMBOWFencrypt_ntv2: srv_chal, cli_chal, resp_buf\n"));
- dump_data(100, srv_chal->data, srv_chal->length);
- dump_data(100, cli_chal->data, cli_chal->length);
- dump_data(100, resp_buf, 16);
+ dump_data(100, (const char *)srv_chal->data, srv_chal->length);
+ dump_data(100, (const char *)cli_chal->data, cli_chal->length);
+ dump_data(100, (const char *)resp_buf, 16);
#endif
}
@@ -290,7 +290,7 @@ void SMBsesskeygen_ntv2(const uchar kr[16],
#ifdef DEBUG_PASSWORD
DEBUG(100, ("SMBsesskeygen_ntv2:\n"));
- dump_data(100, sess_key, 16);
+ dump_data(100, (const char *)sess_key, 16);
#endif
}
@@ -304,7 +304,7 @@ void SMBsesskeygen_ntv1(const uchar kr[16],
#ifdef DEBUG_PASSWORD
DEBUG(100, ("SMBsesskeygen_ntv1:\n"));
- dump_data(100, sess_key, 16);
+ dump_data(100, (const char *)sess_key, 16);
#endif
}
@@ -324,7 +324,7 @@ void SMBsesskeygen_lm_sess_key(const uchar lm_hash[16],
#ifdef DEBUG_PASSWORD
DEBUG(100, ("SMBsesskeygen_lmv1_jerry:\n"));
- dump_data(100, sess_key, 16);
+ dump_data(100, (const char *)sess_key, 16);
#endif
}
@@ -506,7 +506,7 @@ BOOL decode_pw_buffer(uint8 in_buffer[516], char *new_pwrd,
byte_len = IVAL(in_buffer, 512);
#ifdef DEBUG_PASSWORD
- dump_data(100, in_buffer, 516);
+ dump_data(100, (const char *)in_buffer, 516);
#endif
/* Password cannot be longer than the size of the password buffer */
@@ -522,7 +522,7 @@ BOOL decode_pw_buffer(uint8 in_buffer[516], char *new_pwrd,
#ifdef DEBUG_PASSWORD
DEBUG(100,("decode_pw_buffer: new_pwrd: "));
- dump_data(100, (char *)new_pwrd, *new_pw_len);
+ dump_data(100, (const char *)new_pwrd, *new_pw_len);
DEBUG(100,("multibyte len:%d\n", *new_pw_len));
DEBUG(100,("original char len:%d\n", byte_len/2));
#endif
diff --git a/source3/libsmb/spnego.c b/source3/libsmb/spnego.c
index 2cf3480fce..6cc4436a0c 100644
--- a/source3/libsmb/spnego.c
+++ b/source3/libsmb/spnego.c
@@ -45,9 +45,11 @@ static BOOL read_negTokenInit(ASN1_DATA *asn1, negTokenInit_t *token)
token->mechTypes = SMB_MALLOC_P(const char *);
for (i = 0; !asn1->has_error &&
0 < asn1_tag_remaining(asn1); i++) {
+ char *p_oid = NULL;
token->mechTypes =
SMB_REALLOC_ARRAY(token->mechTypes, const char *, i + 2);
- asn1_read_OID(asn1, &token->mechTypes[i]);
+ asn1_read_OID(asn1, &p_oid);
+ token->mechTypes[i] = p_oid;
}
token->mechTypes[i] = NULL;
@@ -317,7 +319,7 @@ BOOL free_spnego_data(SPNEGO_DATA *spnego)
if (spnego->negTokenInit.mechTypes) {
int i;
for (i = 0; spnego->negTokenInit.mechTypes[i]; i++) {
- free(spnego->negTokenInit.mechTypes[i]);
+ free(CONST_DISCARD(char *,spnego->negTokenInit.mechTypes[i]));
}
free(spnego->negTokenInit.mechTypes);
}
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index 50fa613e72..87d20107fa 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -31,8 +31,8 @@
**********************************************************/
static NTSTATUS just_change_the_password(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- unsigned char orig_trust_passwd_hash[16],
- unsigned char new_trust_passwd_hash[16],
+ const unsigned char orig_trust_passwd_hash[16],
+ const unsigned char new_trust_passwd_hash[16],
uint32 sec_channel_type)
{
NTSTATUS result;