svn commit: samba r1768 - branches/SAMBA_4_0/source/libcli/raw

abartlet at samba.org abartlet at samba.org
Thu Aug 12 07:26:42 GMT 2004


Author: abartlet
Date: 2004-08-12 07:26:42 +0000 (Thu, 12 Aug 2004)
New Revision: 1768
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=1768&nolog=1
Log:
Add some debugs to assist in SMB signing debugging.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/libcli/raw/smb_signing.c

Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/smb_signing.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/smb_signing.c	2004-08-12 07:25:11 UTC (rev 1767)
+++ branches/SAMBA_4_0/source/libcli/raw/smb_signing.c	2004-08-12 07:26:42 UTC (rev 1768)
@@ -30,14 +30,17 @@
 {
 	if (!(transport->negotiate.sec_mode & 
 	      (NEGOTIATE_SECURITY_SIGNATURES_REQUIRED|NEGOTIATE_SECURITY_SIGNATURES_ENABLED))) {
+		DEBUG(5, ("SMB Signing is not negotiated by the peer\n"));
 		return False;
 	}
 
 	if (transport->negotiate.sign_info.doing_signing) {
+		DEBUG(5, ("SMB Signing already in progress, so we don't start it again\n"));
 		return False;
 	}
 
 	if (!transport->negotiate.sign_info.allow_smb_signing) {
+		DEBUG(5, ("SMB Signing has been locally disabled\n"));
 		return False;
 	}
 
@@ -61,9 +64,11 @@
 {
 	if (good) {
 		if (!sign_info->doing_signing) {
+			DEBUG(5, ("Seen valid packet, so turning signing on\n"));
 			sign_info->doing_signing = True;
 		}
 		if (!sign_info->seen_valid) {
+			DEBUG(5, ("Seen valid packet, so marking signing as 'seen valid'\n"));
 			sign_info->seen_valid = True;
 		}
 	} else {
@@ -130,6 +135,11 @@
 		return False;
 	}
 
+	if (!mac_key->length) {
+		/* NO key yet */
+		return False;
+	}
+
 	/* its quite bogus to be guessing sequence numbers, but very useful
 	   when debugging signing implementations */
 	for (i = 0-sign_range; i <= 0+sign_range; i++) {
@@ -229,6 +239,7 @@
 */
 static BOOL smbcli_set_signing_off(struct smb_signing_context *sign_info)
 {
+	DEBUG(5, ("Shutdown SMB signing\n"));
 	sign_info->doing_signing = False;
 	data_blob_free(&sign_info->mac_key);
 	sign_info->signing_state = SMB_SIGNING_ENGINE_OFF;
@@ -244,6 +255,7 @@
 	if (!set_smb_signing_common(transport)) {
 		return False;
 	}
+	DEBUG(5, ("BSRSPYL SMB signing enabled\n"));
 	smbcli_set_signing_off(&transport->negotiate.sign_info);
 
 	transport->negotiate.sign_info.mac_key = data_blob(NULL, 0);



More information about the samba-cvs mailing list