mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
libcli/smb: add smb2cli_tcon_{should_sign,is_signing_on}()
This can be used to force signing for individual requests. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
e954f9290c
commit
8c846f78ed
@ -186,6 +186,7 @@ struct smbXcli_tcon {
|
||||
uint32_t flags;
|
||||
uint32_t capabilities;
|
||||
uint32_t maximal_access;
|
||||
bool should_sign;
|
||||
bool should_encrypt;
|
||||
} smb2;
|
||||
};
|
||||
@ -2694,6 +2695,9 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
|
||||
if (tcon) {
|
||||
tid = tcon->smb2.tcon_id;
|
||||
|
||||
if (tcon->smb2.should_sign) {
|
||||
state->smb2.should_sign = true;
|
||||
}
|
||||
if (tcon->smb2.should_encrypt) {
|
||||
state->smb2.should_encrypt = true;
|
||||
}
|
||||
@ -5214,12 +5218,14 @@ void smb2cli_tcon_set_values(struct smbXcli_tcon *tcon,
|
||||
tcon->smb2.capabilities = capabilities;
|
||||
tcon->smb2.maximal_access = maximal_access;
|
||||
|
||||
tcon->smb2.should_sign = false;
|
||||
tcon->smb2.should_encrypt = false;
|
||||
|
||||
if (session == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
tcon->smb2.should_sign = session->smb2->should_sign;
|
||||
tcon->smb2.should_encrypt = session->smb2->should_encrypt;
|
||||
|
||||
if (flags & SMB2_SHAREFLAG_ENCRYPT_DATA) {
|
||||
@ -5227,6 +5233,21 @@ void smb2cli_tcon_set_values(struct smbXcli_tcon *tcon,
|
||||
}
|
||||
}
|
||||
|
||||
void smb2cli_tcon_should_sign(struct smbXcli_tcon *tcon,
|
||||
bool should_sign)
|
||||
{
|
||||
tcon->smb2.should_sign = should_sign;
|
||||
}
|
||||
|
||||
bool smb2cli_tcon_is_signing_on(struct smbXcli_tcon *tcon)
|
||||
{
|
||||
if (tcon->smb2.should_encrypt) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return tcon->smb2.should_sign;
|
||||
}
|
||||
|
||||
void smb2cli_tcon_should_encrypt(struct smbXcli_tcon *tcon,
|
||||
bool should_encrypt)
|
||||
{
|
||||
|
@ -420,6 +420,9 @@ void smb2cli_tcon_set_values(struct smbXcli_tcon *tcon,
|
||||
uint32_t flags,
|
||||
uint32_t capabilities,
|
||||
uint32_t maximal_access);
|
||||
void smb2cli_tcon_should_sign(struct smbXcli_tcon *tcon,
|
||||
bool should_sign);
|
||||
bool smb2cli_tcon_is_signing_on(struct smbXcli_tcon *tcon);
|
||||
void smb2cli_tcon_should_encrypt(struct smbXcli_tcon *tcon,
|
||||
bool should_encrypt);
|
||||
bool smb2cli_tcon_is_encryption_on(struct smbXcli_tcon *tcon);
|
||||
|
Loading…
Reference in New Issue
Block a user