summaryrefslogtreecommitdiff
path: root/source3/lib/util_sock.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-03-27 18:04:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:57 -0500
commit34dac35e48ca0c03d2744d9925566665285eb973 (patch)
tree3c2f13d88a36242f6c5e0dea5d831e5f2509578a /source3/lib/util_sock.c
parent110980d7715769e88411fcb28f401bdb28389781 (diff)
downloadsamba-34dac35e48ca0c03d2744d9925566665285eb973.tar.gz
samba-34dac35e48ca0c03d2744d9925566665285eb973.tar.bz2
samba-34dac35e48ca0c03d2744d9925566665285eb973.zip
r21990: Stop messing with the signing engine just because
we're encrypted. This will make further changes and spec much more clear. Jeremy. (This used to be commit ffa3a5c508a494d22e8ee3ada424a6517ddf8923)
Diffstat (limited to 'source3/lib/util_sock.c')
-rw-r--r--source3/lib/util_sock.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index a58fb03e77..2ddce70fbb 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -746,15 +746,15 @@ BOOL receive_smb(int fd, char *buffer, unsigned int timeout)
}
return False;
}
- } else {
- /* Check the incoming SMB signature. */
- if (!srv_check_sign_mac(buffer, True)) {
- DEBUG(0, ("receive_smb: SMB Signature verification failed on incoming packet!\n"));
- if (smb_read_error == 0) {
- smb_read_error = READ_BAD_SIG;
- }
- return False;
+ }
+
+ /* Check the incoming SMB signature. */
+ if (!srv_check_sign_mac(buffer, True)) {
+ DEBUG(0, ("receive_smb: SMB Signature verification failed on incoming packet!\n"));
+ if (smb_read_error == 0) {
+ smb_read_error = READ_BAD_SIG;
}
+ return False;
}
return True;
@@ -772,9 +772,9 @@ BOOL send_smb(int fd, char *buffer)
char *buf_out = buffer;
/* Sign the outgoing packet if required. */
- if (!srv_encryption_on()) {
- srv_calculate_sign_mac(buf_out);
- } else {
+ srv_calculate_sign_mac(buf_out);
+
+ if (srv_encryption_on()) {
NTSTATUS status = srv_encrypt_buffer(buffer, &buf_out);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("send_smb: SMB encryption failed on outgoing packet! Error %s\n",