mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3:smb2_server: convert signing_required bool to flags bitmap
Use a flags bitmap for storing the signing state. This is in preparation of a subsequent patch that adds more flags to the bitmap. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
780743d1b2
commit
fe5353c82e
@ -123,6 +123,10 @@ interface smbXsrv
|
||||
SMBXSRV_PROCESSED_UNENCRYPTED_PACKET = 0x08
|
||||
} smbXsrv_encrpytion_flags;
|
||||
|
||||
typedef [public,bitmap8bit] bitmap {
|
||||
SMBXSRV_SIGNING_REQUIRED = 0x01
|
||||
} smbXsrv_signing_flags;
|
||||
|
||||
typedef struct {
|
||||
server_id server_id;
|
||||
[charset(UTF8),string] char local_address[];
|
||||
@ -148,7 +152,7 @@ interface smbXsrv
|
||||
uint32 auth_session_info_seqnum;
|
||||
auth_session_info *auth_session_info;
|
||||
uint16 connection_dialect;
|
||||
boolean8 signing_required;
|
||||
smbXsrv_signing_flags signing_flags;
|
||||
smbXsrv_encrpytion_flags encryption_flags;
|
||||
[noprint] DATA_BLOB signing_key;
|
||||
[noprint] DATA_BLOB encryption_key;
|
||||
|
@ -2125,7 +2125,7 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
|
||||
session_status = smbd_smb2_request_check_session(req);
|
||||
x = req->session;
|
||||
if (x != NULL) {
|
||||
signing_required = x->global->signing_required;
|
||||
signing_required = x->global->signing_flags & SMBXSRV_SIGNING_REQUIRED;
|
||||
encryption_desired = x->global->encryption_flags & SMBXSRV_ENCRYPTION_DESIRED;
|
||||
encryption_required = x->global->encryption_flags & SMBXSRV_ENCRYPTION_REQUIRED;
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
|
||||
|
||||
if ((in_security_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) ||
|
||||
lp_server_signing() == SMB_SIGNING_REQUIRED) {
|
||||
x->global->signing_required = true;
|
||||
x->global->signing_flags = SMBXSRV_SIGNING_REQUIRED;
|
||||
}
|
||||
|
||||
if ((lp_smb_encrypt(-1) >= SMB_SIGNING_DESIRED) &&
|
||||
@ -281,7 +281,7 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
|
||||
*out_session_flags |= SMB2_SESSION_FLAG_IS_GUEST;
|
||||
*out_session_flags |= SMB2_SESSION_FLAG_IS_NULL;
|
||||
/* force no signing */
|
||||
x->global->signing_required = false;
|
||||
x->global->signing_flags &= ~SMBXSRV_SIGNING_REQUIRED;
|
||||
guest = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user