MaterialFiles icon indicating copy to clipboard operation
MaterialFiles copied to clipboard

Feat: enable encryption support for SMB

Open brunnre8 opened this issue 1 year ago • 5 comments

(Before we go on, yes I've read your PR template, yes I'm aware that you don't accept contributions 1:1. The PR is trivial however, consider this to be in the public domain. Mostly just want to get the ball rolling into the right direction)

I have a few shares on the same samba host (linux box) that has for some of those shares enforced encryption

[home]
smb encrypt = required
# ... more stuff

[media]
smb encrypt = desired
# more stuff

The smb library you are using by default doesn't negotiate encryption support, if you connect to the host, leading to EPERM when the home share gets accessed as an example, while the media share is still accessible.

In order that the encryption support is actually enabled by the lib, you need to do so with the config builder. Not sure if you want to unconditionally do so or if this needs to be some sort of frontend setting, but as you anyway want to do the coding on your own I didn't bother trying to do so.

brunnre8 avatar Jul 09 '24 20:07 brunnre8

Looking at the various performance issues on the lib, you probably want to add the encryption toggle over my bare bones one :wink:

brunnre8 avatar Jul 09 '24 20:07 brunnre8

Yes, I believe this will need a toggle, so this will be more like a feature request.

Despite that I'm grateful the author created and open sourced SMBJ, I also really hope we can have a better SMB library which simply does the encryption negotiation (and has less bugs - I often see crash reports due to this library).

zhanghai avatar Oct 05 '24 18:10 zhanghai

Hi, any ETA in sight for this feature? This would probably be useful for a lot of people, as you seemingly would have the only FOSS android files app that supports encrypted SMB shares. In any case, thanks for this amazing piece of software!

pinzutu avatar Feb 25 '25 17:02 pinzutu

I'm sorry I coded this from knowledge and the snipit provided by the person asking for help

Nick Rodriguez

On Sat, Oct 5, 2024, 2:19 PM Hai Zhang @.***> wrote:

Yes, I believe this will need a toggle. Despite that I'm grateful the author created and open sourced SMBJ, I also really hope we can have a better SMB library which simply does the encryption negotiation (and has less bugs - I often see crash reports due to this library).

— Reply to this email directly, view it on GitHub https://github.com/zhanghai/MaterialFiles/pull/1271#issuecomment-2395139796, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIYNKVBLLSCGDPLJI6KGJDTZ2AUR3AVCNFSM6AAAAABKTS2SNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJVGEZTSNZZGY . You are receiving this because you commented.Message ID: @.***>

Nickrodz0503 avatar Mar 02 '25 04:03 Nickrodz0503