r943: change samba4 to use 'uint8_t' instead of 'unsigned char'
authorStefan Metzmacher <metze@samba.org>
Sat, 29 May 2004 08:11:46 +0000 (08:11 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:56:21 +0000 (12:56 -0500)
metze
(This used to be commit b5378803fdcb3b3afe7c2932a38828e83470f61a)

46 files changed:
source4/auth/auth_domain.c
source4/auth/auth_server.c
source4/auth/auth_util.c
source4/auth/pass_check.c
source4/client/clitar.c
source4/include/MacExtensions.h
source4/include/byteorder.h
source4/include/md5.h
source4/include/registry.h
source4/include/smb.h
source4/lib/crypto/md4.c
source4/lib/crypto/md5.c
source4/lib/genrand.c
source4/lib/iconv.c
source4/lib/ldb/common/ldb_ldif.c
source4/lib/ldb/ldb_tdb/ldb_pack.c
source4/lib/registry/common/reg_util.c
source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
source4/lib/registry/tools/regpatch.c
source4/lib/replace.c
source4/lib/snprintf.c
source4/lib/tdb/common/tdb.c
source4/lib/tdb/tools/tdbdump.c
source4/lib/tdb/tools/tdbtool.c
source4/lib/util.c
source4/lib/util_file.c
source4/lib/util_sock.c
source4/lib/util_str.c
source4/lib/xfile.c
source4/libads/ldap.c
source4/libcli/auth/ntlm_check.c
source4/libcli/auth/ntlmssp.h
source4/libcli/auth/ntlmssp_sign.c
source4/libcli/clifile.c
source4/libcli/raw/smb_signing.c
source4/libcli/util/smbdes.c
source4/libcli/util/smbencrypt.c
source4/smb_server/signing.c
source4/torture/raw/oplock.c
source4/torture/rpc/echo.c
source4/torture/rpc/netlogon.c
source4/torture/rpc/samr.c
source4/utils/net_ads_cldap.c
source4/utils/net_rpc.c
source4/utils/nmblookup.c
source4/utils/ntlm_auth.c

index 3064da72de817cb1ddf6bd132a50c440fcb3f360..f59c82c5537aad23be79031ffc565d426c13a727 100644 (file)
@@ -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;
index 620d9a33c84e1e0d236b78d83ddf9ca44494c89b..076fa8e70e0b7667b2d26b143b6cf5af35a13a0f 100644 (file)
@@ -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;
index 8a10a33b0c9a39872d909e1d883a90838b02aa87..b04b93d63f9ddec0c21bef73ebc22d10d3ca695b 100644 (file)
@@ -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));
index 88b82e34746eba77a1204e18926b9a7c891aa15a..c468db55584b8a08de10716064c984c137af60e0 100644 (file)
@@ -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)
index dce914e9a6e87c15c5ab2808494d32f9af508906..69c25ba2626e43839084baebd142d293ab744376 100644 (file)
@@ -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;
index 92376b2cf03568b983668ad957e9d9941a24f334..150d207f88fa346b72959f04b4275dc314cdcd0b 100644 (file)
@@ -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
index e237b5d762184912db15536091663b4ff0938fbd..b3caa310a4cb6b710d2800d3e5358ab733b24ad5 100644 (file)
@@ -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))
index 6f8b7d0c152508fb59608c085b7a53867b3096d9..57c2f99caa90d4985a557dd7c093886a8e68c78d 100644 (file)
@@ -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.
index 210bcd1ba359d7c62229015c8ec52a6b33359ced..478c7919ede336a6a1a6bd8be9fe57d9207da33b 100644 (file)
@@ -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;
index c6866c52b46124c73bfe8d9549b739fa29448ce5..178fab1db1035499bf45d31681d41a524e60c2a7 100644 (file)
@@ -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"
index cc8b9b68411397e0e6275808c84db5ecc30b6c4e..98fcabf2241f89979c70840523569d871165a62e 100644 (file)
@@ -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;
index dbb3462bd4f33e9992c4d5e0389c3b8b7e87af01..a393fc253287e49b5180549911e667bf0899656f 100644 (file)
@@ -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 */
 }
index a5002969bdb04ab366b6d3ee157bf09a4a2fede6..b37078b2848b99c493c888750dca802f7a2e555a 100644 (file)
 
 #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);
index 3f37583e3930d5b557b11b6792df417ec62ecc68..65fa45248ffce7e5b4d6f86222339f37b4784dd1 100644 (file)
@@ -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) {
index c120ee5f4eeb6c4c2a06f88a36d1d3cb1d158d78..b08c616a055d3d1e087d78b713b5e51c0c479610 100644 (file)
@@ -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;
index e71679646e317c8890137cebfd974b27e421075f..fcbc9bd56dd9b6e06b1221c51a0d7a1389906637 100644 (file)
@@ -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);
index 01d75f1b9089ee3b77af06f4565f52b9e9024875..db5e97bf7fd53a3e5667953642ef0ccdfc5d3e61 100644 (file)
@@ -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++;      
          }
index 627b5a8f13f8b5c19012e0b70aace429353cf5be..fa4b3e4d188d527bffdbc1e6e2d66051d0b001c6 100644 (file)
@@ -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 *)&reg_ace->info.mask;
+       p = (uint8_t *)&reg_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 *)&reg_ace->size;
+       p = (uint8_t *)&reg_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;
 
