diff options
46 files changed, 185 insertions, 185 deletions
diff --git a/source4/auth/auth_domain.c b/source4/auth/auth_domain.c index 3064da72de..f59c82c553 100644 --- a/source4/auth/auth_domain.c +++ b/source4/auth/auth_domain.c @@ -124,7 +124,7 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, const char *server, const char *setup_creds_as, uint16_t sec_chan, - const unsigned char *trust_passwd, + const uint8_t *trust_passwd, BOOL *retry) { struct in_addr dest_ip; @@ -235,7 +235,7 @@ static NTSTATUS attempt_connect_to_dc(struct cli_state **cli, struct in_addr *ip, const char *setup_creds_as, uint16_t sec_chan, - const unsigned char *trust_passwd) + const uint8_t *trust_passwd) { NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; BOOL retry = True; @@ -266,7 +266,7 @@ static NTSTATUS find_connect_dc(struct cli_state **cli, const char *domain, const char *setup_creds_as, uint16_t sec_chan, - unsigned char *trust_passwd, + uint8_t *trust_passwd, time_t last_change_time) { struct in_addr dc_ip; @@ -294,7 +294,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx, auth_serversupplied_info **server_info, const char *server, const char *setup_creds_as, uint16_t sec_chan, - unsigned char trust_passwd[16], + uint8_t trust_passwd[16], time_t last_change_time) { fstring remote_machine; @@ -399,7 +399,7 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context, { NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE; char *password_server; - unsigned char trust_passwd[16]; + uint8_t trust_passwd[16]; time_t last_change_time; const char *domain = lp_workgroup(); @@ -477,7 +477,7 @@ static NTSTATUS check_trustdomain_security(const struct auth_context *auth_conte auth_serversupplied_info **server_info) { NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE; - unsigned char trust_md4_password[16]; + uint8_t trust_md4_password[16]; char *trust_password; time_t last_change_time; DOM_SID sid; diff --git a/source4/auth/auth_server.c b/source4/auth/auth_server.c index 620d9a33c8..076fa8e70e 100644 --- a/source4/auth/auth_server.c +++ b/source4/auth/auth_server.c @@ -218,7 +218,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context auth_serversupplied_info **server_info) { struct cli_state *cli; - static unsigned char badpass[24]; + static uint8_t badpass[24]; static fstring baduser; static BOOL tested_password_server = False; static BOOL bad_password_server = False; diff --git a/source4/auth/auth_util.c b/source4/auth/auth_util.c index 8a10a33b0c..b04b93d63f 100644 --- a/source4/auth/auth_util.c +++ b/source4/auth/auth_util.c @@ -200,9 +200,9 @@ BOOL make_user_info_netlogon_interactive(auth_usersupplied_info **user_info, { char lm_pwd[16]; char nt_pwd[16]; - unsigned char local_lm_response[24]; - unsigned char local_nt_response[24]; - unsigned char key[16]; + uint8_t local_lm_response[24]; + uint8_t local_nt_response[24]; + uint8_t key[16]; ZERO_STRUCT(key); memcpy(key, dc_sess_key, 8); @@ -236,10 +236,10 @@ BOOL make_user_info_netlogon_interactive(auth_usersupplied_info **user_info, #endif if (lm_interactive_pwd) - SMBOWFencrypt((const unsigned char *)lm_pwd, chal, local_lm_response); + SMBOWFencrypt((const uint8_t *)lm_pwd, chal, local_lm_response); if (nt_interactive_pwd) - SMBOWFencrypt((const unsigned char *)nt_pwd, chal, local_nt_response); + SMBOWFencrypt((const uint8_t *)nt_pwd, chal, local_nt_response); /* Password info paranoia */ ZERO_STRUCT(key); @@ -307,7 +307,7 @@ BOOL make_user_info_for_reply(auth_usersupplied_info **user_info, DEBUG(5,("make_user_info_for_reply: User passwords not in encrypted format.\n")); if (plaintext_password.data) { - unsigned char local_lm_response[24]; + uint8_t local_lm_response[24]; #ifdef DEBUG_PASSWORD DEBUG(10,("Unencrypted password (len %d):\n",plaintext_password.length)); diff --git a/source4/auth/pass_check.c b/source4/auth/pass_check.c index 88b82e3474..c468db5558 100644 --- a/source4/auth/pass_check.c +++ b/source4/auth/pass_check.c @@ -100,7 +100,7 @@ static BOOL dfs_auth(char *user, char *password) struct passwd *pw; sec_passwd_rec_t passwd_rec; sec_login_auth_src_t auth_src = sec_login_auth_src_network; - unsigned char dce_errstr[dce_c_error_string_len]; + uint8_t dce_errstr[dce_c_error_string_len]; gid_t egid; if (dcelogin_atmost_once) @@ -174,7 +174,7 @@ static BOOL dfs_auth(char *user, char *password) } sec_key_mgmt_get_key(rpc_c_authn_dce_secret, NULL, - (unsigned char *)pw->pw_name, + (uint8_t *)pw->pw_name, sec_c_key_version_none, (void **)&key, &err); if (err != error_status_ok) @@ -205,7 +205,7 @@ static BOOL dfs_auth(char *user, char *password) } } - if (sec_login_setup_identity((unsigned char *)user, + if (sec_login_setup_identity((uint8_t *)user, sec_login_no_flags, &my_dce_sec_context, &err) == 0) { @@ -248,7 +248,7 @@ static BOOL dfs_auth(char *user, char *password) set_effective_gid(pw->pw_gid); set_effective_uid(pw->pw_uid); - if (sec_login_setup_identity((unsigned char *)user, + if (sec_login_setup_identity((uint8_t *)user, sec_login_no_flags, &my_dce_sec_context, &err) == 0) { @@ -359,7 +359,7 @@ void dfs_unlogin(void) { error_status_t err; int err2; - unsigned char dce_errstr[dce_c_error_string_len]; + uint8_t dce_errstr[dce_c_error_string_len]; sec_login_purge_context(&my_dce_sec_context, &err); if (err != error_status_ok) diff --git a/source4/client/clitar.c b/source4/client/clitar.c index dce914e9a6..69c25ba262 100644 --- a/source4/client/clitar.c +++ b/source4/client/clitar.c @@ -121,7 +121,7 @@ static int blocksize=20; static int tarhandle; static void writetarheader(int f, const char *aname, uint64_t size, time_t mtime, - const char *amode, unsigned char ftype); + const char *amode, uint8_t ftype); static void do_atar(char *rname,char *lname,file_info *finfo1); static void do_tar(file_info *finfo); static void oct_it(uint64_t value, int ndgs, char *p); @@ -164,7 +164,7 @@ static char *string_create_s(int size) Write a tar header to buffer ****************************************************************************/ static void writetarheader(int f, const char *aname, uint64_t size, time_t mtime, - const char *amode, unsigned char ftype) + const char *amode, uint8_t ftype) { union hblock hb; int i, chk, l; diff --git a/source4/include/MacExtensions.h b/source4/include/MacExtensions.h index 92376b2cf0..150d207f88 100644 --- a/source4/include/MacExtensions.h +++ b/source4/include/MacExtensions.h @@ -57,9 +57,9 @@ typedef struct _AfpInfo uint32_t afpi_Version; /* Must be 0x00010000 */ uint32_t afpi_Reserved1; uint32_t afpi_BackupTime; /* Backup time for the file/dir */ - unsigned char afpi_FinderInfo[AFP_FinderSize]; /* Finder Info (32 bytes) */ - unsigned char afpi_ProDosInfo[6]; /* ProDos Info (6 bytes) # */ - unsigned char afpi_Reserved2[6]; + uint8_t afpi_FinderInfo[AFP_FinderSize]; /* Finder Info (32 bytes) */ + uint8_t afpi_ProDosInfo[6]; /* ProDos Info (6 bytes) # */ + uint8_t afpi_Reserved2[6]; } AfpInfo; typedef struct _SambaAfpInfo diff --git a/source4/include/byteorder.h b/source4/include/byteorder.h index e237b5d762..b3caa310a4 100644 --- a/source4/include/byteorder.h +++ b/source4/include/byteorder.h @@ -54,7 +54,7 @@ that don't have any int types that are 2 bytes long) You do this: -#define CVAL(buf,pos) (((unsigned char *)(buf))[pos]) +#define CVAL(buf,pos) (((uint8_t *)(buf))[pos]) #define PVAL(buf,pos) ((unsigned)CVAL(buf,pos)) #define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8) @@ -105,8 +105,8 @@ it also defines lots of intermediate macros, just ignore those :-) #define CAREFUL_ALIGNMENT 1 #endif -#define CVAL(buf,pos) ((unsigned)(((const unsigned char *)(buf))[pos])) -#define CVAL_NC(buf,pos) (((unsigned char *)(buf))[pos]) /* Non-const version of CVAL */ +#define CVAL(buf,pos) ((unsigned)(((const uint8_t *)(buf))[pos])) +#define CVAL_NC(buf,pos) (((uint8_t *)(buf))[pos]) /* Non-const version of CVAL */ #define PVAL(buf,pos) (CVAL(buf,pos)) #define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val)) @@ -115,7 +115,7 @@ it also defines lots of intermediate macros, just ignore those :-) #define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8) #define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16) -#define SSVALX(buf,pos,val) (CVAL_NC(buf,pos)=(unsigned char)((val)&0xFF),CVAL_NC(buf,pos+1)=(unsigned char)((val)>>8)) +#define SSVALX(buf,pos,val) (CVAL_NC(buf,pos)=(uint8_t)((val)&0xFF),CVAL_NC(buf,pos+1)=(uint8_t)((val)>>8)) #define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16)) #define SVALS(buf,pos) ((int16_t)SVAL(buf,pos)) #define IVALS(buf,pos) ((int32_t)IVAL(buf,pos)) diff --git a/source4/include/md5.h b/source4/include/md5.h index 6f8b7d0c15..57c2f99caa 100644 --- a/source4/include/md5.h +++ b/source4/include/md5.h @@ -8,13 +8,13 @@ struct MD5Context { uint32_t buf[4]; uint32_t bits[2]; - unsigned char in[64]; + uint8_t in[64]; }; void MD5Init(struct MD5Context *context); -void MD5Update(struct MD5Context *context, unsigned char const *buf, +void MD5Update(struct MD5Context *context, uint8_t const *buf, unsigned len); -void MD5Final(unsigned char digest[16], struct MD5Context *context); +void MD5Final(uint8_t digest[16], struct MD5Context *context); /* * This is needed to make RSAREF happy on some MS-DOS compilers. diff --git a/source4/include/registry.h b/source4/include/registry.h index 210bcd1ba3..478c7919ed 100644 --- a/source4/include/registry.h +++ b/source4/include/registry.h @@ -51,7 +51,7 @@ typedef struct reg_ops_s REG_OPS; #if 0 //FIXME typedef struct ace_struct_s { - unsigned char type, flags; + uint8_t type, flags; unsigned int perms; /* Perhaps a better def is in order */ DOM_SID *trustee; } ACE; diff --git a/source4/include/smb.h b/source4/include/smb.h index c6866c52b4..178fab1db1 100644 --- a/source4/include/smb.h +++ b/source4/include/smb.h @@ -862,8 +862,8 @@ struct nmb_name { /* A netbios node status array element. */ struct node_status { char name[16]; - unsigned char type; - unsigned char flags; + uint8_t type; + uint8_t flags; }; #include "rpc_secdes.h" diff --git a/source4/lib/crypto/md4.c b/source4/lib/crypto/md4.c index cc8b9b6841..98fcabf224 100644 --- a/source4/lib/crypto/md4.c +++ b/source4/lib/crypto/md4.c @@ -107,7 +107,7 @@ static void mdfour64(struct mdfour_state *s, uint32_t *M) X[j] = 0; } -static void copy64(uint32_t *M, const unsigned char *in) +static void copy64(uint32_t *M, const uint8_t *in) { int i; @@ -116,7 +116,7 @@ static void copy64(uint32_t *M, const unsigned char *in) (in[i*4+1]<<8) | (in[i*4+0]<<0); } -static void copy4(unsigned char *out, uint32_t x) +static void copy4(uint8_t *out, uint32_t x) { out[0] = x&0xFF; out[1] = (x>>8)&0xFF; @@ -125,9 +125,9 @@ static void copy4(unsigned char *out, uint32_t x) } /* produce a md4 message digest from data of length n bytes */ -void mdfour(unsigned char *out, const unsigned char *in, int n) +void mdfour(uint8_t *out, const uint8_t *in, int n) { - unsigned char buf[128]; + uint8_t buf[128]; uint32_t M[16]; uint32_t b = n * 8; int i; diff --git a/source4/lib/crypto/md5.c b/source4/lib/crypto/md5.c index dbb3462bd4..a393fc2532 100644 --- a/source4/lib/crypto/md5.c +++ b/source4/lib/crypto/md5.c @@ -27,7 +27,7 @@ static void MD5Transform(uint32_t buf[4], uint32_t const in[16]); /* * Note: this code is harmless on little-endian machines. */ -static void byteReverse(unsigned char *buf, unsigned longs) +static void byteReverse(uint8_t *buf, unsigned longs) { uint32_t t; do { @@ -57,7 +57,7 @@ void MD5Init(struct MD5Context *ctx) * Update context to reflect the concatenation of another buffer full * of bytes. */ -void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) +void MD5Update(struct MD5Context *ctx, uint8_t const *buf, unsigned len) { register uint32_t t; @@ -73,7 +73,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) /* Handle any leading odd-sized chunks */ if (t) { - unsigned char *p = (unsigned char *) ctx->in + t; + uint8_t *p = (uint8_t *) ctx->in + t; t = 64 - t; if (len < t) { @@ -105,10 +105,10 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ -void MD5Final(unsigned char digest[16], struct MD5Context *ctx) +void MD5Final(uint8_t digest[16], struct MD5Context *ctx) { unsigned int count; - unsigned char *p; + uint8_t *p; /* Compute number of bytes mod 64 */ count = (ctx->bits[0] >> 3) & 0x3F; @@ -141,7 +141,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx) ((uint32_t *) ctx->in)[15] = ctx->bits[1]; MD5Transform(ctx->buf, (uint32_t *) ctx->in); - byteReverse((unsigned char *) ctx->buf, 4); + byteReverse((uint8_t *) ctx->buf, 4); memmove(digest, ctx->buf, 16); memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ } diff --git a/source4/lib/genrand.c b/source4/lib/genrand.c index a5002969bd..b37078b284 100644 --- a/source4/lib/genrand.c +++ b/source4/lib/genrand.c @@ -22,21 +22,21 @@ #include "includes.h" -static unsigned char hash[258]; +static uint8_t hash[258]; static uint32_t counter; -static unsigned char *reseed_data; +static uint8_t *reseed_data; static size_t reseed_data_size; /**************************************************************** Copy any user given reseed data. *****************************************************************/ -void set_rand_reseed_data(unsigned char *data, size_t len) +void set_rand_reseed_data(uint8_t *data, size_t len) { SAFE_FREE(reseed_data); reseed_data_size = 0; - reseed_data = (unsigned char *)memdup(data, len); + reseed_data = (uint8_t *)memdup(data, len); if (reseed_data) reseed_data_size = len; } @@ -45,16 +45,16 @@ void set_rand_reseed_data(unsigned char *data, size_t len) Setup the seed. *****************************************************************/ -static void seed_random_stream(unsigned char *seedval, size_t seedlen) +static void seed_random_stream(uint8_t *seedval, size_t seedlen) { - unsigned char j = 0; + uint8_t j = 0; size_t ind; for (ind = 0; ind < 256; ind++) - hash[ind] = (unsigned char)ind; + hash[ind] = (uint8_t)ind; for( ind = 0; ind < 256; ind++) { - unsigned char tc; + uint8_t tc; j += (hash[ind] + seedval[ind%seedlen]); @@ -71,15 +71,15 @@ static void seed_random_stream(unsigned char *seedval, size_t seedlen) Get datasize bytes worth of random data. *****************************************************************/ -static void get_random_stream(unsigned char *data, size_t datasize) +static void get_random_stream(uint8_t *data, size_t datasize) { - unsigned char index_i = hash[256]; - unsigned char index_j = hash[257]; + uint8_t index_i = hash[256]; + uint8_t index_j = hash[257]; size_t ind; for( ind = 0; ind < datasize; ind++) { - unsigned char tc; - unsigned char t; + uint8_t tc; + uint8_t t; index_i++; index_j += hash[index_i]; @@ -101,10 +101,10 @@ static void get_random_stream(unsigned char *data, size_t datasize) Note that the hash is not initialised. *****************************************************************/ -static void do_filehash(const char *fname, unsigned char *the_hash) +static void do_filehash(const char *fname, uint8_t *the_hash) { - unsigned char buf[1011]; /* deliberate weird size */ - unsigned char tmp_md4[16]; + uint8_t buf[1011]; /* deliberate weird size */ + uint8_t tmp_md4[16]; int fd, n; fd = sys_open(fname,O_RDONLY,0); @@ -133,7 +133,7 @@ static void do_filehash(const char *fname, unsigned char *the_hash) static int do_reseed(BOOL use_fd, int fd) { - unsigned char seed_inbuf[40]; + uint8_t seed_inbuf[40]; uint32_t v1, v2; struct timeval tval; pid_t mypid; if (use_fd) { @@ -181,13 +181,13 @@ static int do_reseed(BOOL use_fd, int fd) Interface to the (hopefully) good crypto random number generator. ********************************************************************/ -void generate_random_buffer( unsigned char *out, int len, BOOL do_reseed_now) +void generate_random_buffer( uint8_t *out, int len, BOOL do_reseed_now) { static BOOL done_reseed = False; static int urand_fd = -1; - unsigned char md4_buf[64]; - unsigned char tmp_buf[16]; - unsigned char *p; + uint8_t md4_buf[64]; + uint8_t tmp_buf[16]; + uint8_t *p; if(!done_reseed || do_reseed_now) { urand_fd = do_reseed(True, urand_fd); diff --git a/source4/lib/iconv.c b/source4/lib/iconv.c index 3f37583e39..65fa45248f 100644 --- a/source4/lib/iconv.c +++ b/source4/lib/iconv.c @@ -458,8 +458,8 @@ static size_t utf8_pull(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { while (*inbytesleft >= 1 && *outbytesleft >= 2) { - const unsigned char *c = (const unsigned char *)*inbuf; - unsigned char *uc = (unsigned char *)*outbuf; + const uint8_t *c = (const uint8_t *)*inbuf; + uint8_t *uc = (uint8_t *)*outbuf; int len = 1; if ((c[0] & 0x80) == 0) { @@ -505,8 +505,8 @@ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { while (*inbytesleft >= 2 && *outbytesleft >= 1) { - unsigned char *c = (unsigned char *)*outbuf; - const unsigned char *uc = (const unsigned char *)*inbuf; + uint8_t *c = (uint8_t *)*outbuf; + const uint8_t *uc = (const uint8_t *)*inbuf; int len=1; if (uc[1] & 0xf8) { diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c index c120ee5f4e..b08c616a05 100644 --- a/source4/lib/ldb/common/ldb_ldif.c +++ b/source4/lib/ldb/common/ldb_ldif.c @@ -47,7 +47,7 @@ static int base64_decode(char *s) { const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int bit_offset, byte_offset, idx, i, n; - unsigned char *d = (unsigned char *)s; + uint8_t *d = (uint8_t *)s; char *p; n=i=0; @@ -90,7 +90,7 @@ char *ldb_base64_encode(struct ldb_context *ldb, const char *buf, int len) { const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int bit_offset, byte_offset, idx, i; - const unsigned char *d = (const unsigned char *)buf; + const uint8_t *d = (const uint8_t *)buf; int bytes = (len*8 + 5)/6; char *out; @@ -123,7 +123,7 @@ char *ldb_base64_encode(struct ldb_context *ldb, const char *buf, int len) int ldb_should_b64_encode(const struct ldb_val *val) { int i; - unsigned char *p = val->data; + uint8_t *p = val->data; if (val->length == 0 || p[0] == ' ' || p[0] == ':') { return 1; diff --git a/source4/lib/ldb/ldb_tdb/ldb_pack.c b/source4/lib/ldb/ldb_tdb/ldb_pack.c index e71679646e..fcbc9bd56d 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_pack.c +++ b/source4/lib/ldb/ldb_tdb/ldb_pack.c @@ -42,7 +42,7 @@ #define LTDB_PACKING_FORMAT_NODN 0x26011966 /* use a portable integer format */ -static void put_uint32(unsigned char *p, int ofs, unsigned int val) +static void put_uint32(uint8_t *p, int ofs, unsigned int val) { p += ofs; p[0] = val&0xFF; @@ -51,7 +51,7 @@ static void put_uint32(unsigned char *p, int ofs, unsigned int val) p[3] = (val>>24) & 0xFF; } -static unsigned int pull_uint32(unsigned char *p, int ofs) +static unsigned int pull_uint32(uint8_t *p, int ofs) { p += ofs; return p[0] | (p[1]<<8) | (p[2]<<16) | (p[3]<<24); diff --git a/source4/lib/registry/common/reg_util.c b/source4/lib/registry/common/reg_util.c index 01d75f1b90..db5e97bf7f 100644 --- a/source4/lib/registry/common/reg_util.c +++ b/source4/lib/registry/common/reg_util.c @@ -55,7 +55,7 @@ char *reg_val_data_string(REG_VAL *v) asciip = ret; for (i=0; i<reg_val_size(v); i++) { int str_rem = reg_val_size(v) * 3 - (asciip - ret); - asciip += snprintf(asciip, str_rem, "%02x", *(unsigned char *)(reg_val_data_blk(v)+i)); + asciip += snprintf(asciip, str_rem, "%02x", *(uint8_t *)(reg_val_data_blk(v)+i)); if (i < reg_val_size(v) && str_rem > 0) *asciip = ' '; asciip++; } diff --git a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c index 627b5a8f13..fa4b3e4d18 100644 --- a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c +++ b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c @@ -1268,10 +1268,10 @@ static void *nt_alloc_regf_space(REG_HANDLE *h, int size, unsigned int *off) /* * Store a SID at the location provided */ -static int nt_store_SID(REG_HANDLE *regf, DOM_SID *sid, unsigned char *locn) +static int nt_store_SID(REG_HANDLE *regf, DOM_SID *sid, uint8_t *locn) { int i; - unsigned char *p = locn; + uint8_t *p = locn; if (!regf || !sid || !locn) return 0; @@ -1290,11 +1290,11 @@ static int nt_store_SID(REG_HANDLE *regf, DOM_SID *sid, unsigned char *locn) } -static int nt_store_ace(REG_HANDLE *regf, SEC_ACE *ace, unsigned char *locn) +static int nt_store_ace(REG_HANDLE *regf, SEC_ACE *ace, uint8_t *locn) { int size = 0; SEC_ACE *reg_ace = (SEC_ACE *)locn; - unsigned char *p; + uint8_t *p; if (!regf || !ace || !locn) return 0; @@ -1303,7 +1303,7 @@ static int nt_store_ace(REG_HANDLE *regf, SEC_ACE *ace, unsigned char *locn) /* Deal with the length when we have stored the SID */ - p = (unsigned char *)®_ace->info.mask; + p = (uint8_t *)®_ace->info.mask; SIVAL(p, 0, ace->info.mask); p += 4; @@ -1311,7 +1311,7 @@ static int nt_store_ace(REG_HANDLE *regf, SEC_ACE *ace, unsigned char *locn) size += 8; /* Size of the fixed header */ - p = (unsigned char *)®_ace->size; + p = (uint8_t *)®_ace->size; SSVAL(p, 0, size); @@ -1321,9 +1321,9 @@ static int nt_store_ace(REG_HANDLE *regf, SEC_ACE *ace, unsigned char *locn) /* * Store an ACL at the location provided */ -static int nt_store_acl(REG_HANDLE *regf, SEC_ACL *acl, unsigned char *locn) { +static int nt_store_acl(REG_HANDLE *regf, SEC_ACL *acl, uint8_t *locn) { int size = 0, i; - unsigned char *p = locn, *s; + uint8_t *p = locn, *s; if (!regf || !acl || !locn) return 0; diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index 77c0f710c1..af869d1cfa 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -155,7 +155,7 @@ static struct cmd_line *get_cmd_line(int fd) { struct cmd_line *cl = (CMD_LINE *)smb_xmalloc(sizeof(CMD_LINE)); int i = 0, rc; - unsigned char ch; + uint8_t ch; cl->len = INIT_ALLOC; @@ -662,7 +662,7 @@ static CMD_FILE *cmd_file_create(const char *file) * Sec Desc print functions */ -char *str_type(unsigned char type); +char *str_type(uint8_t type); static int nt_apply_reg_command_file(REG_HANDLE *r, const char *cmd_file_name) { diff --git a/source4/lib/replace.c b/source4/lib/replace.c index 189c5bc04d..c186d307e6 100644 --- a/source4/lib/replace.c +++ b/source4/lib/replace.c @@ -328,7 +328,7 @@ duplicate a string #ifdef REPLACE_INET_NTOA char *rep_inet_ntoa(struct in_addr ip) { - unsigned char *p = (unsigned char *)&ip.s_addr; + uint8_t *p = (uint8_t *)&ip.s_addr; static char buf[18]; slprintf(buf, 17, "%d.%d.%d.%d", (int)p[0], (int)p[1], (int)p[2], (int)p[3]); diff --git a/source4/lib/snprintf.c b/source4/lib/snprintf.c index fd31870162..3b04228c42 100644 --- a/source4/lib/snprintf.c +++ b/source4/lib/snprintf.c @@ -219,7 +219,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args } break; case DP_S_MIN: - if (isdigit((unsigned char)ch)) { + if (isdigit((uint8_t)ch)) { min = 10*min + char_to_int (ch); ch = *format++; } else if (ch == '*') { @@ -239,7 +239,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args } break; case DP_S_MAX: - if (isdigit((unsigned char)ch)) { + if (isdigit((uint8_t)ch)) { if (max < 0) max = 0; max = 10*max + char_to_int (ch); diff --git a/source4/lib/tdb/common/tdb.c b/source4/lib/tdb/common/tdb.c index c8ac7babad..b7b9631444 100644 --- a/source4/lib/tdb/common/tdb.c +++ b/source4/lib/tdb/common/tdb.c @@ -1762,7 +1762,7 @@ TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags, TDB_CONTEXT *tdb; struct stat st; int rev = 0, locked = 0; - unsigned char *vp; + uint8_t *vp; u32 vertest; if (!(tdb = calloc(1, sizeof *tdb))) { @@ -1841,7 +1841,7 @@ TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags, } rev = (tdb->flags & TDB_CONVERT); } - vp = (unsigned char *)&tdb->header.version; + vp = (uint8_t *)&tdb->header.version; vertest = (((u32)vp[0]) << 24) | (((u32)vp[1]) << 16) | (((u32)vp[2]) << 8) | (u32)vp[3]; tdb->flags |= (vertest==TDB_VERSION) ? TDB_BIGENDIAN : 0; diff --git a/source4/lib/tdb/tools/tdbdump.c b/source4/lib/tdb/tools/tdbdump.c index 9c1dc2761b..1a7128c473 100644 --- a/source4/lib/tdb/tools/tdbdump.c +++ b/source4/lib/tdb/tools/tdbdump.c @@ -35,7 +35,7 @@ static void print_data(TDB_DATA d) { - unsigned char *p = d.dptr; + uint8_t *p = d.dptr; int len = d.dsize; while (len--) { if (isprint(*p) && !strchr("\"\\", *p)) { diff --git a/source4/lib/tdb/tools/tdbtool.c b/source4/lib/tdb/tools/tdbtool.c index 92009dcef4..65bbedf709 100644 --- a/source4/lib/tdb/tools/tdbtool.c +++ b/source4/lib/tdb/tools/tdbtool.c @@ -63,7 +63,7 @@ static TDB_CONTEXT *tdb; static int print_rec(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state); -static void print_asc(unsigned char *buf,int len) +static void print_asc(uint8_t *buf,int len) { int i; @@ -77,7 +77,7 @@ static void print_asc(unsigned char *buf,int len) printf("%c",isprint(buf[i])?buf[i]:'.'); } -static void print_data(unsigned char *buf,int len) +static void print_data(uint8_t *buf,int len) { int i=0; if (len<=0) return; diff --git a/source4/lib/util.c b/source4/lib/util.c index a4be8f8bf8..dd53d2b174 100644 --- a/source4/lib/util.c +++ b/source4/lib/util.c @@ -677,7 +677,7 @@ void set_remote_arch(struct server_context *smb, enum remote_arch_types type) } -void print_asc(int level, const unsigned char *buf,int len) +void print_asc(int level, const uint8_t *buf,int len) { int i; for (i=0;i<len;i++) @@ -686,7 +686,7 @@ void print_asc(int level, const unsigned char *buf,int len) void dump_data(int level, const char *buf1,int len) { - const unsigned char *buf = (const unsigned char *)buf1; + const uint8_t *buf = (const uint8_t *)buf1; int i=0; if (len<=0) return; diff --git a/source4/lib/util_file.c b/source4/lib/util_file.c index 0eb8046227..a5832adec5 100644 --- a/source4/lib/util_file.c +++ b/source4/lib/util_file.c @@ -119,8 +119,8 @@ int getfileline(void *vp, char *linebuf, int linebuf_size) { /* Static buffers we will return. */ FILE *fp = (FILE *)vp; - unsigned char c; - unsigned char *p; + uint8_t c; + uint8_t *p; size_t linebuf_len; if (fp == NULL) @@ -186,7 +186,7 @@ int getfileline(void *vp, char *linebuf, int linebuf_size) continue; } - p = (unsigned char *) strchr_m(linebuf, ':'); + p = (uint8_t *) strchr_m(linebuf, ':'); if (p == NULL) { DEBUG(0, ("getfileline: malformed line entry (no :)\n")); diff --git a/source4/lib/util_sock.c b/source4/lib/util_sock.c index 999aeae744..43da8a2f57 100644 --- a/source4/lib/util_sock.c +++ b/source4/lib/util_sock.c @@ -238,7 +238,7 @@ send a keepalive packet (rfc1002) ****************************************************************************/ BOOL send_nbt_keepalive(int sock_fd) { - unsigned char buf[4]; + uint8_t buf[4]; buf[0] = SMBkeepalive; buf[1] = buf[2] = buf[3] = 0; diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c index 4002c21e9a..0113b1ae48 100644 --- a/source4/lib/util_str.c +++ b/source4/lib/util_str.c @@ -735,8 +735,8 @@ void strlower_m(char *s) supported multi-byte character sets are ascii-compatible (ie. they match for the first 128 chars) */ - while (*s && !(((unsigned char)s[0]) & 0x7F)) { - *s = tolower((unsigned char)*s); + while (*s && !(((uint8_t)s[0]) & 0x7F)) { + *s = tolower((uint8_t)*s); s++; } @@ -759,8 +759,8 @@ void strupper_m(char *s) supported multi-byte character sets are ascii-compatible (ie. they match for the first 128 chars) */ - while (*s && !(((unsigned char)s[0]) & 0x7F)) { - *s = toupper((unsigned char)*s); + while (*s && !(((uint8_t)s[0]) & 0x7F)) { + *s = toupper((uint8_t)*s); s++; } @@ -784,7 +784,7 @@ size_t strlen_m(const char *s) return 0; } - while (*s && !(((unsigned char)s[0]) & 0x7F)) { + while (*s && !(((uint8_t)s[0]) & 0x7F)) { s++; count++; } @@ -841,8 +841,8 @@ char *binary_string(char *buf, int len) return NULL; for (j=i=0;i<len;i++) { s[j] = '\\'; - s[j+1] = hex[((unsigned char)buf[i]) >> 4]; - s[j+2] = hex[((unsigned char)buf[i]) & 0xF]; + s[j+1] = hex[((uint8_t)buf[i]) >> 4]; + s[j+2] = hex[((uint8_t)buf[i]) & 0xF]; j += 3; } s[j] = 0; @@ -1210,7 +1210,7 @@ size_t strhex_to_str(char *p, size_t len, const char *strhex) { size_t i; size_t num_chars = 0; - unsigned char lonybble, hinybble; + uint8_t lonybble, hinybble; const char *hexchars = "0123456789ABCDEF"; char *p1 = NULL, *p2 = NULL; @@ -1302,7 +1302,7 @@ DATA_BLOB base64_decode_data_blob(const char *s) { int bit_offset, byte_offset, idx, i, n; DATA_BLOB decoded = data_blob(s, strlen(s)+1); - unsigned char *d = decoded.data; + uint8_t *d = decoded.data; char *p; n=i=0; @@ -1357,7 +1357,7 @@ char * base64_encode_data_blob(DATA_BLOB data) char *result = malloc(output_len); /* get us plenty of space */ while (len-- && out_cnt < (data.length * 2) - 5) { - int c = (unsigned char) *(data.data++); + int c = (uint8_t) *(data.data++); bits += c; char_count++; if (char_count == 3) { diff --git a/source4/lib/xfile.c b/source4/lib/xfile.c index 1534dd855e..de4cf4b12a 100644 --- a/source4/lib/xfile.c +++ b/source4/lib/xfile.c @@ -306,7 +306,7 @@ int x_fgetc(XFILE *f) return EOF; } - ret = *(unsigned char *)(f->next); + ret = *(uint8_t *)(f->next); f->next++; f->bufused--; return ret; diff --git a/source4/libads/ldap.c b/source4/libads/ldap.c index b2afe8db26..6a2dcbaa87 100644 --- a/source4/libads/ldap.c +++ b/source4/libads/ldap.c @@ -1100,7 +1100,7 @@ static void dump_binary(const char *field, struct berval **values) for (i=0; values[i]; i++) { printf("%s: ", field); for (j=0; j<values[i]->bv_len; j++) { - printf("%02X", (unsigned char)values[i]->bv_val[j]); + printf("%02X", (uint8_t)values[i]->bv_val[j]); } printf("\n"); } diff --git a/source4/libcli/auth/ntlm_check.c b/source4/libcli/auth/ntlm_check.c index a3b92752aa..cdb092d1b5 100644 --- a/source4/libcli/auth/ntlm_check.c +++ b/source4/libcli/auth/ntlm_check.c @@ -178,7 +178,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx, DATA_BLOB *user_sess_key, DATA_BLOB *lm_sess_key) { - static const unsigned char zeros[8]; + static const uint8_t zeros[8]; if (nt_pw == NULL) { DEBUG(3,("ntlm_password_check: NO NT password stored for user %s.\n", username)); @@ -232,7 +232,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx, DEBUG(4,("ntlm_password_check: checking plaintext passwords for user %s\n", username)); if (nt_pw && nt_response->length) { - unsigned char pwhash[16]; + uint8_t pwhash[16]; mdfour(pwhash, nt_response->data, nt_response->length); if (memcmp(pwhash, nt_pw, sizeof(pwhash)) == 0) { return NT_STATUS_OK; @@ -255,7 +255,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx, /* Only the fisrt 14 chars are considered, password need not be null terminated. */ /* we *might* need to upper-case the string here */ - E_P16((const unsigned char *)dospwd, p16); + E_P16((const uint8_t *)dospwd, p16); if (memcmp(p16, lm_pw, sizeof(p16)) == 0) { return NT_STATUS_OK; diff --git a/source4/libcli/auth/ntlmssp.h b/source4/libcli/auth/ntlmssp.h index a5565888f1..968911fef5 100644 --- a/source4/libcli/auth/ntlmssp.h +++ b/source4/libcli/auth/ntlmssp.h @@ -171,13 +171,13 @@ typedef struct ntlmssp_state char recv_sign_key[16]; char recv_seal_key[16]; - unsigned char send_sign_hash[258]; - unsigned char send_seal_hash[258]; - unsigned char recv_sign_hash[258]; - unsigned char recv_seal_hash[258]; + uint8_t send_sign_hash[258]; + uint8_t send_seal_hash[258]; + uint8_t recv_sign_hash[258]; + uint8_t recv_seal_hash[258]; /* ntlmv1 */ - unsigned char ntlmssp_hash[258]; + uint8_t ntlmssp_hash[258]; /* it turns out that we don't always get the response in at the time we want to process it. diff --git a/source4/libcli/auth/ntlmssp_sign.c b/source4/libcli/auth/ntlmssp_sign.c index df7bddcd38..22aa877b63 100644 --- a/source4/libcli/auth/ntlmssp_sign.c +++ b/source4/libcli/auth/ntlmssp_sign.c @@ -27,16 +27,16 @@ #define SRV_SIGN "session key to server-to-client signing key magic constant" #define SRV_SEAL "session key to server-to-client sealing key magic constant" -static void NTLMSSPcalc_ap( unsigned char *hash, unsigned char *data, int len) +static void NTLMSSPcalc_ap( uint8_t *hash, uint8_t *data, int len) { - unsigned char index_i = hash[256]; - unsigned char index_j = hash[257]; + uint8_t index_i = hash[256]; + uint8_t index_j = hash[257]; int ind; for (ind = 0; ind < len; ind++) { - unsigned char tc; - unsigned char t; + uint8_t tc; + uint8_t t; index_i++; index_j += hash[index_i]; @@ -53,19 +53,19 @@ static void NTLMSSPcalc_ap( unsigned char *hash, unsigned char *data, int len) hash[257] = index_j; } -static void calc_hash(unsigned char hash[258], const char *key, size_t key_len) +static void calc_hash(uint8_t hash[258], const char *key, size_t key_len) { - unsigned char j = 0; + uint8_t j = 0; int ind; for (ind = 0; ind < 256; ind++) { - hash[ind] = (unsigned char)ind; + hash[ind] = (uint8_t)ind; } for (ind = 0; ind < 256; ind++) { - unsigned char tc; + uint8_t tc; j += (hash[ind] + key[ind%key_len]); @@ -97,7 +97,7 @@ static void calc_hash(unsigned char hash[258], const char *key, size_t key_len) -static void calc_ntlmv2_hash(unsigned char hash[258], unsigned char subkey[16], +static void calc_ntlmv2_hash(uint8_t hash[258], uint8_t subkey[16], DATA_BLOB session_key, const char *constant) { @@ -365,7 +365,7 @@ NTSTATUS ntlmssp_unseal_packet(NTLMSSP_STATE *ntlmssp_state, */ NTSTATUS ntlmssp_sign_init(NTLMSSP_STATE *ntlmssp_state) { - unsigned char p24[24]; + uint8_t p24[24]; ZERO_STRUCT(p24); DEBUG(3, ("NTLMSSP Sign/Seal - Initialising with flags:\n")); diff --git a/source4/libcli/clifile.c b/source4/libcli/clifile.c index d1f9145e44..23f3cdc4a4 100644 --- a/source4/libcli/clifile.c +++ b/source4/libcli/clifile.c @@ -348,7 +348,7 @@ NTSTATUS cli_close(struct cli_tree *tree, int fnum) ****************************************************************************/ NTSTATUS cli_locktype(struct cli_tree *tree, int fnum, uint32_t offset, uint32_t len, int timeout, - unsigned char locktype) + uint8_t locktype) { union smb_lock parms; struct smb_lock_entry lock[1]; diff --git a/source4/libcli/raw/smb_signing.c b/source4/libcli/raw/smb_signing.c index 989b5527aa..c82946ac53 100644 --- a/source4/libcli/raw/smb_signing.c +++ b/source4/libcli/raw/smb_signing.c @@ -98,7 +98,7 @@ static BOOL signing_good(struct cli_request *req, BOOL good) ************************************************************/ static void cli_request_simple_sign_outgoing_message(struct cli_request *req) { - unsigned char calc_md5_mac[16]; + uint8_t calc_md5_mac[16]; struct MD5Context md5_ctx; struct smb_basic_signing_context *data = req->transport->negotiate.sign_info.signing_context; @@ -150,9 +150,9 @@ static void cli_request_simple_sign_outgoing_message(struct cli_request *req) static BOOL cli_request_simple_check_incoming_message(struct cli_request *req) { BOOL good; - unsigned char calc_md5_mac[16]; - unsigned char server_sent_mac[8]; - unsigned char sequence_buf[8]; + uint8_t calc_md5_mac[16]; + uint8_t server_sent_mac[8]; + uint8_t sequence_buf[8]; struct MD5Context md5_ctx; struct smb_basic_signing_context *data = req->transport->negotiate.sign_info.signing_context; const size_t offset_end_of_sig = (HDR_SS_FIELD + 8); diff --git a/source4/libcli/util/smbdes.c b/source4/libcli/util/smbdes.c index 22bafcb449..b0efdec157 100644 --- a/source4/libcli/util/smbdes.c +++ b/source4/libcli/util/smbdes.c @@ -258,7 +258,7 @@ static void dohash(char *out, char *in, char *key, int forw) permute(out, rl, perm6, 64); } -static void str_to_key(const unsigned char *str,unsigned char *key) +static void str_to_key(const uint8_t *str,uint8_t *key) { int i; @@ -276,13 +276,13 @@ static void str_to_key(const unsigned char *str,unsigned char *key) } -void smbhash(unsigned char *out, const unsigned char *in, const unsigned char *key, int forw) +void smbhash(uint8_t *out, const uint8_t *in, const uint8_t *key, int forw) { int i; char outb[64]; char inb[64]; char keyb[64]; - unsigned char key2[8]; + uint8_t key2[8]; str_to_key(key, key2); @@ -304,53 +304,53 @@ void smbhash(unsigned char *out, const unsigned char *in, const unsigned char *k } } -void E_P16(const unsigned char *p14,unsigned char *p16) +void E_P16(const uint8_t *p14,uint8_t *p16) { unsigned const char sp8[8] = {0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; smbhash(p16, sp8, p14, 1); smbhash(p16+8, sp8, p14+7, 1); } -void E_P24(const unsigned char *p21, const unsigned char *c8, unsigned char *p24) +void E_P24(const uint8_t *p21, const uint8_t *c8, uint8_t *p24) { smbhash(p24, c8, p21, 1); smbhash(p24+8, c8, p21+7, 1); smbhash(p24+16, c8, p21+14, 1); } -void D_P16(const unsigned char *p14, const unsigned char *in, unsigned char *out) +void D_P16(const uint8_t *p14, const uint8_t *in, uint8_t *out) { smbhash(out, in, p14, 0); smbhash(out+8, in+8, p14+7, 0); } -void E_old_pw_hash( unsigned char *p14, const unsigned char *in, unsigned char *out) +void E_old_pw_hash( uint8_t *p14, const uint8_t *in, uint8_t *out) { smbhash(out, in, p14, 1); smbhash(out+8, in+8, p14+7, 1); } -void cred_hash1(unsigned char *out, const unsigned char *in, const unsigned char *key) +void cred_hash1(uint8_t *out, const uint8_t *in, const uint8_t *key) { - unsigned char buf[8]; + uint8_t buf[8]; smbhash(buf, in, key, 1); smbhash(out, buf, key+9, 1); } -void cred_hash2(unsigned char *out, const unsigned char *in, const unsigned char *key, int forw) +void cred_hash2(uint8_t *out, const uint8_t *in, const uint8_t *key, int forw) { - unsigned char buf[8]; - unsigned char key2[8]; + uint8_t buf[8]; + uint8_t key2[8]; ZERO_STRUCT(key2); smbhash(buf, in, key, forw); key2[0] = key[7]; smbhash(out, buf, key2, forw); } -void cred_hash3(unsigned char *out, unsigned char *in, const unsigned char *key, int forw) +void cred_hash3(uint8_t *out, uint8_t *in, const uint8_t *key, int forw) { - unsigned char key2[8]; + uint8_t key2[8]; ZERO_STRUCT(key2); smbhash(out, in, key, forw); key2[0] = key[7]; @@ -358,20 +358,20 @@ void cred_hash3(unsigned char *out, unsigned char *in, const unsigned char *key, } -void SamOEMhashBlob(unsigned char *data, int len, const DATA_BLOB *key) +void SamOEMhashBlob(uint8_t *data, int len, const DATA_BLOB *key) { - unsigned char s_box[256]; - unsigned char index_i = 0; - unsigned char index_j = 0; - unsigned char j = 0; + uint8_t s_box[256]; + uint8_t index_i = 0; + uint8_t index_j = 0; + uint8_t j = 0; int ind; for (ind = 0; ind < 256; ind++) { - s_box[ind] = (unsigned char)ind; + s_box[ind] = (uint8_t)ind; } for (ind = 0; ind < 256; ind++) { - unsigned char tc; + uint8_t tc; j += (s_box[ind] + key->data[ind%key->length]); @@ -380,8 +380,8 @@ void SamOEMhashBlob(unsigned char *data, int len, const DATA_BLOB *key) s_box[j] = tc; } for (ind = 0; ind < len; ind++) { - unsigned char tc; - unsigned char t; + uint8_t tc; + uint8_t t; index_i++; index_j += s_box[index_i]; @@ -399,7 +399,7 @@ void SamOEMhashBlob(unsigned char *data, int len, const DATA_BLOB *key) a varient that assumes a 16 byte key. This should be removed when the last user is gone */ -void SamOEMhash(unsigned char *data, const unsigned char keystr[16], int len) +void SamOEMhash(uint8_t *data, const uint8_t keystr[16], int len) { DATA_BLOB key = data_blob(keystr, 16); diff --git a/source4/libcli/util/smbencrypt.c b/source4/libcli/util/smbencrypt.c index 5b210394c1..d52d24e1e1 100644 --- a/source4/libcli/util/smbencrypt.c +++ b/source4/libcli/util/smbencrypt.c @@ -68,7 +68,7 @@ void E_md4hash(const char *passwd, uchar p16[16]) /* Calculate length in bytes */ len = strlen_w(wpwd) * sizeof(int16_t); - mdfour(p16, (unsigned char *)wpwd, len); + mdfour(p16, (uint8_t *)wpwd, len); ZERO_STRUCT(wpwd); } @@ -90,7 +90,7 @@ BOOL E_deshash(const char *passwd, uchar p16[16]) push_ascii(dospwd, passwd, sizeof(dospwd), STR_UPPER|STR_TERMINATE); /* Only the fisrt 14 chars are considered, password need not be null terminated. */ - E_P16((const unsigned char *)dospwd, p16); + E_P16((const uint8_t *)dospwd, p16); if (strlen(dospwd) > 14) { ret = False; @@ -170,8 +170,8 @@ BOOL ntv2_owf_gen(const uchar owf[16], domain_byte_len = domain_byte_len - 2; hmac_md5_init_limK_to_64(owf, 16, &ctx); - hmac_md5_update((const unsigned char *)user, user_byte_len, &ctx); - hmac_md5_update((const unsigned char *)domain, domain_byte_len, &ctx); + hmac_md5_update((const uint8_t *)user, user_byte_len, &ctx); + hmac_md5_update((const uint8_t *)domain, domain_byte_len, &ctx); hmac_md5_final(kr_buf, &ctx); #ifdef DEBUG_PASSWORD @@ -247,7 +247,7 @@ void SMBsesskeygen_ntv2(const uchar kr[16], hmac_md5_init_limK_to_64(kr, 16, &ctx); hmac_md5_update(nt_resp, 16, &ctx); - hmac_md5_final((unsigned char *)sess_key, &ctx); + hmac_md5_final((uint8_t *)sess_key, &ctx); #ifdef DEBUG_PASSWORD DEBUG(100, ("SMBsesskeygen_ntv2:\n")); @@ -260,7 +260,7 @@ void SMBsesskeygen_ntv1(const uchar kr[16], uint8_t sess_key[16]) /* yes, this session key does not change - yes, this is a problem - but it is 128 bits */ - mdfour((unsigned char *)sess_key, kr, 16); + mdfour((uint8_t *)sess_key, kr, 16); #ifdef DEBUG_PASSWORD DEBUG(100, ("SMBsesskeygen_ntv1:\n")); @@ -443,7 +443,7 @@ BOOL encode_pw_buffer(char buffer[516], const char *password, int string_flags) memcpy(&buffer[512 - new_pw_len], new_pw, new_pw_len); - generate_random_buffer((unsigned char *)buffer, 512 - new_pw_len, False); + generate_random_buffer((uint8_t *)buffer, 512 - new_pw_len, False); /* * The length of the new password is in the last 4 bytes of diff --git a/source4/smb_server/signing.c b/source4/smb_server/signing.c index 76cd506aea..0ac271a255 100644 --- a/source4/smb_server/signing.c +++ b/source4/smb_server/signing.c @@ -37,7 +37,7 @@ static void mark_packet_signed(struct request_context *req) static void calc_signature(uint8_t *buffer, size_t length, DATA_BLOB *mac_key, uint8_t signature[8]) { - unsigned char calc_md5_mac[16]; + uint8_t calc_md5_mac[16]; struct MD5Context md5_ctx; MD5Init(&md5_ctx); @@ -106,7 +106,7 @@ static void req_signing_alloc_seq_num(struct request_context *req) */ BOOL req_signing_check_incoming(struct request_context *req) { - unsigned char client_md5_mac[8], signature[8]; + uint8_t client_md5_mac[8], signature[8]; switch (req->smb->signing.signing_state) { case SMB_SIGNING_OFF: diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c index 862e409fd4..28b7557f3e 100644 --- a/source4/torture/raw/oplock.c +++ b/source4/torture/raw/oplock.c @@ -38,7 +38,7 @@ static struct { int fnum; - unsigned char level; + uint8_t level; int count; } break_info; diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c index 37e57d0da7..625447705a 100644 --- a/source4/torture/rpc/echo.c +++ b/source4/torture/rpc/echo.c @@ -120,9 +120,9 @@ static BOOL test_sourcedata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } for (i=0;i<len;i++) { - unsigned char *v = (unsigned char *)data_out; + uint8_t *v = (uint8_t *)data_out; if (v[i] != (i & 0xFF)) { - printf("bad data 0x%x at %d\n", (unsigned char)data_out[i], i); + printf("bad data 0x%x at %d\n", (uint8_t)data_out[i], i); return False; } } diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 0fbd03fb83..916b18896b 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -688,11 +688,11 @@ static BOOL test_ntlm_in_both(struct samlogon_state *samlogon_state, char **erro SMBNTencrypt(samlogon_state->password, samlogon_state->chall.data, nt_response.data); - E_md4hash(samlogon_state->password, (unsigned char *)nt_hash); - SMBsesskeygen_ntv1((const unsigned char *)nt_hash, + E_md4hash(samlogon_state->password, (uint8_t *)nt_hash); + SMBsesskeygen_ntv1((const uint8_t *)nt_hash, session_key.data); - E_deshash(samlogon_state->password, (unsigned char *)lm_hash); + E_deshash(samlogon_state->password, (uint8_t *)lm_hash); nt_status = check_samlogon(samlogon_state, BREAK_NONE, diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index a7a6482da9..48ae84a9ea 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -452,7 +452,7 @@ static BOOL test_SetUserPassEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } - generate_random_buffer((unsigned char *)confounder, 16, False); + generate_random_buffer((uint8_t *)confounder, 16, False); MD5Init(&ctx); MD5Update(&ctx, confounder, 16); @@ -506,7 +506,7 @@ static BOOL test_SetUserPass_25(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } - generate_random_buffer((unsigned char *)confounder, 16, False); + generate_random_buffer((uint8_t *)confounder, 16, False); MD5Init(&ctx); MD5Update(&ctx, confounder, 16); diff --git a/source4/utils/net_ads_cldap.c b/source4/utils/net_ads_cldap.c index b588cf7d48..2fdb6e58fd 100644 --- a/source4/utils/net_ads_cldap.c +++ b/source4/utils/net_ads_cldap.c @@ -64,7 +64,7 @@ static unsigned pull_netlogon_string(struct netlogon_string *ret,const char *d) ZERO_STRUCTP(ret); do { - unsigned len = (unsigned char)*p; + unsigned len = (uint8_t)*p; p++; if (len > 0 && len != 0xc0) { diff --git a/source4/utils/net_rpc.c b/source4/utils/net_rpc.c index ce957f57e0..08782d8320 100644 --- a/source4/utils/net_rpc.c +++ b/source4/utils/net_rpc.c @@ -239,7 +239,7 @@ static NTSTATUS rpc_join_oldstyle_internals(const DOM_SID *domain_sid, struct cl int argc, const char **argv) { fstring trust_passwd; - unsigned char orig_trust_passwd_hash[16]; + uint8_t orig_trust_passwd_hash[16]; NTSTATUS result; fstrcpy(trust_passwd, lp_netbios_name()); diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c index a2ec19d74d..b94887cade 100644 --- a/source4/utils/nmblookup.c +++ b/source4/utils/nmblookup.c @@ -80,7 +80,7 @@ static void usage(void) /**************************************************************************** turn a node status flags field into a string ****************************************************************************/ -static char *node_status_flags(unsigned char flags) +static char *node_status_flags(uint8_t flags) { static fstring ret; fstrcpy(ret,""); diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c index b76308c55f..a966a0461d 100644 --- a/source4/utils/ntlm_auth.c +++ b/source4/utils/ntlm_auth.c @@ -45,11 +45,11 @@ static const char *workstation; static const char *hex_challenge; static const char *hex_lm_response; static const char *hex_nt_response; -static unsigned char *challenge; +static uint8_t *challenge; static size_t challenge_len; -static unsigned char *lm_response; +static uint8_t *lm_response; static size_t lm_response_len; -static unsigned char *nt_response; +static uint8_t *nt_response; static size_t nt_response_len; static char *password; @@ -393,7 +393,7 @@ enum { Routine to set hex password characters into an allocated array. **************************************************************/ -static void hex_encode(const unsigned char *buff_in, size_t len, char **out_hex_buffer) +static void hex_encode(const uint8_t *buff_in, size_t len, char **out_hex_buffer) { int i; char *hex_buffer; @@ -410,12 +410,12 @@ static void hex_encode(const unsigned char *buff_in, size_t len, char **out_hex_ into a 16 byte array. **************************************************************/ -static BOOL hex_decode(const char *hex_buf_in, unsigned char **out_buffer, size_t *size) +static BOOL hex_decode(const char *hex_buf_in, uint8_t **out_buffer, size_t *size) { int i; size_t hex_buf_in_len = strlen(hex_buf_in); - unsigned char partial_byte_hex; - unsigned char partial_byte; + uint8_t partial_byte_hex; + uint8_t partial_byte; const char *hexchars = "0123456789ABCDEF"; char *p; BOOL high = True; |