libsmb2.git
3 years agoMerge branch 'master' of github.com:sahlberg/libsmb2 master
Ronnie Sahlberg [Wed, 24 Jun 2020 07:29:54 +0000 (17:29 +1000)]
Merge branch 'master' of github.com:sahlberg/libsmb2

3 years agodcerpc: fix handling of pointers for NetShareGetInfo ndr64
Ronnie Sahlberg [Wed, 24 Jun 2020 05:41:45 +0000 (15:41 +1000)]
dcerpc: fix handling of pointers for NetShareGetInfo ndr64

our pointer alignment was broken

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
3 years agoAdded connection timeout for sync interface, now if not 'is_connected' after 'timeout...
Timmeh87 [Fri, 19 Jun 2020 22:13:59 +0000 (18:13 -0400)]
Added connection timeout for sync interface, now if not 'is_connected' after 'timeout' seconds, operation is aborted regardless of status

3 years agoMerge pull request #149 from timmeh87/master
Ronnie Sahlberg [Tue, 23 Jun 2020 05:13:04 +0000 (15:13 +1000)]
Merge pull request #149 from timmeh87/master

Improved timeout for sync interface when connection does not exist

3 years agodcerpc: rework dcerpc and try to layer it a little better vs smb2
Ronnie Sahlberg [Wed, 17 Jun 2020 04:25:53 +0000 (14:25 +1000)]
dcerpc: rework dcerpc and try to layer it a little better vs smb2

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
3 years agoAdded connection timeout for sync interface, now if not 'is_connected' after 'timeout...
Timmeh87 [Fri, 19 Jun 2020 22:13:59 +0000 (18:13 -0400)]
Added connection timeout for sync interface, now if not 'is_connected' after 'timeout' seconds, operation is aborted regardless of status

3 years agoMerge pull request #147 from timmeh87/master
Ronnie Sahlberg [Wed, 17 Jun 2020 02:34:55 +0000 (12:34 +1000)]
Merge pull request #147 from timmeh87/master

winsock error message / null pointer checks

3 years agoAdded windows specific error message if winsock is not init
Timmeh87 [Mon, 15 Jun 2020 20:47:00 +0000 (16:47 -0400)]
Added windows specific error message if winsock is not init
added null pointer checks to some of the core api functions to improve reliability

3 years agosmb2-cat-sync: improve the example read loop
Ronnie Sahlberg [Thu, 11 Jun 2020 21:30:18 +0000 (07:30 +1000)]
smb2-cat-sync: improve the example read loop

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
3 years agosmb2-cat-sync: try to use very large reads
Ronnie Sahlberg [Thu, 11 Jun 2020 01:39:12 +0000 (11:39 +1000)]
smb2-cat-sync: try to use very large reads

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
3 years agopread/pwrite: make sure to always update the number of credits we need
Ronnie Sahlberg [Thu, 11 Jun 2020 01:16:58 +0000 (11:16 +1000)]
pread/pwrite: make sure to always update the number of credits we need

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
3 years agoAdd support for timeout
Ronnie Sahlberg [Tue, 12 May 2020 02:21:38 +0000 (12:21 +1000)]
Add support for timeout

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agosync: don't access freed memory for cancelled PDUs
Ronnie Sahlberg [Mon, 20 Apr 2020 05:33:42 +0000 (15:33 +1000)]
sync: don't access freed memory for cancelled PDUs

If we fail wait_for_reply in the sync API it means that the the underlying
SMB2 PDU might still be in fligth and our sync callback will be invoked later.

Solve this by not freeing the cb_data structure on wait_for_reply failures
and instead just flag the status as CANCELLED.
Later when the callback is invoked, if status is CANCELLED it means we should
just free cb_data and return.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agosync: don't use cb structures allocated on the stack
Ronnie Sahlberg [Mon, 20 Apr 2020 04:26:09 +0000 (14:26 +1000)]
sync: don't use cb structures allocated on the stack

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agoRevert "We can not access cb_data when status is CANCELLED"
Ronnie Sahlberg [Mon, 20 Apr 2020 03:49:06 +0000 (13:49 +1000)]
Revert "We can not access cb_data when status is CANCELLED"

This reverts commit 5c4d6db14ce4048b7d08d9af3307022ba4992833.

4 years agoMerge pull request #139 from amandeepgautam/master
Ronnie Sahlberg [Fri, 17 Apr 2020 02:31:31 +0000 (12:31 +1000)]
Merge pull request #139 from amandeepgautam/master