index 77c0f710c1c8428835f0ee198eeb59b323d70363..af869d1cfa52380426937d0657526fd717582208 100644 (file)
@@ -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)
 {
index 189c5bc04d4faae9da3085ba66ba3b47cea27a66..c186d307e64b1660b2a084c6a634b5473491c382 100644 (file)
@@ -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]);
index fd31870162d1ae223a9804426728cb8438ecca4f..3b04228c427f1f2a4490fd823d0c9d469c28f0b4 100644 (file)
@@ -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);
index c8ac7babadf014a07b4309e44ffbb31e0ba0ec3a..b7b9631444dc92eda5bda702b1a425c7c1f130af 100644 (file)
@@ -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;
index 9c1dc2761b67d9bb6af9879d798e4d6df89eb662..1a7128c473774b94ba6483f61a850937ed41f6ff 100644 (file)
@@ -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)) {
index 92009dcef48cbd435dfa2e28d4c629ad946486b8..65bbedf709a36626f97eeed3cdaea66c2e317f99 100644 (file)
@@ -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;
index a4be8f8bf8f76d07ab784e07688b26afd445df6a..dd53d2b174dff4b8739eafccabc80e8ffeefbb68 100644 (file)
@@ -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;
 
index 0eb80462275b400660de7e87b62a92b65ee4bd99..a5832adec5e9de27b3cd5e804add6e1ab260d4e6 100644 (file)
@@ -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"));
index 999aeae744db3725d8d67f4e7d16ca4b86f060ee..43da8a2f577aedc7e71dc41e9c73413b131f82ff 100644 (file)
@@ -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;
index 4002c21e9a53b181edd0e66690ef390b73ed0d5d..0113b1ae484a51475c5f1d20a878452d1f1621fd 100644 (file)
@@ -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) {
index 1534dd855e9e2b72202231e5382a1bcd03f3b1fe..de4cf4b12a7fd2999c3cf365c3b1b985ae0c1a1b 100644 (file)
@@ -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;
index b2afe8db2616aeba56ec0dc3f3fe9a0296f0dfb8..6a2dcbaa87356862ea1e60f35d7d6017733d5dda 100644 (file)
@@ -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");
        }
index a3b92752aa60bd65f822b6705bfd2b183bc7207f..cdb092d1b55b200a72153123884b4d35c590d7cb 100644 (file)
@@ -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;
index a5565888f1d1d3aed0d2f7b6c7d3e0c9497ec7dc..968911fef5db0a605fa7a9aaf6305d4e26ce7bf0 100644 (file)
@@ -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.
index df7bddcd38d92f7b7e77f6cce8710689e03e3449..22aa877b63d17c26e05cb094ebd29278e90543a0 100644 (file)
 #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"));
index d1f9145e44d9b38d91872e2a807faabbf081b311..23f3cdc4a450bd13d6559228e4222f02cc0ff6c6 100644 (file)
@@ -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];
index 989b5527aae93acec87f0eb3cd05b4aabbe8666c..c82946ac53d1a947b69e2fc6dec1c6e54039289c 100644 (file)
@@ -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);
index 22bafcb449d2a0c7eab75ae9e5e64da85570a51c..b0efdec1573c04aa8e2e1d8da89787475f39db34 100644 (file)
@@ -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);
        
index 5b210394c1df31287a657e29054d9b7c9b03ab17..d52d24e1e15b9c1e5f1e47563ac0cf570968a356 100644 (file)
@@ -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
index 76cd506aea19cb9e73c2efabefe4315bd3b18c36..0ac271a255b3dc42f3f28e86ac095537f1eb34bb 100644 (file)
@@ -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:
index 862e409fd47587664c3406b332c9879aa7a8522d..28b7557f3e3b401b218c363cf1641e772897ad21 100644 (file)
@@ -38,7 +38,7 @@
 
 static struct {
        int fnum;
-       unsigned char level;
+       uint8_t level;
        int count;
 } break_info;
 
index 37e57d0da7817e237f6a41579972396d165bf16f..625447705a4d715d7c89b93ec6db0d8934b6c4c8 100644 (file)
@@ -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;
                }
        }
index 0fbd03fb8321d1242728be36cfb053327d4d1d94..916b18896b47b87e18eecc053f820c3a569e965f 100644 (file)
@@ -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,
index a7a6482da9f5945af4fb8a88743894a8658dea22..48ae84a9ea8d90a5fac635757a273aa387458a47 100644 (file)
@@ -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);
index b588cf7d486a5d9b67c1a4e68f183ea6aca3d516..2fdb6e58fda84c7acd77dab1c412e900c667ec2e 100644 (file)
@@ -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) {
index ce957f57e069807ca3fa670fb01a01f4d135e476..08782d8320b4814c47e24e9d372fa3c891e6b6c1 100644 (file)
@@ -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());
index a2ec19d74d3117af6c04706b0d7874acbfec7526..b94887cadeb96924ab596a6ea0ef4d480e24b477 100644 (file)
@@ -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,"");
index b76308c55fb0103edfc6bbfa181004510c015870..a966a0461df440608d45daef2a54fa97fd5ded44 100644 (file)
@@ -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;