From 245e3959de269110b837ff2ed2742b090a1566ae Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 12 Jun 2014 08:43:26 +0200 Subject: [PATCH] s3:smbd: pass smbXsrv_connection to smb1 encryption functions These parameters are not really used currently, but may be in future. Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke Reviewed-by: Michael Adam --- source3/smbd/process.c | 8 ++++---- source3/smbd/proto.h | 8 ++++---- source3/smbd/seal.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 0f03d88e764..780a67aee59 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -240,7 +240,7 @@ bool srv_send_smb(struct smbd_server_connection *sconn, char *buffer, } if (do_encrypt) { - NTSTATUS status = srv_encrypt_buffer(sconn, buffer, &buf_out); + NTSTATUS status = srv_encrypt_buffer(xconn, buffer, &buf_out); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("send_smb: SMB encryption failed " "on outgoing packet! Error %s\n", @@ -265,12 +265,12 @@ bool srv_send_smb(struct smbd_server_connection *sconn, char *buffer, (int)ret, strerror(saved_errno))); errno = saved_errno; - srv_free_enc_buffer(sconn, buf_out); + srv_free_enc_buffer(xconn, buf_out); goto out; } SMB_PERFCOUNT_SET_MSGLEN_OUT(pcd, len); - srv_free_enc_buffer(sconn, buf_out); + srv_free_enc_buffer(xconn, buf_out); out: SMB_PERFCOUNT_END(pcd); @@ -565,7 +565,7 @@ static NTSTATUS receive_smb_talloc(TALLOC_CTX *mem_ctx, } if (is_encrypted_packet((uint8_t *)*buffer)) { - status = srv_decrypt_buffer(sconn, *buffer); + status = srv_decrypt_buffer(xconn, *buffer); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("receive_smb_talloc: SMB decryption failed on " "incoming packet! Error %s\n", diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 453d8291697..22cd921694b 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -930,9 +930,9 @@ void reply_getattrE(struct smb_request *req); /* The following definitions come from smbd/seal.c */ bool is_encrypted_packet(const uint8_t *inbuf); -void srv_free_enc_buffer(struct smbd_server_connection *sconn, char *buf); -NTSTATUS srv_decrypt_buffer(struct smbd_server_connection *sconn, char *buf); -NTSTATUS srv_encrypt_buffer(struct smbd_server_connection *sconn, char *buf, +void srv_free_enc_buffer(struct smbXsrv_connection *xconn, char *buf); +NTSTATUS srv_decrypt_buffer(struct smbXsrv_connection *xconn, char *buf); +NTSTATUS srv_encrypt_buffer(struct smbXsrv_connection *xconn, char *buf, char **buf_out); NTSTATUS srv_request_encryption_setup(connection_struct *conn, unsigned char **ppdata, @@ -940,7 +940,7 @@ NTSTATUS srv_request_encryption_setup(connection_struct *conn, unsigned char **pparam, size_t *p_param_size); NTSTATUS srv_encryption_start(connection_struct *conn); -void server_encryption_shutdown(struct smbd_server_connection *sconn); +void server_encryption_shutdown(struct smbXsrv_connection *xconn); /* The following definitions come from smbd/sec_ctx.c */ diff --git a/source3/smbd/seal.c b/source3/smbd/seal.c index 7ab992ea7b1..e088d749d46 100644 --- a/source3/smbd/seal.c +++ b/source3/smbd/seal.c @@ -134,7 +134,7 @@ static NTSTATUS make_srv_encryption_context(const struct tsocket_address *remote Free an encryption-allocated buffer. ******************************************************************************/ -void srv_free_enc_buffer(struct smbd_server_connection *sconn, char *buf) +void srv_free_enc_buffer(struct smbXsrv_connection *xconn, char *buf) { /* We know this is an smb buffer, and we * didn't malloc, only copy, for a keepalive, @@ -153,7 +153,7 @@ void srv_free_enc_buffer(struct smbd_server_connection *sconn, char *buf) Decrypt an incoming buffer. ******************************************************************************/ -NTSTATUS srv_decrypt_buffer(struct smbd_server_connection *sconn, char *buf) +NTSTATUS srv_decrypt_buffer(struct smbXsrv_connection *xconn, char *buf) { /* Ignore non-session messages. */ if(CVAL(buf,0)) { @@ -171,7 +171,7 @@ NTSTATUS srv_decrypt_buffer(struct smbd_server_connection *sconn, char *buf) Encrypt an outgoing buffer. Return the encrypted pointer in buf_out. ******************************************************************************/ -NTSTATUS srv_encrypt_buffer(struct smbd_server_connection *sconn, char *buf, +NTSTATUS srv_encrypt_buffer(struct smbXsrv_connection *xconn, char *buf, char **buf_out) { *buf_out = buf; @@ -302,7 +302,7 @@ NTSTATUS srv_encryption_start(connection_struct *conn) Shutdown all server contexts. ******************************************************************************/ -void server_encryption_shutdown(struct smbd_server_connection *sconn) +void server_encryption_shutdown(struct smbXsrv_connection *xconn) { TALLOC_FREE(partial_srv_trans_enc_ctx); TALLOC_FREE(srv_trans_enc_ctx); -- 2.11.4.GIT