return appropriate error codes on failure

4 years agoAdd a URL argument and API to enforce signing
Ronnie Sahlberg [Sun, 12 Apr 2020 03:29:05 +0000 (13:29 +1000)]
Add a URL argument and API to enforce signing

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agoreturn appropriate error codes on failure
Amandeep Gautam [Thu, 9 Apr 2020 01:18:24 +0000 (18:18 -0700)]
return appropriate error codes on failure

with current change one can have same error handling logic for callbacks and
function return values. '-1' corresponds to permission denied which
makes it problematic.

4 years agoMerge pull request #138 from amandeepgautam/master
Ronnie Sahlberg [Sun, 5 Apr 2020 23:10:16 +0000 (09:10 +1000)]
Merge pull request #138 from amandeepgautam/master

fix regression from commit: "extend error codes (from samba)"

4 years agofix regression from commit: "extend error codes (from samba)"
Amandeep Gautam [Sun, 5 Apr 2020 22:38:49 +0000 (15:38 -0700)]
fix regression from commit: "extend error codes (from samba)"

4 years agoMerge pull request #136 from amandeepgautam/master
Ronnie Sahlberg [Fri, 20 Mar 2020 08:39:55 +0000 (18:39 +1000)]
Merge pull request #136 from amandeepgautam/master

add const for filename

4 years agoadd const for filename
Amandeep Gautam [Fri, 20 Mar 2020 08:26:37 +0000 (01:26 -0700)]
add const for filename

4 years agodcerpc: the srvsvc_interface belong in dcerpc-srvsvc.c not dcerpc.c
Ronnie Sahlberg [Mon, 9 Mar 2020 05:52:12 +0000 (15:52 +1000)]
dcerpc: the srvsvc_interface belong in dcerpc-srvsvc.c not dcerpc.c

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agodcerpc: add example of NetShareGetInfo
Ronnie Sahlberg [Fri, 6 Mar 2020 01:29:04 +0000 (11:29 +1000)]
dcerpc: add example of NetShareGetInfo

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agodcerpc: make it possible to control le/be from url arguments for testing
Ronnie Sahlberg [Sun, 23 Feb 2020 10:54:07 +0000 (20:54 +1000)]
dcerpc: make it possible to control le/be from url arguments for testing

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agodcerpc: make it possible to select ndr transfer syntax from url for testing
Ronnie Sahlberg [Sun, 23 Feb 2020 05:02:44 +0000 (15:02 +1000)]
dcerpc: make it possible to select ndr transfer syntax from url for testing

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agodcerpc: fix top level ref pointer bug.
Ronnie Sahlberg [Sat, 22 Feb 2020 20:44:23 +0000 (06:44 +1000)]
dcerpc: fix top level ref pointer bug.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agodcerpc: add comment that NDR64 is only available for LE encodings
Ronnie Sahlberg [Sat, 22 Feb 2020 20:36:16 +0000 (06:36 +1000)]
dcerpc: add comment that NDR64 is only available for LE encodings

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agodcerpc: we need portable-endian.h for some platforms
Ronnie Sahlberg [Sat, 22 Feb 2020 07:18:47 +0000 (17:18 +1000)]
dcerpc: we need portable-endian.h for some platforms

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agodcerpc: support sending dcerpc pdus in big-endian mode
Ronnie Sahlberg [Sat, 22 Feb 2020 04:19:00 +0000 (14:19 +1000)]
dcerpc: support sending dcerpc pdus in big-endian mode

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agodcerpc: track the data representation in the dcerpc context
Ronnie Sahlberg [Fri, 21 Feb 2020 22:24:19 +0000 (08:24 +1000)]
dcerpc: track the data representation in the dcerpc context

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agoWe can not access cb_data when status is CANCELLED
Ronnie Sahlberg [Thu, 20 Feb 2020 04:48:24 +0000 (14:48 +1000)]
We can not access cb_data when status is CANCELLED

since the pointer may no longer be valid.

Reported-by: hgourvest@progdigy.com
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agoFix cast in dcerpc.c
Ronnie Sahlberg [Thu, 20 Feb 2020 04:23:12 +0000 (14:23 +1000)]
Fix cast in dcerpc.c

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agoIPv6 is available on all platforms. No need to check for it
Ronnie Sahlberg [Thu, 20 Feb 2020 03:39:27 +0000 (13:39 +1000)]
IPv6 is available on all platforms. No need to check for it

