summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* s4/scripting/bin/renamedc: Fix up rename DC scriptAndrew Bartlett2015-02-251-34/+26
| | | | | | | We now have a reliable handler for backlinks so this we can now rename both objects Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* lib/crypto: Document nettle supported cryptoMichael Ledford2015-02-251-0/+21
| | | | | | Signed-off-by: Michael Ledford <michael@ledford.cc> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Explain more why we use GnuTLS hereAndrew Bartlett2015-02-251-0/+20
| | | | | | Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* build: amend typo for address sanitizer helpGarming Sam2015-02-251-1/+1
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture-backupkey: Check the dcerpc call return code before calling ndr pullGarming Sam2015-02-251-3/+5
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* backupkey: replace heimdal rsa key generation with GnuTLSGarming Sam2015-02-251-44/+82
| | | | | | | | | | | We use GnuTLS because it can reliably generate 2048 bit keys every time. Windows clients strictly require 2048, no more since it won't fit and no less either. Heimdal would almost always generate a smaller key. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=10980
* build: Require GnuTLS if building with Active DirectoryGarming Sam2015-02-251-0/+3
| | | | | | | | | Without GnuTLS, we don't have ldaps:// support and we are unable to readily create RSA keys of the correct length for the BackupKey protocol. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture-backupkey: Add tests that read the secret from the server, and validateAndrew Bartlett2015-02-251-9/+312
| | | | | | | | | These show that MS-BKRP 3.1.4.1.1 BACKUPKEY_BACKUP_GUID is incorrect when it states that the key must be the leading 64 bytes, it must be the whole 256 byte buffer. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Better handling for different wrap version headersAndrew Bartlett2015-02-252-12/+25
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Add tests for ServerWrap protocolAndrew Bartlett2015-02-251-2/+645
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Change expected error codes to match Windows 2008R2 and Windows ↵Andrew Bartlett2015-02-252-4/+11
| | | | | | | | | 2012R2 This is done in both smbtoture and in our server Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Implement ServerWrap DecryptAndrew Bartlett2015-02-251-51/+186
| | | | | | | | | | | We implement both modes in BACKUPKEY_RESTORE_GUID, as it may decrypt both ServerWrap and ClientWrap data, and we implement BACKUPKEY_RESTORE_GUID_WIN2K. BUG: https://bugzilla.samba.org/attachment.cgi?bugid=11097 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Handle more clearly the case where we find the secret, but it has ↵Andrew Bartlett2015-02-251-45/+33
| | | | | | | | | no value This happen on the RODC, a case that we try not to permit at all. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Improve variable names to make clear this is client-provided dataAndrew Bartlett2015-02-251-13/+13
| | | | | | | The values we return here are client-provided passwords or other keys, that we decrypt for them. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Use the name lsa_secret rather than just secretAndrew Bartlett2015-02-251-20/+20
| | | | | | | | This makes it clear that this is the data stored on the LSA secrets store and not the client-provided data to be encrypted. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Implement ServerWrap Encrypt protocolAndrew Bartlett2015-02-251-13/+299
| | | | | | | BUG: https://bugzilla.samba.org/attachment.cgi?bugid=11097 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Improve function names and comments for clarityAndrew Bartlett2015-02-251-8/+34
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Move SID comparison to inside get_and_verify_access_check()Andrew Bartlett2015-02-251-29/+26
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* backupkey: Improve IDLGarming Sam2015-02-251-7/+7
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* backupkey: begin by factoring out the server wrap functionsGarming Sam2015-02-251-3/+15
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture-backupkey: Assert dcerpc_bkrp_BackupKey_r call was successfulAndrew Bartlett2015-02-251-0/+6
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* torture-backupkey: Add consistent assertions that createRestoreGUIDStruct() ↵Andrew Bartlett2015-02-251-1/+12
| | | | | | | suceeds Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4:torture/rpc/backupkey: Require 2048 bit RSA keyArvid Requate2015-02-251-0/+75
| | | | | | | | | | | Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (fixed cleanup of memory) Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: consistent naming of werr variableArvid Requate2015-02-251-10/+10
| | | | | | Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: improve variable nameArvid Requate2015-02-251-2/+2
| | | | | | Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: typo fixArvid Requate2015-02-251-2/+2
| | | | | | Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: IDL for ServerWrap subprotocolArvid Requate2015-02-252-1/+37
| | | | | | | | | | This adds some IDL structs for the ServerWrap subprotocol, allowing parsing of the incoming RPC calls and returning WERR_NOT_SUPPORTED instead of WERR_INVALID_PARAM. Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: fix ndr_pull error on empty inputArvid Requate2015-02-251-1/+4
| | | | | | | | | | [MS-BKRP] 3.1.4.1 specifies for BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID that the server must ignore the input data. This patch fixes ndr_pull_error(11): Pull bytes 4 (../librpc/ndr/ndr_basic.c:148) Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: Initialize ndr->switchlist for printArvid Requate2015-02-251-0/+5
| | | | | | | | | ndr_print_bkrp_data_in_blob requires the level to be set in the proper ndr->switch_list context. Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: Comply with [MS-BKRP] 2.2.1Arvid Requate2015-02-251-2/+1
| | | | | | | | | | | | | | [MS-BKRP] 2.2.1 specifies "The Common Name field of the Subject name field SHOULD contain the name of the DNS domain assigned to the server." In fact Windows 7 clients don't seem to care. Also in certificates generated by native AD the domain name (after CN=) is encoded as UTF-16LE. Since hx509_parse_name only supports UTF-8 strings currently we just leave the encoding as it is for now. Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: Set defined cert serialnumberArvid Requate2015-02-251-1/+22
| | | | | | | | | | | | [MS-BKRP] 2.2.1 specifies that the serialnumber of the certificate should be set identical to the subjectUniqueID. In fact certificates generated by native AD have this field encoded in little-endian format. See also https://www.mail-archive.com/cifs-protocol@cifs.org/msg01364.html Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: de-duplicate error handlingArvid Requate2015-02-251-39/+20
| | | | | | Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: check for talloc failureArvid Requate2015-02-251-0/+3
| | | | | | | | Check for talloc_memdup failure for uniqueid.data. Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: Cert lifetime of 365 days, not secsArvid Requate2015-02-251-1/+1
| | | | | | | | | | | | | | | hx509_ca_tbs_set_notAfter_lifetime expects the lifetime value in in seconds. The Windows 7 client didn't seem to care that the lifetime was only 6'03''. Two other TODOs in this implementation: * Since notBefore is not set explicietely to "now", the heimdal code default of now-(24 hours) is applied. * Server side validity checks and cert renewal are missing. Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-backupkey: Ensure RSA modulus is 2048 bitsArvid Requate2015-02-251-5/+10
| | | | | | | | | | | | | | | | | | | RSA_generate_key_ex doesn't always generate a modulus of requested bit length. Tests with Windows 7 clients showed that they decline x509 certificates (MS-BKRP 2.2.1) in cases where the modulus length is smaller than the specified 2048 bits. For the user this resulted in DPAPI failing to retrieve stored credentials after the user password has been changed at least two times. On the server side log.samba showed that the client also called the as yet unlimplemented ServerWrap sub- protocol function BACKUPKEY_BACKUP_KEY_GUID after it had called the ClientWarp function BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID. After enabling DPAPI auditing on the Windows Clients the Event Viewer showed Event-ID 4692 failing with a FailureReason value of 0x7a in these cases. Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=10980
* wafsamba: make sure build fails when uninitialized variable is detectedAlexander Bokovoy2015-02-241-0/+2
| | | | | | | | | | | In developer build, fail if uninitialized variable is found by GCC. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Feb 24 20:21:52 CET 2015 on sn-devel-104
* lib: Use iov_buflen in smb1cli_req_chain_submitVolker Lendecke2015-02-241-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Use iov_buflen in smb1cli_req_writev_submitVolker Lendecke2015-02-241-1/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Use iov_buflen in smb1cli_req_createVolker Lendecke2015-02-241-1/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Use iov_buf in smbXcli_iov_concatVolker Lendecke2015-02-241-9/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: Use iov_buflen in smbXcli_iov_lenVolker Lendecke2015-02-242-7/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix a typoVolker Lendecke2015-02-241-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smb2_server: Use iov_advanceVolker Lendecke2015-02-241-24/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smb2_server: Add range checking to nbt_lengthVolker Lendecke2015-02-241-13/+48
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tsocket: Use iov_advanceVolker Lendecke2015-02-242-51/+18
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* iov_buf: Add an explaining commentVolker Lendecke2015-02-241-0/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tsocket: Fix a typoVolker Lendecke2015-02-241-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Move "iov_buf.[ch]" to lib/utilVolker Lendecke2015-02-2411-12/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* rpc: Use tevent_req_poll_ntstatusVolker Lendecke2015-02-241-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb-io: Do not use sys_write to write to client socketsAmitay Isaacs2015-02-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | When sending messages to clients, ctdb checks for EAGAIN error code and schedules next write in the subsequent event loop. Using sys_write in these places causes ctdb to loop hard till a client is able to read from the socket. With real time scheduling, ctdb daemon spins consuming 100% of CPU trying to write to the client sockets. This can be quite harmful when running under VMs or machines with single CPU. This regression was introduced when all read/write calls were replaced to use sys_read/sys_write wrappers (c1558adeaa980fb4bd6177d36250ec8262e9b9fe). The existing code backs off in case of EAGAIN failures and waits for an event loop to process the write again. This should give ctdb clients a chance to get scheduled and to process the ctdb socket. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Tue Feb 24 12:29:30 CET 2015 on sn-devel-104