Marvin Scholz [Thu, 17 Oct 2019 22:29:09 +0000 (00:29 +0200)]
Add windows build to CI
Ronnie Sahlberg [Thu, 17 Oct 2019 22:00:55 +0000 (08:00 +1000)]
Merge pull request #108 from ePirat/add-ci
Add GitHub Actions CI
Ronnie Sahlberg [Thu, 17 Oct 2019 21:55:43 +0000 (07:55 +1000)]
Merge pull request #107 from ePirat/fix-distcheck
Fix autotools distcheck
ePirat [Thu, 17 Oct 2019 14:10:33 +0000 (16:10 +0200)]
Add GitHub Actions CI
Marvin Scholz [Thu, 17 Oct 2019 16:03:50 +0000 (18:03 +0200)]
Remove check for popt and fix conditional directory
Using an automake conditional here allows automake to correctly
always add examples sources to the dist tarballs, even when disabled.
Fixes `make distcheck`
Marvin Scholz [Thu, 17 Oct 2019 14:43:25 +0000 (16:43 +0200)]
Add missing headers files to Makefile.am
This fixes `make distcheck` and produces correct
tarballs with `make dist`.
Ronnie Sahlberg [Thu, 17 Oct 2019 14:16:57 +0000 (00:16 +1000)]
Merge pull request #105 from ePirat/remove-popt-dep
Remove unused popt dependency for examples
Ronnie Sahlberg [Thu, 17 Oct 2019 14:11:12 +0000 (00:11 +1000)]
Merge pull request #106 from ePirat/fix-macos-compilation
aes128ccm: Add missing portable-endian header
Ronnie Sahlberg [Thu, 17 Oct 2019 14:09:35 +0000 (00:09 +1000)]
Merge pull request #104 from ePirat/add-error-code
errors: Add SMB2_STATUS_BAD_NETWORK_PATH
Marvin Scholz [Thu, 17 Oct 2019 13:52:32 +0000 (15:52 +0200)]
errors: Add SMB2_STATUS_BAD_NETWORK_PATH
This error code is returned by macOS SMB implementation when not
specifying the share to which to connect.
Marvin Scholz [Thu, 17 Oct 2019 13:48:13 +0000 (15:48 +0200)]
aes128ccm: Add missing portable-endian header
This fixes the compilation on macOS and other platforms that
do not have htobe* functions.
Marvin Scholz [Thu, 17 Oct 2019 13:45:56 +0000 (15:45 +0200)]
Remove unused popt dependency for examples
The examples have a dependency on popt even though that library is
not used by any examples, making it unnecessary.
Ronnie Sahlberg [Thu, 17 Oct 2019 12:53:57 +0000 (22:53 +1000)]
Merge pull request #102 from tguillem/smb2-password-fix
Don't override password set via smb2_set_password()
Ronnie Sahlberg [Thu, 17 Oct 2019 11:59:04 +0000 (21:59 +1000)]
Revert "fix correct length for error PDUs"
This reverts commit
938cc11fabfb7c31e88ffcd2d04fce859664a9e1.
Some servers (win10 for anonymous/guest logins) actually violate the spec
here and does NOT provide the extra byte.
Thomas Guillem [Tue, 15 Oct 2019 08:29:28 +0000 (10:29 +0200)]
don't override password set via smb2_set_password()
Regression from
bf5c12d7072d3a81438ffee67e7308077bfa3adb
This was impossible for an user to provide a password via smb2_set_password()
since it was overridden from smb2_connect_share_async(). Indeed,
smb2_set_password_from_file() is called from smb2_set_user(), that is called
from smb2_connect_share_async().
Thomas Guillem [Tue, 15 Oct 2019 08:28:04 +0000 (10:28 +0200)]
check fopen return value
Ronnie Sahlberg [Thu, 3 Oct 2019 23:54:49 +0000 (09:24 +0930)]
krb5: ignore errors if SMB2 layer returned success
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 26 Sep 2019 08:45:58 +0000 (01:45 -0700)]
change bitfield from int:1 to uint8_t:1 to make lgtm.com happy
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 26 Sep 2019 08:44:23 +0000 (01:44 -0700)]
Add header guards to make lgtm.com happy
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 26 Sep 2019 05:38:05 +0000 (22:38 -0700)]
we don't need SHA512 either
This all now shaves off 5-6kb of text size !!!
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 26 Sep 2019 05:13:03 +0000 (22:13 -0700)]
we don't need SHA384
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 26 Sep 2019 05:07:15 +0000 (22:07 -0700)]
we dont need sha1
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 26 Sep 2019 05:00:59 +0000 (22:00 -0700)]
We don't need SHA224
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 26 Sep 2019 04:37:46 +0000 (21:37 -0700)]
aes: we do not need the CBC version of AES
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Wed, 25 Sep 2019 00:03:35 +0000 (17:03 -0700)]
idcerpc: ask for 32kb for frag size. 256b is too small
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Tue, 24 Sep 2019 17:26:23 +0000 (10:26 -0700)]
check for integer wrap in query directory
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Tue, 24 Sep 2019 16:03:22 +0000 (09:03 -0700)]
dont segfault when trying to connect to server==NULL
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Tue, 24 Sep 2019 15:54:37 +0000 (08:54 -0700)]
make it possible to use alternative username for the share-enum example
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Wed, 11 Sep 2019 07:47:56 +0000 (17:47 +1000)]
fix correct length for error PDUs
Reported-by: Richard Sharpe <realrichardsharpe@gmail.com>
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Wed, 4 Sep 2019 11:42:43 +0000 (21:42 +1000)]
remove dependency of struct iovec from libsmb2-private.h
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Tue, 20 Aug 2019 11:34:17 +0000 (21:34 +1000)]
Update README and clarify some parts with kerberos/ntlmssp
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Sat, 17 Aug 2019 20:46:13 +0000 (06:46 +1000)]
always build with ntlmssp
Previously we would not build with ntlmssp if we had libkrb5.
Change this so that we always build with our ntlmssp implementation
and allow the user to select authentication mechanism through either the
URL argument or via an API call.
The reason for this is so that we will be able to use either krb5 or ntlmssp
from the same binary and still have the option to use sign or seal.
(the krb5 ntlmssp mech plugin does not export the session key so that
ntlm implementation can not be used for sign/seal).
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Fri, 16 Aug 2019 05:18:52 +0000 (15:18 +1000)]
README: document how to use/enable smb3 encryption
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 15 Aug 2019 02:51:20 +0000 (12:51 +1000)]
add a function to enable/disable encryption
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Wed, 14 Aug 2019 07:02:56 +0000 (17:02 +1000)]
make more commands use encryption is seal is enabled
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Wed, 14 Aug 2019 05:58:46 +0000 (15:58 +1000)]
Add plumbing to process the headers/command/data for decrypted blobs
so far we only encrypt/decrypt TreeConnect
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Wed, 14 Aug 2019 04:38:33 +0000 (14:38 +1000)]
split out the loops where we read header/fixed/variable parts
into its own helper function.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Mon, 12 Aug 2019 10:56:53 +0000 (20:56 +1000)]
add code to decrypt smb3 transform headers and payload
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Mon, 12 Aug 2019 02:57:44 +0000 (12:57 +1000)]
seal: encrypt outgoing PDUs that are flagged to require encryption
Set this flag for TreeConnect for now.
We can send Encrypted TreeConnect packets but we can not yet parse
or decrypt the response.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Mon, 12 Aug 2019 00:16:32 +0000 (10:16 +1000)]
initialize the prng by calling srandom on context creation
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Sun, 11 Aug 2019 23:25:39 +0000 (09:25 +1000)]
set SEAL flag in ntlmssp is we want encryption
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Sun, 11 Aug 2019 01:27:34 +0000 (11:27 +1000)]
aes128ccm: add test program
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Sun, 11 Aug 2019 21:55:13 +0000 (07:55 +1000)]
add aes128ccm functions
Add functions to perform aes128ccm encryption/decryption
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 8 Aug 2019 06:53:42 +0000 (16:53 +1000)]
When sign is used, set the ENCRYPTION capability in negprot
for protocols 3.0 and 3.02 and throw an error if the server does not support
encryption.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Wed, 7 Aug 2019 08:24:40 +0000 (18:24 +1000)]
derive the encryption keys for smb3.0 and smb3.02
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Wed, 7 Aug 2019 07:55:27 +0000 (17:55 +1000)]
add a URL argument for seal
Add a seal argument to activate smb3 encryption.
This does not do anything yet other than record that we want to use encryption.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Mon, 12 Aug 2019 10:55:06 +0000 (20:55 +1000)]
Merge pull request #97 from tguillem/android-getlogin_r-fix
Android: fix getlogin_r() dep
Thomas Guillem [Mon, 12 Aug 2019 08:04:30 +0000 (10:04 +0200)]
fix getlogin_r() dep on Android
Thomas Guillem [Mon, 12 Aug 2019 08:04:00 +0000 (10:04 +0200)]
fix getlogin_r() fallback
Ronnie Sahlberg [Mon, 12 Aug 2019 00:11:11 +0000 (10:11 +1000)]
Merge pull request #96 from tguillem/fix-segfault-destroy
smb2_destroy_context: fix possible null-deref
Thomas Guillem [Thu, 8 Aug 2019 13:18:31 +0000 (15:18 +0200)]
smb2_destroy_context: fix possible null-deref
This could happen when the smb2_close_async() command was aborted
(smb2_service() not being called).
Ronnie Sahlberg [Thu, 8 Aug 2019 06:36:31 +0000 (16:36 +1000)]
Merge pull request #94 from tguillem/getlogin-fix
Fix getlogin() usage
Ronnie Sahlberg [Tue, 6 Aug 2019 07:46:31 +0000 (17:46 +1000)]
Merge pull request #95 from apuder/master
Limit output buffer size to 512 on an ESP32
Arno Puder [Tue, 6 Aug 2019 07:08:38 +0000 (00:08 -0700)]
Limit output buffer size to 512 on an ESP32
Ronnie Sahlberg [Tue, 6 Aug 2019 03:30:51 +0000 (13:30 +1000)]
ntlmssp: add support for Anonymous logins
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Thomas Guillem [Tue, 30 Jul 2019 16:02:14 +0000 (18:02 +0200)]
Fix getlogin() usage
Use the reentrant version (the getlogin() string was statically allocated and
could be overwritten on subsequent calls).
Also check for error and use "Guest" as a fallback.
Thomas Guillem [Tue, 30 Jul 2019 15:46:49 +0000 (17:46 +0200)]
Fix indent and white spaces
No functional changes.
Ronnie Sahlberg [Mon, 15 Jul 2019 08:06:08 +0000 (18:06 +1000)]
improve error messages for readlink failures
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Mon, 15 Jul 2019 07:01:48 +0000 (17:01 +1000)]
add smb2_readlink example
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Mon, 15 Jul 2019 06:48:59 +0000 (16:48 +1000)]
fix NULL deref in readlink_cb_3
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Sun, 14 Jul 2019 22:17:03 +0000 (08:17 +1000)]
Add support for readlink()
Report Windows Reparse points as links
and implement readlink() to decode reparse points of the type
MS-FSCC: 2.1.2.4 Symbolic Link Reparse Data Buffer
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Sun, 9 Jun 2019 21:38:20 +0000 (07:38 +1000)]
New version: 3.0.0
Mon Jun 10 2019 : Version 3.0.0
- ESP32 support
- Support specifying the port number in an SMB URL.
- Add creation time to smb_stat
- Abort all commands when the context is destroyed.
- Free all file and directory handles when the context is destroyed.
- Fix handling of O_TRUNC
- Add more error codes.
- Add support for SMB2_IOCTL
- Handle DCE/RPC fragment reassembly for IOCTL().
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Sun, 2 Jun 2019 20:21:26 +0000 (06:21 +1000)]
Merge pull request #91 from apuder/esp
Add instructions for ESP32 and small fix
Arno Puder [Sun, 2 Jun 2019 17:54:22 +0000 (10:54 -0700)]
Make libsmb2's config.h private
Arno Puder [Sun, 2 Jun 2019 17:53:16 +0000 (10:53 -0700)]
Add instructions for the ESP32
Ronnie Sahlberg [Sun, 2 Jun 2019 08:34:27 +0000 (18:34 +1000)]
Merge pull request #90 from apuder/esp
Add support for the ESP32 microcontroller
Arno Puder [Sun, 2 Jun 2019 07:55:14 +0000 (00:55 -0700)]
Add support for the ESP32 microcontroller
Ronnie Sahlberg [Sat, 1 Jun 2019 23:12:04 +0000 (09:12 +1000)]
ntlmssp: create a test program to verify ntlmssp_generate_blob()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Wed, 15 May 2019 21:44:46 +0000 (07:44 +1000)]
Merge pull request #88 from slevengood/master
Added error message on smb2_open failure
Ronnie Sahlberg [Wed, 15 May 2019 21:42:33 +0000 (07:42 +1000)]
Merge pull request #87 from mwyoungpa/port-syntax
Document that server specifications can include a port
Shane Levengood [Wed, 15 May 2019 20:58:54 +0000 (15:58 -0500)]
Added error message on smb2_open_async failure
mwyoung libsmb2 development [Mon, 13 May 2019 12:19:33 +0000 (08:19 -0400)]
Document that server specifications can carry a port specification.
Ronnie Sahlberg [Sun, 12 May 2019 22:52:04 +0000 (08:52 +1000)]
Merge pull request #86 from mwyoungpa/master
Support host:port syntax for specifying non-standard port numbers.
mwyoung libsmb2 development [Sat, 11 May 2019 12:37:15 +0000 (08:37 -0400)]
Support host:port syntax for specifying non-standard port numbers.
mwyoung libsmb2 development [Sat, 11 May 2019 12:04:04 +0000 (08:04 -0400)]
Support host:port syntax for specifying non-standard port numbers.
Ronnie Sahlberg [Wed, 8 May 2019 10:57:27 +0000 (20:57 +1000)]
Merge pull request #80 from tguillem/eacces
Map more error status to EACCES
Ronnie Sahlberg [Wed, 8 May 2019 10:55:42 +0000 (20:55 +1000)]
Merge pull request #83 from amosavian/master
Adding creation time to smb_stat
Amir Abbas [Sun, 28 Apr 2019 15:53:04 +0000 (20:23 +0430)]
Adding creation time to smb_stat
Ronnie Sahlberg [Thu, 2 May 2019 09:12:10 +0000 (19:12 +1000)]
Abort all async commands with -ECONNRESET when context is destroyed
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 2 May 2019 08:56:42 +0000 (18:56 +1000)]
Free all directory handles when the context is destroyed
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 2 May 2019 08:49:24 +0000 (18:49 +1000)]
Free all open handles when the context is destroyed
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Mon, 8 Apr 2019 22:31:09 +0000 (08:31 +1000)]
smb2_open_async: fix incorrect handling of O_TRUNC
From noahmorrison1@github
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Thomas Guillem [Tue, 12 Feb 2019 10:47:27 +0000 (11:47 +0100)]
Map more EACCESS error status
Thomas Guillem [Tue, 12 Feb 2019 10:42:30 +0000 (11:42 +0100)]
Add more error status
Related to login failure with incorrect/invalid/expired account.
Ronnie Sahlberg [Tue, 22 Jan 2019 02:30:56 +0000 (12:30 +1000)]
Merge pull request #73 from AkiraNorthstar/master
cmake LIB_SUFFIX patch
Ronnie Sahlberg [Tue, 22 Jan 2019 02:29:47 +0000 (12:29 +1000)]
Merge pull request #79 from chouquette/allow_NULL_set_password
Allow passing NULL to smb2_set_password
Hugo Beauzée-Luyssen [Thu, 17 Jan 2019 09:15:49 +0000 (10:15 +0100)]
Allow passing NULL to smb2_set_password
Similar to
d1c48bf442329bff82e3220e90973c53d2b00197 for smb2_set_user
Ronnie Sahlberg [Mon, 12 Nov 2018 11:16:33 +0000 (21:16 +1000)]
dcerpc: more reassembly fixes
From satashi2009
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Mon, 12 Nov 2018 10:07:37 +0000 (20:07 +1000)]
dcerpc: fix fragment reassembly
From satashi2009
Fix the dcerpc reassembly code to handle 3 or more fragments.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Sun, 4 Nov 2018 21:16:28 +0000 (07:16 +1000)]
Merge branch 'master' of github.com:sahlberg/libsmb2
Ronnie Sahlberg [Wed, 8 Aug 2018 04:59:41 +0000 (14:59 +1000)]
dce: add simple ioctl dce fragment reassembly
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Tue, 23 Oct 2018 01:50:17 +0000 (11:50 +1000)]
Merge pull request #76 from MrMC/master
ENOMEDIUM does not exist on darwin, use posix ENODEV instead
S. Davilla [Tue, 23 Oct 2018 00:53:15 +0000 (20:53 -0400)]
ENOMEDIUM does not exist on darwin, use posix ENODEV instead
Ronnie Sahlberg [Mon, 1 Oct 2018 21:58:14 +0000 (07:58 +1000)]
Add example progam using smb2_pwrite_async()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
AkiraNorthstar [Wed, 19 Sep 2018 08:02:53 +0000 (10:02 +0200)]
cmake LIB_SUFFIX patch
Ronnie Sahlberg [Wed, 19 Sep 2018 07:36:45 +0000 (17:36 +1000)]
Merge pull request #72 from AkiraNorthstar/master
Missing many error codes
AkiraNorthstar [Wed, 19 Sep 2018 07:26:04 +0000 (09:26 +0200)]
Delete libsmb2_error.latest.patch
AkiraNorthstar [Wed, 19 Sep 2018 07:24:28 +0000 (09:24 +0200)]
libsmb_error patch
AkiraNorthstar [Wed, 19 Sep 2018 06:58:19 +0000 (08:58 +0200)]
Merge pull request #1 from sahlberg/master
upstream
Ronnie Sahlberg [Wed, 19 Sep 2018 03:00:26 +0000 (13:00 +1000)]
Merge pull request #71 from AkiraNorthstar/patch-1
fix memcpy fileid