We weren't even checking for this in configure.ac anyway.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agoMerge pull request #130 from amandeepgautam/master
Ronnie Sahlberg [Tue, 18 Feb 2020 10:00:54 +0000 (20:00 +1000)]
Merge pull request #130 from amandeepgautam/master

extend error codes (from samba)

4 years agoAdd callbacks to notify application of fd or event changes
Ronnie Sahlberg [Tue, 11 Feb 2020 06:00:29 +0000 (16:00 +1000)]
Add callbacks to notify application of fd or event changes

Add callbacks to allow libsmb2 to call back into the application to
inform when the filedescriptor to wait on changes or when the set
ot events (POLLIN/POLLOUT) changes.

This allows better integration with more sophisticated eventsystems
such as those built on epoll() than the older way libsmb2 provided.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agoMerge pull request #132 from 76716C86/master
Ronnie Sahlberg [Tue, 11 Feb 2020 01:44:31 +0000 (11:44 +1000)]
Merge pull request #132 from 76716C86/master

fix __cplusplus guards

4 years agofix __cplusplus guards
Catalin Pichiu [Mon, 3 Feb 2020 10:29:44 +0000 (12:29 +0200)]
fix __cplusplus guards

* Some functions weren't included in the __cplusplus scope which caused
the compiler to mangle those names which made it impossible for the
linker to find the proper names.

* Properly close all the __cplusplus scopes. Some of them were left
opened and caused weird errors when compiling c++ code.

4 years agoextend error codes (from samba)
Amandeep Gautam [Fri, 31 Jan 2020 21:24:22 +0000 (13:24 -0800)]
extend error codes (from samba)

4 years agoMerge pull request #128 from amandeepgautam/master
Ronnie Sahlberg [Thu, 9 Jan 2020 03:49:50 +0000 (13:49 +1000)]
Merge pull request #128 from amandeepgautam/master

add const qualifier for smb write related code

4 years agoadd const qualifier for smb write related code
Amandeep Gautam [Wed, 8 Jan 2020 02:26:56 +0000 (18:26 -0800)]
add const qualifier for smb write related code

4 years agoMerge pull request #124 from amandeepgautam/master
Ronnie Sahlberg [Wed, 18 Dec 2019 07:37:09 +0000 (17:37 +1000)]
Merge pull request #124 from amandeepgautam/master

do not clamp read/write request to 60KB

4 years agodo not clamp read/write request to 60KB
Amandeep Gautam [Wed, 18 Dec 2019 07:30:40 +0000 (23:30 -0800)]
do not clamp read/write request to 60KB

4 years agoMerge pull request #123 from amandeepgautam/master
Ronnie Sahlberg [Wed, 18 Dec 2019 07:06:25 +0000 (17:06 +1000)]
Merge pull request #123 from amandeepgautam/master

evaluate smb status before call to krb5 lib

4 years agoupdate readme to say that signing is supported with ntlm plugin
Amandeep Gautam [Wed, 18 Dec 2019 05:37:34 +0000 (21:37 -0800)]
update readme to say that signing is supported with ntlm plugin

4 years agoevaluate smb status before call to krb5 lib
Amandeep Gautam [Tue, 17 Dec 2019 08:40:31 +0000 (00:40 -0800)]
evaluate smb status before call to krb5 lib

This leads to better error messages. For example, for incorrect pass we
have a message like following:
Session setup failed with (0xc000006d) STATUS_LOGON_FAILURE (-111)
with current change instead of
gss_init_sec_context: (Invalid token was supplied, Unknown error) (-1)

4 years agofix SIGBUS in smb2_set_uint64
Ronnie Sahlberg [Tue, 26 Nov 2019 12:06:33 +0000 (22:06 +1000)]
fix SIGBUS in smb2_set_uint64

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agolibsmb2: don't call dcerpc_free_pdu to avoid use-after-free
Namjae Jeon [Mon, 18 Nov 2019 00:49:06 +0000 (19:49 -0500)]
libsmb2: don't call dcerpc_free_pdu to avoid use-after-free

 ret = dcerpc_decode_pdu(dce, pdu, &iov);
 if (ret < 0) {
 pdu->cb(dce, -EINVAL, NULL, pdu->cb_data); -> use after free.
 smb2_free_data(dce->smb2, rep->output);
 dcerpc_free_pdu(dce, pdu);  -> re-free here.
 return;
 }

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
4 years agolibsmb2: fix potential memory leak
Namjae Jeon [Mon, 18 Nov 2019 00:49:07 +0000 (19:49 -0500)]
libsmb2: fix potential memory leak

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
4 years agolibsmb2: alloc_hint with unint32 type never less than zero
Namjae Jeon [Mon, 18 Nov 2019 00:49:05 +0000 (19:49 -0500)]
libsmb2: alloc_hint with unint32 type never less than zero

