debug info added
authorLuke Leighton <lkcl@samba.org>
Mon, 13 Oct 1997 13:35:37 +0000 (13:35 +0000)
committerLuke Leighton <lkcl@samba.org>
Mon, 13 Oct 1997 13:35:37 +0000 (13:35 +0000)
(This used to be commit a3f96555b47265b8cd4d1f735af58375e2591d56)

source3/include/byteorder.h
source3/libsmb/credentials.c
source3/smbd/pipes.c

index 808026f9dbdbf3e085d983ca85d127c362fabc85..a6f826b518d4fa890f7fcb7bdd72e76d4487eb5c 100644 (file)
@@ -200,30 +200,30 @@ it also defines lots of intermediate macros, just ignore those :-)
 
 #define DBG_RW_PCVAL(string,depth,base,read,inbuf,outbuf,len) \
        RW_PCVAL(read,inbuf,outbuf,len) \
-       DEBUG(5,("%s %04x %s: ", \
+       DEBUG(5,("%s%04x %s: ", \
              tab_depth(depth), PTR_DIFF(inbuf,base),string)); \
-       { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (outbuf)[idx])); } } \
+       { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%x ", (outbuf)[idx])); } } \
        DEBUG(5,("\n"));
 
 #define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \
        RW_PSVAL(read,inbuf,outbuf,len) \
-       DEBUG(5,("%s %04x %s: ", \
+       DEBUG(5,("%s%04x %s: ", \
              tab_depth(depth), PTR_DIFF(inbuf,base),string)); \
-       { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (outbuf)[idx])); } } \
+       { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (outbuf)[idx])); } } \
        DEBUG(5,("\n"));
 
 #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \
        RW_CVAL(read,inbuf,outbuf,0) \
-       DEBUG(5,("%s %04x %s: %02x\n", \
+       DEBUG(5,("%s%04x %s: %02x\n", \
              tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf)));
 
 #define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \
        RW_SVAL(read,inbuf,outbuf,0) \
-       DEBUG(5,("%s %04x %s: %04x\n", \
+       DEBUG(5,("%s%04x %s: %04x\n", \
              tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf)));
 
 #define DBG_RW_IVAL(string,depth,base,read,inbuf,outbuf) \
        RW_IVAL(read,inbuf,outbuf,0) \
-       DEBUG(5,("%s %04x %s: %08x\n", \
+       DEBUG(5,("%s%04x %s: %08x\n", \
              tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf)));
 
index ce7159f7ffa775e64aa5461b12432d5c0d7e50d1..3af182c5db8c7fdb995817cfc9905aad79145560 100644 (file)
@@ -37,13 +37,6 @@ void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass,
        char sum2[8];
        char buf[8];
 
-       DEBUG(4,("cred_session_key\n"));
-
-       DEBUG(5,("      clnt_chal: %lx %lx srv_chal: %lx %lx\n",
-                       
-                 IVAL(clnt_chal->data, 0), IVAL(clnt_chal->data, 4),
-                 IVAL(srv_chal->data, 0), IVAL(srv_chal->data, 4)));
-
        sum[0] = IVAL(clnt_chal->data, 0) + IVAL(srv_chal->data, 0);
        sum[1] = IVAL(clnt_chal->data, 4) + IVAL(srv_chal->data, 4);
 
@@ -53,6 +46,18 @@ void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass,
        smbhash(pass  , sum2, buf);
        smbhash(pass+9, buf , session_key);
 
+       /* debug output*/
+       DEBUG(4,("cred_session_key\n"));
+
+       DEBUG(5,("      clnt_chal: "));
+       dump_data(5, clnt_chal->data, 8);
+
+       DEBUG(5,("      srv_chal: "));
+       dump_data(5, srv_chal->data, 8);
+
+       DEBUG(5,("      clnt_chal+srv_chal: "));
+       dump_data(5, sum2, 8);
+
        DEBUG(5,("      session_key: "));
        dump_data(5, session_key, 16);
 }
@@ -83,6 +88,21 @@ void cred_create(char *session_key, DOM_CHAL *stored_cred, UTIME timestamp,
        memset(key2, 0, 7);
        key2[0] = session_key[7];
        smbhash(key2, buf, cred->data);
+
+       /* debug output*/
+       DEBUG(4,("cred_create\n"));
+
+       DEBUG(5,("      session_key: "));
+       dump_data(5, session_key, 16);
+
+       DEBUG(5,("      stored_cred: "));
+       dump_data(5, stored_cred->data, 8);
+
+       DEBUG(5,("      timecred: "));
+       dump_data(5, timecred, 8);
+
+       DEBUG(5,("      cred: "));
+       dump_data(5, cred->data, 8);
 }
 
 
@@ -106,6 +126,15 @@ int cred_assert(DOM_CHAL *cred, char *session_key, DOM_CHAL *stored_cred,
 
        cred_create(session_key, stored_cred, timestamp, &cred2);
 
+       /* debug output*/
+       DEBUG(4,("cred_assert\n"));
+
+       DEBUG(5,("      challenge: "));
+       dump_data(5, cred->data, 16);
+
+       DEBUG(5,("      calculated: "));
+       dump_data(5, cred2.data, 8);
+
        return memcmp(cred->data, cred2.data, 8) == 0;
 }
 
index 772e49f41d174e14ba34315dbc2fb64adbc68e63..59592a04ae3d264bb77c7798264f80411018da17 100644 (file)
@@ -1164,6 +1164,8 @@ static BOOL update_dcinfo(int cnum, uint16 vuid,
        if (smb_pass != NULL)
        {
                memcpy(dc->md4pw, smb_pass->smb_nt_passwd, sizeof(dc->md4pw));
+               DEBUG(5,("dc->md4pw(%d) :", sizeof(dc->md4pw)));
+               dump_data(5, dc->md4pw, 16);
        }
        else
        {
@@ -1218,6 +1220,8 @@ static void api_lsa_req_chal( int cnum, uint16 vuid,
 
        update_dcinfo(cnum, vuid, &(vuser->dc), &(q_r.clnt_chal), mach_acct);
 
+       DEBUG(6,("api_lsa_req_chal: %d\n", __LINE__));
+
        /* construct reply.  return status is always 0x0 */
        *rdata_len = lsa_reply_req_chal(&q_r, *rdata + 0x18, *rdata,
                                        &(vuser->dc.srv_chal));