BUFFER_SIZE+SAFETY_MARGIN.
The timeout is in milliseconds.
This function will return on receipt of a session keepalive packet.
+ Doesn't check the MAC on signed packets.
****************************************************************************/
-BOOL receive_smb(int fd,char *buffer, unsigned int timeout)
+BOOL receive_smb_raw(int fd,char *buffer, unsigned int timeout)
{
ssize_t len,ret;
len = read_smb_length_return_keepalive(fd,buffer,timeout);
if (len < 0) {
- DEBUG(10,("receive_smb: length < 0!\n"));
+ DEBUG(10,("receive_smb_raw: length < 0!\n"));
/*
* Correct fix. smb_read_error may have already been
}
}
+ return True;
+}
+
+/****************************************************************************
+ Wrapper for receive_smb_raw().
+ Checks the MAC on signed packets.
+****************************************************************************/
+
+BOOL receive_smb(int fd,char *buffer, unsigned int timeout)
+{
+ if (!receive_smb_raw(fd, buffer, timeout)) {
+ return False;
+ }
+
/* Check the incoming SMB signature. */
if (!srv_check_sign_mac(buffer)) {
DEBUG(0, ("receive_smb: SMB Signature verification failed on incoming packet!\n"));
BOOL ret;
for(;;) {
- ret = receive_smb(fd, buffer, timeout);
+ ret = receive_smb_raw(fd, buffer, timeout);
if (!ret) {
DEBUG(10,("client_receive_smb failed\n"));
}
the_cli->protocol = PROTOCOL_NT1;
-
+ cli_setup_signing_state(the_cli, lp_client_signing());
+
if (!cli_negprot(the_cli)) {
DEBUG(0,("spoolss_connect_to_client: machine %s rejected the negotiate protocol. Error was : %s.\n", remote_machine, cli_errstr(the_cli) ));
cli_shutdown(the_cli);
blr->fsp->fnum, blr->fsp->fsp_name ));
/* Push the MID of this packet on the signing queue. */
- srv_defer_sign_response(SVAL(inbuf,smb_mid), True);
+ srv_defer_sign_response(SVAL(inbuf,smb_mid));
return True;
}