unsigned type alloc_hint could not be negative.

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
4 years agolibsmb2: fix use-after-free of c_data->utf8_unc
Namjae Jeon [Mon, 18 Nov 2019 00:49:04 +0000 (19:49 -0500)]
libsmb2: fix use-after-free of c_data->utf8_unc

freed c_data->utf8_unc by free_c_data could be used.

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
4 years agoUse calloc where appropriate
Volker Lendecke [Sat, 2 Nov 2019 14:25:25 +0000 (15:25 +0100)]
Use calloc where appropriate

Saves around 250 bytes with -Oz

4 years agonegotiate protocol: some servers do not return a blob in neg prot responses
Ronnie Sahlberg [Mon, 28 Oct 2019 04:00:56 +0000 (14:00 +1000)]
negotiate protocol: some servers do not return a blob in neg prot responses

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 years agoMerge pull request #118 from tguillem/more-errnos
Ronnie Sahlberg [Sun, 27 Oct 2019 17:56:14 +0000 (03:56 +1000)]
Merge pull request #118 from tguillem/more-errnos

More errnos

4 years agosmb2_connect_share_async: don't return ENOMEM if connect fails
Thomas Guillem [Thu, 24 Oct 2019 15:50:53 +0000 (17:50 +0200)]
smb2_connect_share_async: don't return ENOMEM if connect fails

4 years agosmb2_connect_async: convert getaddrinfo to errno
Thomas Guillem [Thu, 24 Oct 2019 16:01:53 +0000 (18:01 +0200)]
smb2_connect_async: convert getaddrinfo to errno

4 years agosmb2_connect_async: return errno
Thomas Guillem [Thu, 24 Oct 2019 15:49:16 +0000 (17:49 +0200)]
smb2_connect_async: return errno

4 years agoMerge pull request #113 from ePirat/configure-cleanup
Ronnie Sahlberg [Mon, 21 Oct 2019 04:47:43 +0000 (14:47 +1000)]
Merge pull request #113 from ePirat/configure-cleanup

Configure cleanup

4 years agoUse AS_IF instead of shell if statements
Marvin Scholz [Fri, 18 Oct 2019 19:20:54 +0000 (21:20 +0200)]
Use AS_IF instead of shell if statements

This is more consistent with the rest of the file

4 years agoUse GCC variable instead of ac_cv_prog_gcc
Marvin Scholz [Fri, 18 Oct 2019 19:08:09 +0000 (21:08 +0200)]
Use GCC variable instead of ac_cv_prog_gcc

This is documented in the AC_PROG_CC documentation and seems a bit
cleaner than to use the "internal" caching variable. And it is easier
to read.

4 years agoRemove unused header checks
Marvin Scholz [Fri, 18 Oct 2019 19:05:27 +0000 (21:05 +0200)]
Remove unused header checks

None of the headers checked by these checks are used in the project.

4 years agoCleanup comments
Marvin Scholz [Fri, 18 Oct 2019 01:12:45 +0000 (03:12 +0200)]
Cleanup comments

A lot of comments were duplicated as both autoconf and shell
comments, which seems unnecessary.
Additionally slight rewording of some comments.

4 years agoMerge pull request #112 from ePirat/ci-run-prs
Ronnie Sahlberg [Fri, 18 Oct 2019 05:14:47 +0000 (15:14 +1000)]
Merge pull request #112 from ePirat/ci-run-prs

Trigger CI builds for pull requests

4 years agoMerge pull request #111 from ePirat/add-ci-windows
Ronnie Sahlberg [Fri, 18 Oct 2019 05:14:15 +0000 (15:14 +1000)]
Merge pull request #111 from ePirat/add-ci-windows

Add windows build to CI

4 years agoMerge pull request #110 from ePirat/fix-windows-msvc
Ronnie Sahlberg [Fri, 18 Oct 2019 05:13:37 +0000 (15:13 +1000)]
Merge pull request #110 from ePirat/fix-windows-msvc

Various MSVC build fixes

4 years agoFix indentation
Marvin Scholz [Fri, 18 Oct 2019 01:09:12 +0000 (03:09 +0200)]
Fix indentation

