static bool valid_smb_header(struct smbd_server_connection *sconn,
const uint8_t *inbuf)
{
- if (is_encrypted_packet(inbuf)) {
+ if (is_encrypted_packet(sconn, inbuf)) {
return true;
}
/*
return status;
}
- if (is_encrypted_packet((uint8_t *)*buffer)) {
+ if (is_encrypted_packet(sconn, (uint8_t *)*buffer)) {
status = srv_decrypt_buffer(*buffer);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("receive_smb_talloc: SMB decryption failed on "
/* The following definitions come from smbd/seal.c */
-bool is_encrypted_packet(const uint8_t *inbuf);
+bool is_encrypted_packet(struct smbd_server_connection *sconn,
+ const uint8_t *inbuf);
void srv_free_enc_buffer(char *buf);
NTSTATUS srv_decrypt_buffer(char *buf);
NTSTATUS srv_encrypt_buffer(char *buf, char **buf_out);
START_PROFILE(SMBreadbraw);
if (srv_is_signing_active(sconn) ||
- is_encrypted_packet(req->inbuf)) {
+ is_encrypted_packet(sconn, req->inbuf)) {
exit_server_cleanly("reply_readbraw: SMB signing/sealing is active - "
"raw reads/writes are disallowed.");
}
*/
if (!req_is_in_chain(req) &&
- !is_encrypted_packet(req->inbuf) && (fsp->base_fsp == NULL) &&
+ !is_encrypted_packet(req->sconn, req->inbuf) &&
+ (fsp->base_fsp == NULL) &&
(fsp->wcp == NULL) &&
lp_use_sendfile(SNUM(conn), req->sconn->smb1.signing_state) ) {
uint8 headerbuf[smb_size + 12 * 2];
}
/* We currently don't do this on signed or sealed data. */
if (srv_is_signing_active(req->sconn) ||
- is_encrypted_packet(req->inbuf)) {
+ is_encrypted_packet(req->sconn, req->inbuf)) {
reply_nterror(req, NT_STATUS_NOT_SUPPORTED);
END_PROFILE(SMBreadX);
return;
unsigned int doff = 0;
size_t len = smb_len_large(inbuf);
- if (is_encrypted_packet(inbuf)) {
+ if (is_encrypted_packet(sconn, inbuf)) {
/* Can't do this on encrypted
* connections. */
return false;
Is this an incoming encrypted packet ?
******************************************************************************/
-bool is_encrypted_packet(const uint8_t *inbuf)
+bool is_encrypted_packet(struct smbd_server_connection *sconn,
+ const uint8_t *inbuf)
{
NTSTATUS status;
uint16_t enc_num;