summaryrefslogtreecommitdiff
path: root/source3/lib/util_sock.c
diff options
context:
space:
mode:
authorGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:34:30 -0500
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:34:30 -0500
commite5a951325a6cac8567af3a66de6d2df577508ae4 (patch)
tree34da9fe59f3c2d7f8edb072144443a9704197831 /source3/lib/util_sock.c
parent57482469b32645250e92a7ffd003aeeb4a42235e (diff)
downloadsamba-e5a951325a6cac8567af3a66de6d2df577508ae4.tar.gz
samba-e5a951325a6cac8567af3a66de6d2df577508ae4.tar.bz2
samba-e5a951325a6cac8567af3a66de6d2df577508ae4.zip
[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
Diffstat (limited to 'source3/lib/util_sock.c')
-rw-r--r--source3/lib/util_sock.c45
1 files changed, 3 insertions, 42 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index d061d73a81..1508ddfce3 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -815,19 +815,6 @@ BOOL receive_smb(int fd, char *buffer, unsigned int timeout)
return False;
}
- if (srv_encryption_on()) {
- NTSTATUS status = srv_decrypt_buffer(buffer);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("receive_smb: SMB decryption failed "
- "on incoming packet! Error %s\n",
- nt_errstr(status) ));
- if (smb_read_error == 0) {
- smb_read_error = READ_BAD_DECRYPT;
- }
- return False;
- }
- }
-
/* Check the incoming SMB signature. */
if (!srv_check_sign_mac(buffer, True)) {
DEBUG(0, ("receive_smb: SMB Signature verification "
@@ -852,19 +839,6 @@ ssize_t receive_smb_talloc(TALLOC_CTX *mem_ctx, int fd, char **buffer,
return -1;
}
- if (srv_encryption_on()) {
- NTSTATUS status = srv_decrypt_buffer(*buffer);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("receive_smb: SMB decryption failed on "
- "incoming packet! Error %s\n",
- nt_errstr(status) ));
- if (smb_read_error == 0) {
- smb_read_error = READ_BAD_DECRYPT;
- }
- return -1;
- }
- }
-
/* Check the incoming SMB signature. */
if (!srv_check_sign_mac(*buffer, True)) {
DEBUG(0, ("receive_smb: SMB Signature verification failed on "
@@ -887,35 +861,22 @@ BOOL send_smb(int fd, char *buffer)
size_t len;
size_t nwritten=0;
ssize_t ret;
- char *buf_out = buffer;
/* Sign the outgoing packet if required. */
- 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",
- nt_errstr(status) ));
- return False;
- }
- }
+ srv_calculate_sign_mac(buffer);
- len = smb_len(buf_out) + 4;
+ len = smb_len(buffer) + 4;
while (nwritten < len) {
- ret = write_data(fd,buf_out+nwritten,len - nwritten);
+ ret = write_data(fd,buffer+nwritten,len - nwritten);
if (ret <= 0) {
DEBUG(0,("Error writing %d bytes to client. %d. (%s)\n",
(int)len,(int)ret, strerror(errno) ));
- srv_free_enc_buffer(buf_out);
return False;
}
nwritten += ret;
}
- srv_free_enc_buffer(buf_out);
return True;
}