summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-01-14 15:30:34 +1100
committerStefan Metzmacher <metze@samba.org>2012-01-31 20:17:10 +0100
commit5ad7665b6377768d3710b00b25aeb530131924cc (patch)
tree919dd4b84e1772ab8e77a222e29d4948c1cb85e2 /libcli
parentfce53e0e794f38782092be3433608772f5be7f2b (diff)
downloadsamba-5ad7665b6377768d3710b00b25aeb530131924cc.tar.gz
samba-5ad7665b6377768d3710b00b25aeb530131924cc.tar.bz2
samba-5ad7665b6377768d3710b00b25aeb530131924cc.zip
libcli/smb: Convert struct smb_trans_enc_state to talloc
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/smb/smbXcli_base.c4
-rw-r--r--libcli/smb/smb_seal.c19
-rw-r--r--libcli/smb/smb_seal.h1
3 files changed, 2 insertions, 22 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 06fcb34a31..df0145718e 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -214,7 +214,7 @@ static int smbXcli_conn_destructor(struct smbXcli_conn *conn)
}
if (conn->smb1.trans_enc) {
- common_free_encryption_state(&conn->smb1.trans_enc);
+ TALLOC_FREE(conn->smb1.trans_enc);
}
return 0;
@@ -596,7 +596,7 @@ void smb1cli_conn_set_encryption(struct smbXcli_conn *conn,
{
/* Replace the old state, if any. */
if (conn->smb1.trans_enc) {
- common_free_encryption_state(&conn->smb1.trans_enc);
+ TALLOC_FREE(conn->smb1.trans_enc);
}
conn->smb1.trans_enc = es;
}
diff --git a/libcli/smb/smb_seal.c b/libcli/smb/smb_seal.c
index a56dc6092e..d5bb2388bb 100644
--- a/libcli/smb/smb_seal.c
+++ b/libcli/smb/smb_seal.c
@@ -200,25 +200,6 @@ NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf)
}
/******************************************************************************
- Shutdown an encryption state.
-******************************************************************************/
-
-void common_free_encryption_state(struct smb_trans_enc_state **pp_es)
-{
- struct smb_trans_enc_state *es = *pp_es;
-
- if (es == NULL) {
- return;
- }
-
- if (es->gensec_security) {
- TALLOC_FREE(es->gensec_security);
- }
- SAFE_FREE(es);
- *pp_es = NULL;
-}
-
-/******************************************************************************
Free an encryption-allocated buffer.
******************************************************************************/
diff --git a/libcli/smb/smb_seal.h b/libcli/smb/smb_seal.h
index 01a61e8586..f47f904528 100644
--- a/libcli/smb/smb_seal.h
+++ b/libcli/smb/smb_seal.h
@@ -32,7 +32,6 @@ NTSTATUS get_enc_ctx_num(const uint8_t *buf, uint16_t *p_enc_ctx_num);
bool common_encryption_on(struct smb_trans_enc_state *es);
NTSTATUS common_encrypt_buffer(struct smb_trans_enc_state *es, char *buffer, char **buf_out);
NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf);
-void common_free_encryption_state(struct smb_trans_enc_state **pp_es);
void common_free_enc_buffer(struct smb_trans_enc_state *es, char *buf);
#endif /* _HEADER_SMB_CRYPT_H */