1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

debug info added

This commit is contained in:
Luke Leighton
-
parent 69fad04198
commit a3f96555b4
3 changed files with 47 additions and 14 deletions

View 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) \ #define DBG_RW_PCVAL(string,depth,base,read,inbuf,outbuf,len) \
RW_PCVAL(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)); \ 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")); DEBUG(5,("\n"));
#define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \ #define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \
RW_PSVAL(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)); \ 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")); DEBUG(5,("\n"));
#define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \
RW_CVAL(read,inbuf,outbuf,0) \ 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))); tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf)));
#define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \ #define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \
RW_SVAL(read,inbuf,outbuf,0) \ 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))); tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf)));
#define DBG_RW_IVAL(string,depth,base,read,inbuf,outbuf) \ #define DBG_RW_IVAL(string,depth,base,read,inbuf,outbuf) \
RW_IVAL(read,inbuf,outbuf,0) \ 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))); tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf)));

View File

@ -37,13 +37,6 @@ void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass,
char sum2[8]; char sum2[8];
char buf[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[0] = IVAL(clnt_chal->data, 0) + IVAL(srv_chal->data, 0);
sum[1] = IVAL(clnt_chal->data, 4) + IVAL(srv_chal->data, 4); 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 , sum2, buf);
smbhash(pass+9, buf , session_key); 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: ")); DEBUG(5,(" session_key: "));
dump_data(5, session_key, 16); 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); memset(key2, 0, 7);
key2[0] = session_key[7]; key2[0] = session_key[7];
smbhash(key2, buf, cred->data); 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); 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; return memcmp(cred->data, cred2.data, 8) == 0;
} }

View File

@ -1164,6 +1164,8 @@ static BOOL update_dcinfo(int cnum, uint16 vuid,
if (smb_pass != NULL) if (smb_pass != NULL)
{ {
memcpy(dc->md4pw, smb_pass->smb_nt_passwd, sizeof(dc->md4pw)); 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 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); 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 */ /* construct reply. return status is always 0x0 */
*rdata_len = lsa_reply_req_chal(&q_r, *rdata + 0x18, *rdata, *rdata_len = lsa_reply_req_chal(&q_r, *rdata + 0x18, *rdata,
&(vuser->dc.srv_chal)); &(vuser->dc.srv_chal));