4 years agoAdd missing quotes
Marvin Scholz [Fri, 18 Oct 2019 00:56:36 +0000 (02:56 +0200)]
Add missing quotes

While these are not all needed it is much easier to be consistent and
quote, so that when editing later to not accidentally forget to quote
a value that did not need quoting before.

4 years agoDo not use deprecated AC_HELP_STRING
Marvin Scholz [Fri, 18 Oct 2019 00:50:14 +0000 (02:50 +0200)]
Do not use deprecated AC_HELP_STRING

4 years agoRemove explicit PKG_PROG_PKG_CONFIG call
Marvin Scholz [Fri, 18 Oct 2019 00:48:59 +0000 (02:48 +0200)]
Remove explicit PKG_PROG_PKG_CONFIG call

This will be called implicitly when needed

4 years agoSet minimum supported autoconf version to 2.58
Marvin Scholz [Fri, 18 Oct 2019 00:46:49 +0000 (02:46 +0200)]
Set minimum supported autoconf version to 2.58

The file is already using things only available since 2.58, not 2.50

4 years agoCheck for AM_PROG_AR instead of defining to nothing
Marvin Scholz [Fri, 18 Oct 2019 00:45:53 +0000 (02:45 +0200)]
Check for AM_PROG_AR instead of defining to nothing

4 years agoSet needed automake version to 1.11
Marvin Scholz [Fri, 18 Oct 2019 00:45:25 +0000 (02:45 +0200)]
Set needed automake version to 1.11

This version should be old enough and gives us an opportunity to know
what is actually the lowest supported version, erroring out with a
helpful error message if someone tries to use an older version than
that, instead of obscure errors due to missing macros.

4 years agoSimplify suppression of default CFLAGS
Marvin Scholz [Fri, 18 Oct 2019 00:38:21 +0000 (02:38 +0200)]
Simplify suppression of default CFLAGS

This is the way autoconf documents this should be done and much
simpler than before.

4 years agoAdd config.h.in~ to gitignore
Marvin Scholz [Fri, 18 Oct 2019 00:36:38 +0000 (02:36 +0200)]
Add config.h.in~ to gitignore

4 years agoTrigger CI builds for pull requests
Marvin Scholz [Thu, 17 Oct 2019 23:32:34 +0000 (01:32 +0200)]
Trigger CI builds for pull requests

4 years agoAdd windows build to CI
Marvin Scholz [Thu, 17 Oct 2019 22:29:09 +0000 (00:29 +0200)]
Add windows build to CI

4 years agoVarious MSVC build fixes
Marvin Scholz [Thu, 17 Oct 2019 22:38:05 +0000 (00:38 +0200)]
Various MSVC build fixes

Fix #101

4 years agoMerge pull request #108 from ePirat/add-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

4 years agoMerge pull request #107 from ePirat/fix-distcheck
Ronnie Sahlberg [Thu, 17 Oct 2019 21:55:43 +0000 (07:55 +1000)]
Merge pull request #107 from ePirat/fix-distcheck

Fix autotools distcheck

4 years agoAdd GitHub Actions CI
ePirat [Thu, 17 Oct 2019 14:10:33 +0000 (16:10 +0200)]
Add GitHub Actions CI

4 years agoRemove check for popt and fix conditional directory
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`

4 years agoAdd missing headers files to Makefile.am
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`.

4 years agoMerge pull request #105 from ePirat/remove-popt-dep
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

4 years agoMerge pull request #106 from ePirat/fix-macos-compilation
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

4 years agoMerge pull request #104 from ePirat/add-error-code
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

4 years agoerrors: 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.

4 years agoaes128ccm: Add missing portable-endian header
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.

4 years agoRemove unused popt dependency for examples
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.

4 years agoMerge pull request #102 from tguillem/smb2-password-fix
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()

4 years agoRevert "fix correct length for error PDUs"
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.

4 years agodon't override password set via smb2_set_password()
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().

4 years agocheck fopen return value
Thomas Guillem [Tue, 15 Oct 2019 08:28:04 +0000 (10:28 +0200)]
check fopen return value

4 years agokrb5: ignore errors if SMB2 layer returned success
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>
4 years agochange bitfield from int:1 to uint8_t:1 to make lgtm.com happy
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>
4 years agoAdd header guards to make lgtm.com happy
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>
4 years agowe don't need SHA512 either
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>
4 years agowe don't need SHA384
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>
4 years agowe dont need sha1
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>
4 years agoWe don't need SHA224
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>
4 years agoaes: we do not need the CBC version of AES
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>