Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SMB2 compoud response signing #1834

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jborean93
Copy link

@jborean93 jborean93 commented Oct 11, 2024

Fix the signing the logic when responding with an SMB2 compount response. The signature will include the padding of each compound element and include the next offset value before signing the data.

The current logic was adding the signature but before it set the NextCommand entry and it did not include any of the padding added between each compound entry. By delaying the signing until after the compound entries are build we can ensure that the signatures are generated correctly so the client can verify them.

The padding data must be included in the signature as per MS-SMB2 https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/a3e9ea1e-53c8-4cff-94bd-d98fb20417c0

If the message is part of a compounded chain, any padding at the end of the message MUST be used in the hash computation

Fix the signing the logic when responding with an SMB2 compount
response. The signature will include the padding of each compound
element and include the next offset value before signing the data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant