summaryrefslogtreecommitdiff
path: root/libcli
Commit message (Collapse)AuthorAgeFilesLines
* build: Do not build selftest binaries for builds without --enable-selftestAndrew Bartlett2019-11-225-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new for_selftest option to SAMBA_BINARY() and SAMBA3_BINARY() This allows us to be much more consistent (at least in the core Samba) and documents clearly why the binary should not be installed. Not modified are - test_lp_load - notifyd-tests - gendrandperf - test* from examples/libsmbclient - dbwrap_torture - split_tokens - locktest2 - msgtest - msg_sink - msg_source - versiontest - rpc_open_tcp - test_headers As these are not tested in selftest so any change would also be untested. Of course they probably should be added in a different MR. Also not modified (because they are not tests, nor part of the build system) are: - smb2mount - notifydd - log2pacp - debug2html - smbfilter - destroy_netlogon_creds_cli - spotlight2* - tevent_glib_tracker These do however appear to be untested. For now, the source4 forked client tools are left unchanged: - smbclient4 - nmblookup4 Finally, the heimdal binaries are left as install=False as they are either part of the build system or end-user tools that we just don't want to install. These are however tested. The motivation is commit like c34ec003b7d45aa4196ff93a0ac29694b25e5309 and da87fa998ab71328f30bcdf5b41aee8675aee48a, which are both totally correct but are not needed if the selftest is not run on MacOS. There are likely other platforms or build environments where building our test binaries is more pain than valuable, see for example also https://lists.samba.org/archive/samba/2019-November/227137.html Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Isaac Boukris <iboukris@samba.org> Autobuild-User(master): Isaac Boukris <iboukris@samba.org> Autobuild-Date(master): Fri Nov 22 11:48:59 UTC 2019 on sn-devel-184
* libcli:auth: Remove unused E_md5hash()Andreas Schneider2019-11-192-41/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib: Fix an error path memleak in schannel_get_creds_state()Volker Lendecke2019-11-141-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli:auth Check return code of netlogon_creds_aes_encrypt()Andrew Bartlett2019-11-142-7/+21
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Nov 14 09:25:36 UTC 2019 on sn-devel-184
* libcli:auth: Check return code of netlogon_creds_step_crypt()Andreas Schneider2019-11-141-7/+29
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Check return code of netlogon_creds_step()Andreas Schneider2019-11-141-3/+17
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Check return code of netlogon_creds_client_authenticator()Andreas Schneider2019-11-141-15/+41
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Return NTSTATUS for netlogon_creds_client_authenticator()Andreas Schneider2019-11-142-4/+8
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Check return status of netlogon_creds_first_step()Andreas Schneider2019-11-141-5/+19
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Check return status of netlogon_creds_init_64bit()Andreas Schneider2019-11-141-7/+22
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Check return value of netlogon_creds_init_128bit()Andreas Schneider2019-11-141-4/+10
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Check return code of SMBOWFencrypt_ntv2()Andreas Schneider2019-11-142-5/+33
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Return NTSTATUS for SMBOWFencrypt_ntv2()Andreas Schneider2019-11-142-14/+19
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Check return codes of SMBsesskeygen_ntv2()Andreas Schneider2019-11-142-4/+28
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Return NTSTATUS for SMBOWFencrypt_ntv2()Andreas Schneider2019-11-142-10/+19
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Do not use gnutls_aead_cipher_encryptv2() with GnuTLS 3.6.10Andreas Schneider2019-11-041-2/+6
| | | | | | | | | | The gnutls_aead_cipher_encryptv2() implementation was released with a bug. This wont be fixed before 3.6.11. See https://gitlab.com/gnutls/gnutls/merge_requests/1085 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* tstream_npa: Set local server name in auth requestsSamuel Cabrero2019-10-182-2/+3
| | | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli smb smb1cli_trans: fix ubsan warningGary Lockyer2019-10-161-2/+4
| | | | | | | | | | | | Fix ubsan warning null pointer passed as argument 2 when the source pointer is NULL. The calls to memcpy are now guarded by an if (len > 0) Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Oct 16 18:00:31 UTC 2019 on sn-devel-184
* libcli:smb: Use gnutls_aead_cipher_decryptv2() for AES GCM or CCMAndreas Schneider2019-10-081-2/+27
| | | | | | | | | | | This is a new call which has been added with GnuTLS 3.6.10 and will recuduce memory allocations and copying of data. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Oct 8 14:12:44 UTC 2019 on sn-devel-184
* libcli:smb: Use gnutls_aead_cipher_encryptv2() for AES GCM or CCMAndreas Schneider2019-10-081-2/+30
| | | | | | | | This is a new call which has been added with GnuTLS 3.6.10 and will recuduce memory allocations and copying of data. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* libcli/auth: add gnutls test for aes-128-cfb8 cipher bugGünther Deschner2019-10-072-0/+248
| | | | | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Oct 7 09:31:35 UTC 2019 on sn-devel-184
* libcli/auth: add test for gensec_schannel codeGünther Deschner2019-10-072-0/+313
| | | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli/auth: add netlogon_creds_cli_LogonGetDomainInfo()Stefan Metzmacher2019-09-202-1/+297
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* libcli/auth: clang: Fix 'Value stored to 'status' is never read'Noel Power2019-08-271-1/+1
| | | | | | | | | | | | Fixes: libcli/auth/netlogon_creds_cli.c:2622:2: warning: Value stored to 'status' is never read <--[clang] status = netlogon_creds_decrypt_samlogon_validation(&state->tmp_creds, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* libcli:smb: Prefer AES-GCM over AES-CCM with GnuTLSAndreas Schneider2019-08-271-6/+3
| | | | | | | | | | | The AES-GCM implementation in GnuTLS is faster. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Adapted to remove Samba AES support Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Use gnutls_error_to_ntstatus() in smb2_signing_encrypt_pdu()Andreas Schneider2019-08-271-3/+2
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Use smb2_signing_key in smb2_signing_encrypt_pdu()Andreas Schneider2019-08-273-22/+18
| | | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Adaped to remove Samba AES support Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Use gnutls_error_to_ntstatus() in smb2_signing_decrypt_pdu()Andreas Schneider2019-08-271-3/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Use smb2_signing_key in smb2_signing_decrypt_pdu()Andreas Schneider2019-08-273-21/+17
| | | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Adaped to remove Samba AES support Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Support GnuTLS AES CCM and GCM in smb2_signing_decrypt_pdu()Andreas Schneider2019-08-271-45/+125
| | | | | | | | | | | This requires GnuTLS >= 3.4.0. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Adapted to remove Samba AES support Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Support GnuTLS AES CCM and GCM in smb2_signing_encrypt_pdu()Andreas Schneider2019-08-271-45/+124
| | | | | | | | | | | This requires GnuTLS >= 3.4.0. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Adapted to remove Samba AES support Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli/smb: Use gnutls_error_to_ntstatus() in smb2_signing_check_pdu()Andrew Bartlett2019-08-211-4/+4
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli:smb: Use GnuTLS AES128 CMAC in smb2_signing_check_pdu()Andreas Schneider2019-08-211-0/+38
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/smb: Use gnutls_error_to_ntstatus() in smb2_signing_sign_pdu()Andrew Bartlett2019-08-211-2/+2
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli:smb: Use GnuTLS AES128 CMAC in smb2_signing_sign_pdu()Andreas Schneider2019-08-211-0/+33
| | | | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Adapted by Andrew Bartlett to followup from earlier patch to allow compile without GnuTLS over the whole series. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Use a smb2_signing_key for storing the decryption keyAndreas Schneider2019-08-211-7/+16
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Use a smb2_signing_key for storing the encryption keyAndreas Schneider2019-08-211-10/+19
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Add gnutls_aead_cipher_hd_t to smb2_signing_key structureAndreas Schneider2019-08-212-0/+8
| | | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Adapted to remove Samba AES support Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Use GnuTLS for AES constantsAndreas Schneider2019-08-211-5/+2
| | | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Adapted to remove Samba AES support Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Define SMB2_AES_128_CCM_NONCE_SIZEAndreas Schneider2019-08-211-0/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth Check NTSTATUS from netlogon_creds_aes_{en,de}crypt()Andrew Bartlett2019-08-211-23/+53
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli:auth Return NTSTATUS from netlogon_creds_aes_decrypt()Andrew Bartlett2019-08-212-8/+11
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli:auth: Use GnuTLS AES128 CFB for netlogon_creds_aes_decrypt()Andreas Schneider2019-08-211-1/+40
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Return NTSTATUS for netlogon_creds_aes_encrypt()Andreas Schneider2019-08-212-8/+11
| | | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Adapted by Andrew Bartlett to use gnutls_error_to_ntstatus() Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Use GnuTLS AES128 CFB for netlogon_creds_aes_encrypt()Andreas Schneider2019-08-211-0/+36
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Use netlogon_creds_aes_encrypt() in netlogon_creds_step_crypt()Andreas Schneider2019-08-211-5/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Revert "libcli:auth: Use generate_secret_buffer() for netlogon challenge"Andreas Schneider2019-08-141-2/+1
| | | | | | This reverts commit c3ba556f52b15dd80efc26e4fb8f43ce2ee3a7f0. Reviewed-by: Alexander Bokovoy <ab@samba.org>
* libcli:auth: Use generate_secret_buffer() for netlogon challengeAndreas Schneider2019-08-121-1/+2
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Aug 12 10:42:35 UTC 2019 on sn-devel-184
* libcli:smb: Use generate_nonce_buffer() for AES-CCM and AES-GCM nonceAndreas Schneider2019-08-121-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:smb: Add forward declaration for gnutls_hmac_hd_tAndreas Schneider2019-08-101-3/+3
| | | | | | | | | This file is basically included everywhere. So use a forward declaration for gnutls_hmac_hd_t. This way we don't have to link everthing against gnutls to get access to the header path. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>