summaryrefslogtreecommitdiff
path: root/source3/lib/util_sock.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-03-19 20:39:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:42 -0500
commitc48b610b516b72edd6232235a6f83d388f5a0552 (patch)
tree8698a0d14ab7a1a54821d3aa7c316f4f0f10e733 /source3/lib/util_sock.c
parent1899c834f0261edaecc575b17d8aeb57b82717e2 (diff)
downloadsamba-c48b610b516b72edd6232235a6f83d388f5a0552.tar.gz
samba-c48b610b516b72edd6232235a6f83d388f5a0552.tar.bz2
samba-c48b610b516b72edd6232235a6f83d388f5a0552.zip
r21876: Start adding in the seal implementation - prototype code
for the server side enc. (doesn't break anything). I'll keep updating this until I've got NTLM seal working on both client and server, then add in the gss level seal. Jeremy. (This used to be commit 530ac29abf23e920baa549e7cec55199edd8bd74)
Diffstat (limited to 'source3/lib/util_sock.c')
-rw-r--r--source3/lib/util_sock.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 663502bef0..296405edd3 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -770,29 +770,32 @@ BOOL send_smb(int fd, char *buffer)
size_t len;
size_t nwritten=0;
ssize_t ret;
+ char *buf_out;
/* Sign the outgoing packet if required. */
srv_calculate_sign_mac(buffer);
- status = srv_encrypt_buffer(buffer);
+ 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;
}
- len = smb_len(buffer) + 4;
+ len = smb_len(buf_out) + 4;
while (nwritten < len) {
- ret = write_data(fd,buffer+nwritten,len - nwritten);
+ ret = write_data(fd,buf_out+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_buffer(buf_out);
return False;
}
nwritten += ret;
}
+ srv_free_buffer(buf_out);
return True;
}