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

implement server side, netprot works basically #365

Merged
merged 30 commits into from
Sep 24, 2024

Conversation

bdodge
Copy link
Contributor

@bdodge bdodge commented Sep 12, 2024

This is a prototype implementation of serving SMB

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@sahlberg
Copy link
Owner

Nice.
I activated a build for this but some targets fail.
You can ignore the consoles that fail, I will fix that up, but can you take a look at the failed windows build and once that works I will merge this.

@sahlberg
Copy link
Owner

Ah, it is this structure. struct validate_neg_info {
Not sure if all platforms support the packed attribute.

You shouldn't assign straight into this structure since that breaks big-endian systems.
Assing using the htole*() calls instead.

@sahlberg sahlberg merged commit 5e2b4a5 into sahlberg:master Sep 24, 2024
1 of 2 checks passed
@sahlberg
Copy link
Owner

Merged, thanks. I will sort out the windows/cmake issues and later will fix the game console builds.

This is great. I will find time and build it as a smb2 server for ps2.

@bdodge
Copy link
Contributor Author

bdodge commented Sep 24, 2024 via email

@sahlberg
Copy link
Owner

sahlberg commented Sep 24, 2024 via email

@sahlberg
Copy link
Owner

sahlberg commented Sep 24, 2024

"Any hints on getting smb311 working would be great. i am not clear at all
if the signing key is being created properly (I just used the same code
you do for the client side) which works for 2.1 at least."

In addition to using wireshark to make sure you compute the preauth hash correctly for each packet
there is also ways to verify you generate the session key correctly.

The linux kernel cifs client can dump the session keys (so that you can paste them into wireshark to decrypt the stream).
You need to build the kernel module CONFIG_CIFS_DEBUG_DUMP_KEYS=y
and then once a client connect it will write the keys for that connection into dmesg.

That way you can compare the key you generate server-side with the corresponding key that linux cifs client generates clientside.

See here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/smb/client/smb2transport.c?h=v6.11#n479
You get all the keys client-side so you can compare to the keys you generate and see which ones differ.

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.

2 participants