mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
CVE-2015-5296: libcli/smb: make sure we require signing when we demand encryption on a session
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11536 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
aef4113823
commit
bc2d8592f4
@ -5445,6 +5445,9 @@ uint8_t smb2cli_session_security_mode(struct smbXcli_session *session)
|
||||
if (conn->mandatory_signing) {
|
||||
security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
|
||||
}
|
||||
if (session->smb2->should_sign) {
|
||||
security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
|
||||
}
|
||||
|
||||
return security_mode;
|
||||
}
|
||||
@ -5876,6 +5879,14 @@ NTSTATUS smb2cli_session_set_channel_key(struct smbXcli_session *session,
|
||||
|
||||
NTSTATUS smb2cli_session_encryption_on(struct smbXcli_session *session)
|
||||
{
|
||||
if (!session->smb2->should_sign) {
|
||||
/*
|
||||
* We need required signing on the session
|
||||
* in order to prevent man in the middle attacks.
|
||||
*/
|
||||
return NT_STATUS_INVALID_PARAMETER_MIX;
|
||||
}
|
||||
|
||||
if (session->smb2->should_encrypt) {
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user