Skip to content

Commit

Permalink
ksmbd: set NTLMSSP_NEGOTIATE_SEAL flag to challenge blob
Browse files Browse the repository at this point in the history
If NTLMSSP_NEGOTIATE_SEAL flags is set in negotiate blob from client,
Set NTLMSSP_NEGOTIATE_SEAL flag to challenge blob.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
namjaejeon authored and Steve French committed Oct 5, 2022
1 parent af705ef commit 5bedae9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions fs/ksmbd/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ ksmbd_build_ntlmssp_challenge_blob(struct challenge_message *chgblob,
NTLMSSP_NEGOTIATE_56);
}

if (cflags & NTLMSSP_NEGOTIATE_SEAL && smb3_encryption_negotiated(conn))
flags |= NTLMSSP_NEGOTIATE_SEAL;

if (cflags & NTLMSSP_NEGOTIATE_ALWAYS_SIGN)
flags |= NTLMSSP_NEGOTIATE_ALWAYS_SIGN;

Expand Down
2 changes: 1 addition & 1 deletion fs/ksmbd/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ static void decode_encrypt_ctxt(struct ksmbd_conn *conn,
*
* Return: true if connection should be encrypted, else false
*/
static bool smb3_encryption_negotiated(struct ksmbd_conn *conn)
bool smb3_encryption_negotiated(struct ksmbd_conn *conn)
{
if (!conn->ops->generate_encryptionkey)
return false;
Expand Down
1 change: 1 addition & 0 deletions fs/ksmbd/smb2pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ int smb3_decrypt_req(struct ksmbd_work *work);
int smb3_encrypt_resp(struct ksmbd_work *work);
bool smb3_11_final_sess_setup_resp(struct ksmbd_work *work);
int smb2_set_rsp_credits(struct ksmbd_work *work);
bool smb3_encryption_negotiated(struct ksmbd_conn *conn);

/* smb2 misc functions */
int ksmbd_smb2_check_message(struct ksmbd_work *work);
Expand Down

0 comments on commit 5bedae9

Please sign in to comment.