[Ask for help] Traffic encryption with Samba client library

陳冠宇 kevinx6000 at gmail.com
Wed Jan 11 02:00:08 UTC 2017


Hello everyone,

I am working with samba client library currently.
However I encountered some problems.
It will be great if you can help me out :D

I leverage the library of *samba/source3* to realize client side of samba
communications on Linux. Everything works well.
(I share folders on Windows10, which acts as samba server.)
Github: https://github.com/samba-team/samba/tree/master/source3

Recently, I want to encrypt samba traffic,
and I found out that there's a function named:
*smbc_setOptionSmbEncryptionLevel()*
(On line 247 of libsmb/libsmb_setget.c
Github:
https://github.com/samba-team/samba/blob/master/source3/libsmb/libsmb_setget.c
)

Further, there are three levels: NONE, REQUEST, and REQUIRE.
(On line 171 of include/libsmbclient.h
Github:
https://github.com/samba-team/samba/blob/master/source3/include/libsmbclient.h
)

If I use NONE or REQUEST, everything works just as before,
and all traffic goes without encryption.
However, if I use REQUIRE, I cannot connect to samba server.

To figure out where the problem may come from,
I tried to connect to server from linux to windows10 by using terminal
prompt:
*$ smbclient '//{IP address}/{folder name}' -U {account} -e*
Connection just works fine and all traffic are encrypted.
(Shown as "Encrypted SMB3" in packet info using Wireshark)

>From these aspects, I wonder if I misunderstand something about
setting encryption using samba client library.
However, I cannot find documentations about how I can encrypt
samba traffic using samba client library.

Should I do something, such as exchanging key / signing,
before I make *smbc_setOptionSmbEncryptionLevel()* function call?
Could you please help me find out how to fix it right?
Thank you!

Best,
Kevin


More information about the samba-technical mailing list