s3:smbd: pass smbXsrv_connection to smb1 encryption functions
authorStefan Metzmacher <metze@samba.org>
Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 6 Aug 2014 07:51:14 +0000 (09:51 +0200)
These parameters are not really used currently, but may be in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/process.c
source3/smbd/proto.h
source3/smbd/seal.c

index 0f03d88e76479b217b42e607e9f7432e386ce77f..780a67aee596c313689a7beaa338ec87e8cfe103 100644 (file)
@@ -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",
index 453d82916974a4967c9c8794601316f1f9428048..22cd921694b01b5a800ed88a4015acdac03faf3e 100644 (file)
@@ -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  */
 
index 7ab992ea7b148943b1e468936b0c9ffa1f271bd2..e088d749d4634ba735473b23dcd4f41e85b7a725 100644 (file)
@@ -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);