diff options
-rw-r--r-- | source3/include/byteorder.h | 14 | ||||
-rw-r--r-- | source3/libsmb/credentials.c | 43 | ||||
-rw-r--r-- | source3/smbd/pipes.c | 4 |
3 files changed, 47 insertions, 14 deletions
diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 808026f9db..a6f826b518 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -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))); diff --git a/source3/libsmb/credentials.c b/source3/libsmb/credentials.c index ce7159f7ff..3af182c5db 100644 --- a/source3/libsmb/credentials.c +++ b/source3/libsmb/credentials.c @@ -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; } diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c index 772e49f41d..59592a04ae 100644 --- a/source3/smbd/pipes.c +++ b/source3/smbd/pipes.c @@ -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)); |