mirror of
https://github.com/samba-team/samba.git
synced 2025-12-02 00:23:50 +03:00
Merge SMB signing, cli buffer clobber and NTLMSSP signing tweaks from HEAD.
This commit is contained in:
@@ -118,7 +118,10 @@ BOOL cli_receive_smb(struct cli_state *cli)
|
||||
}
|
||||
|
||||
if (!cli_check_sign_mac(cli)) {
|
||||
DEBUG(0, ("SMB Signiture verification failed on incoming packet!\n"));
|
||||
DEBUG(0, ("SMB Signature verification failed on incoming packet!\n"));
|
||||
cli->smb_rw_error = READ_BAD_SIG;
|
||||
close(cli->fd);
|
||||
cli->fd = -1;
|
||||
return False;
|
||||
};
|
||||
return True;
|
||||
@@ -259,9 +262,6 @@ struct cli_state *cli_initialise(struct cli_state *cli)
|
||||
if (getenv("CLI_FORCE_DOSERR"))
|
||||
cli->force_dos_errors = True;
|
||||
|
||||
/* initialise signing */
|
||||
cli_null_set_signing(cli);
|
||||
|
||||
if (lp_client_signing())
|
||||
cli->sign_info.allow_smb_signing = True;
|
||||
|
||||
@@ -274,6 +274,13 @@ struct cli_state *cli_initialise(struct cli_state *cli)
|
||||
memset(cli->outbuf, 0, cli->bufsize);
|
||||
memset(cli->inbuf, 0, cli->bufsize);
|
||||
|
||||
/* just becouse we over-allocate, doesn't mean it's right to use it */
|
||||
clobber_region(FUNCTION_MACRO, __LINE__, cli->outbuf+cli->bufsize, SAFETY_MARGIN);
|
||||
clobber_region(FUNCTION_MACRO, __LINE__, cli->inbuf+cli->bufsize, SAFETY_MARGIN);
|
||||
|
||||
/* initialise signing */
|
||||
cli_null_set_signing(cli);
|
||||
|
||||
cli->nt_pipe_fnum = 0;
|
||||
cli->saved_netlogon_pipe_fnum = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user