casting cleanups
authorAndrew Tridgell <tridge@samba.org>
Mon, 20 Oct 1997 02:50:12 +0000 (02:50 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 20 Oct 1997 02:50:12 +0000 (02:50 +0000)
(This used to be commit ab849a97821c9e1f199eea8ea2ec477687bed947)

source3/include/proto.h
source3/lib/util.c
source3/libsmb/credentials.c
source3/libsmb/smbdes.c
source3/smbd/password.c

index 29252f16e376997c34651ceea221a90d81766515..224aaa5a79c965ccd02222d9b5a4665143726a35 100644 (file)
@@ -833,11 +833,10 @@ BOOL smb_shm_get_usage(int *bytes_free,
 
 /*The following definitions come from  smbdes.c  */
 
-void str_to_key(unsigned char *str,unsigned char *key);
 void E_P16(unsigned char *p14,unsigned char *p16);
 void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
-void cred_hash1(char *out, char *in, char *key);
-void cred_hash2(char *out, char *in, char *key);
+void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key);
+void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key);
 
 /*The following definitions come from  smbencrypt.c  */
 
@@ -1115,5 +1114,5 @@ void pstrcpy(char *dest, char *src);
 char *align4(char *q, char *base);
 char *align2(char *q, char *base);
 char *align_offset(char *q, char *base, int align_offset_len);
-void dump_data(int level,unsigned char *buf,int len);
+void dump_data(int level,char *buf1,int len);
 char *tab_depth(int depth);
index 36e9e326acf07c1823bd938e255883d74e5abb81..5c243204d022fcbf2b62a333b95f3d09d64493bc 100644 (file)
@@ -4414,8 +4414,9 @@ static void print_asc(int level, unsigned char *buf,int len)
                DEBUG(level,("%c", isprint(buf[i])?buf[i]:'.'));
 }
 
-void dump_data(int level,unsigned char *buf,int len)
+void dump_data(int level,char *buf1,int len)
 {
+  unsigned char *buf = (unsigned char *)buf1;
   int i=0;
   if (len<=0) return;
 
index f1a41b0b3b6dab945234866e09aff87b8703a8af..ee7b1493e1554c655281aaf190031a323d334a70 100644 (file)
@@ -34,8 +34,8 @@ void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass,
                       uint32 session_key[2])
 {
        uint32 sum[2];
-       char sum2[8];
-       char netsesskey[8];
+       unsigned char sum2[8];
+       unsigned char netsesskey[8];
 
        sum[0] = IVAL(clnt_chal->data, 0) + IVAL(srv_chal->data, 0);
        sum[1] = IVAL(clnt_chal->data, 4) + IVAL(srv_chal->data, 4);
@@ -43,7 +43,7 @@ void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass,
        SIVAL(sum2,0,sum[0]);
        SIVAL(sum2,4,sum[1]);
 
-       cred_hash1(netsesskey, sum2, pass);
+       cred_hash1(netsesskey, sum2,(unsigned char *)pass);
 
        session_key[0] = IVAL(netsesskey, 0);
        session_key[1] = IVAL(netsesskey, 4);
@@ -72,9 +72,9 @@ Output:
 void cred_create(uint32 session_key[2], DOM_CHAL *stor_cred, UTIME timestamp, 
                 DOM_CHAL *cred)
 {
-       char calc_cred[8];
-       char timecred[8];
-       char netsesskey[8];
+       unsigned char calc_cred[8];
+       unsigned char timecred[8];
+       unsigned char netsesskey[8];
 
        SIVAL(netsesskey, 0, session_key[0]);
        SIVAL(netsesskey, 4, session_key[1]);
index 90bad778c5aec12f34f8837faea0bd1f2210e214..67e27016c31ea5965576cdf36d61670ef8dc364a 100644 (file)
@@ -257,7 +257,7 @@ static void dohash(char *out, char *in, char *key)
        permute(out, rl, perm6, 64);
 }
 
-void str_to_key(unsigned char *str,unsigned char *key)
+static void str_to_key(unsigned char *str,unsigned char *key)
 {
        int i;
 
@@ -317,18 +317,18 @@ void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24)
        smbhash(p24+16, c8, p21+14);
 }
 
-void cred_hash1(char *out, char *in, char *key)
+void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key)
 {
-       char buf[8];
+       unsigned char buf[8];
 
        smbhash(buf, in, key);
        smbhash(out, buf, key+9);
 }
 
-void cred_hash2(char *out, char *in, char *key)
+void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key)
 {
-       char buf[8];
-       static char key2[8];
+       unsigned char buf[8];
+       static unsigned char key2[8];
        
        smbhash(buf, in, key);
        key2[0] = key[7];
index 9f4f0abcae80b4a283800438f5b90a909a9085de..2da8a8f93617128b3aac78d37abd2fce7314bc70 100644 (file)
@@ -1657,7 +1657,7 @@ BOOL server_cryptkey(char *buf)
 }
 
 /****************************************************************************
-attempted support for server level security 
+support for server level security 
 ****************************************************************************/
 BOOL server_validate(char *buf)
 {