summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/netlogon.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r3104: My Win2k3 server, with current updates, still sends the LM key for ↵Andrew Bartlett1-1/+1
level 6. I'm not quite sure what's going on here, but adjust expected values till I can find out how to reproduce this the other way... Andrew Bartlett (This used to be commit 3f0f6b38f2401e3654f73f46a22d5c10fbacaeca)
2007-10-10r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots ↵Andrew Tridgell1-4/+3
of associated functions. The motivation for this change was to avoid having to convert to/from ucs2 strings for so many operations. Doing that was slow, used many static buffers, and was also incorrect as it didn't cope properly with unicode codepoints above 65536 (which could not be represented correctly as smb_ucs2_t chars) The two core functions that allowed this change are next_codepoint() and push_codepoint(). These functions allow you to correctly walk a arbitrary multi-byte string a character at a time without converting the whole string to ucs2. While doing this cleanup I also fixed several ucs2 string handling bugs. See the commit for details. The following code (which counts the number of occuraces of 'c' in a string) shows how to use the new interface: size_t count_chars(const char *s, char c) { size_t count = 0; while (*s) { size_t size; codepoint_t c2 = next_codepoint(s, &size); if (c2 == c) count++; s += size; } return count; } (This used to be commit 814881f0e50019196b3aa9fbe4aeadbb98172040)
2007-10-10r2552: Character set conversion and string handling updates.Andrew Bartlett1-5/+3
The intial motivation for this commit was to merge in some of the bugfixes present in Samba3's chrcnv and string handling code into Samba4. However, along the way I found a lot of unused functions, and decided to do a bit more... The strlen_m code now does not use a fixed buffer, but more work is needed to finish off other functions in str_util.c. These fixed length buffers hav caused very nasty, hard to chase down bugs at some sites. The strupper_m() function has a strupper_talloc() to replace it (we need to go around and fix more uses, but it's a start). Use of these new functions will avoid bugs where the upper or lowercase version of a string is a different length. I have removed the push_*_allocate functions, which are replaced by calls to push_*_talloc. Likewise, pstring and other 'fixed length' wrappers are removed, where possible. I have removed the first ('base pointer') argument, used by push_ucs2, as the Samba4 way of doing things ensures that this is always on an even boundary anyway. (It was used in only one place, in any case). (This used to be commit dfecb0150627b500cb026b8a4932fe87902ca392)
2007-10-10r2443: check return code of event_loop_once() to catch thet cases where the ↵Stefan Metzmacher1-1/+3
server closes the connetion and we got EBADF from select() and event_loop_once() fails metze (This used to be commit 9c0e50a6f3d628156b4543d5ded89e06be696f64)
2007-10-10r2220: Updates to the NETLOGON torture test. This copes with 'long'Andrew Bartlett1-125/+146
passwords - where the LM hash is invalid. Also, we now drive all the logon levels and validation levels from the outer loop, so we can check the expected return values (rather than overwriting them). Andrew Bartlett (This used to be commit f7f7c3de23ffb042f7cf7b4fa42b6b18c205719d)
2007-10-10r2185: add a callback function to the dcerpc async APIAndrew Tridgell1-4/+20
also add a demonstration of its use in the netlogon async example (This used to be commit f2a0438c66b999189c1a2ad726e91efd0748eb90)
2007-10-10r2181: an rpc async test on the netlogon pipeAndrew Tridgell1-0/+71
(This used to be commit 4c370c3c917f399497f936a2037ea2868b2196d2)
2007-10-10r2071: - change smbtorture to use the popt_common stuffStefan Metzmacher1-3/+5
this means -U DOM\\user is know allowed - torture:userdomain is a new smb.conf parameter because lp_workgroup is not the domain of the user - we use torture:userdomain now in the tests instad of lp_workgroup - for backward compat the userdomain is lp_workgroup() by default and not lp_netbios_name(), which my change later to match 'net' and 'smbclient'.. - we now have dublicate options e.g. -N -s ... tridge: can we change this? metze (This used to be commit 4733dcbf5f17422a8a4c9f99664270b3aa66c586)
2007-10-10r2035: Fix spelling.Andrew Bartlett1-1/+1
Andrew Bartlett (This used to be commit 4e2c5a5fb3e428ffcdeef3b95fab644a420cc20c)
2007-10-10r1995: a ndrdump file from abartlet make it clear that this isn't a pointerStefan Metzmacher1-3/+2
to a uint32, there're two uint32 with 0x00000000 metze (This used to be commit 80f27766cb6d2c4e00232f7e3d5cde75ad84d094)
2007-10-10r1647: destroy mem_ctxStefan Metzmacher1-1/+3
metze (This used to be commit 973ac69a012e579a09807d635061ff3550a10719)
2007-10-10r1498: (merge from 3.0)Andrew Bartlett1-5/+4
Rework our random number generation system. On systems with /dev/urandom, this avoids a change to secrets.tdb for every fork(). For other systems, we now only re-seed after a fork, and on startup. No need to do it per-operation. This removes the 'need_reseed' parameter from generate_random_buffer(). This also requires that we start the secrets subsystem, as that is where the reseed value is stored, for systems without /dev/urandom. In order to aviod identical streams in forked children, the random state is re-initialised after the fork(), at the same point were we do that to the tdbs. Andrew Bartlett (This used to be commit b97d3cb2efd68310b1aea8a3ac40a64979c8cdae)
2007-10-10r1189: Now that we use a common 'base' return structure for the SamLogonAndrew Bartlett1-37/+25
call, avoid code duplication in the torture suite. Andrew Bartlett (This used to be commit b6128c2a9d8e23dad0b14106f45a0638655d6cd7)
2007-10-10r1150: - fixed interactive sam logon in the rpc serverAndrew Tridgell1-11/+70
- added a torture test for interactive login in smbtorture These changes allow winxp to perform an interactive login (a login on the winxp console) against a Samba4 DC. Our netlogon server code is still filling in many of the fields incorrectly, but it fills in enough that winxp can login. (This used to be commit db9ea488b047b5f0f7538fd75fb7dde8277eb06b)
2007-10-10r1141: - consolidated the netr_SamInfo structures using a netr_SamBaseInfoAndrew Tridgell1-22/+22
structure (andrew, this is the type of structure consolidation I think you were asking about. It's possible here in NDR as it isn't in the top level fn code) - added validation level 6 in sam logon With these changes I can successfully authentication smbclient to a winxp server, with the winxp server using a Samba4 ADS DC for account auth (This used to be commit 705205083a6e2430c420f44436a1d1ff8826bc73)
2007-10-10r1140: added IDL and test code for validation level 6 in sam logonAndrew Tridgell1-5/+14
(This used to be commit c8541098436d2cd83538375889560405ecb50034)
2007-10-10r1137: - added torture test for netr_LogonGetDomainInfo() callAndrew Tridgell1-0/+59
(This used to be commit fdf6e4169d531c4a7d4e1b937abd3eb3af03c860)
2007-10-10r1061: The start of the SamLogon call for the NETLOGON pipe.Andrew Bartlett1-26/+30
Changes: - Check for a valid 'pipe_state' in netr_ServerAuthenticate3 before we dereference it - removes the expansionroom[7] in the netr_SamInfo* structs to 7 individual elements. - renames netr_SamInfo -> netr_SamInfo2 netr_SamInfo2 -> netr_SamInfo3 - Having the thing we always called an 'info3' being 'netr_SamInfo2' was just too confusing. - Expand and fill in extra details about users from the SAM, into the server_info, for processing into the SamLogon reply. - Add a dum_sid_dup() function to duplicate a struct dom_sid The SamLogon code currently does not return supplementary groups, and is only tested with Samba4 smbtorture. Andrew Bartlett (This used to be commit 6c92563b7961f15fc74b02601e105d5e1d04f04d)
2007-10-10r1058: The start of work on the SamLogon call for NETLOGON.Andrew Bartlett1-6/+6
This starts to store information about the user in the server_info struct - like the account name, the full name etc. Also, continue to make the names of the structure elements in the logon reply more consistant with those in the SAMR pipe. Andrew Bartlett (This used to be commit 3ccd96bd945e0fd95e42c69ad8ff07055af2e62b)
2007-10-10r1041: - pulled the domain join code out of the netlogon test and made it a ↵Andrew Tridgell1-174/+11
separate utility function, to allow multiple torture tests to temporarily join a domain - fixed a session key size problem - added a schannel test suite - allow schannel to work with ncacn_ip_tcp (This used to be commit 36f05e4d575099fcb957b8a55781c38dcd2e1177)
2007-10-10r1026: Spelling.Tim Potter1-1/+1
(This used to be commit b7fe73613acf5423b77fd91c56849351bf386960)
2007-10-10r1025: Rename (across the samr and netlogon pipes, so far)Andrew Bartlett1-21/+21
pwd -> password passwd -> password username -> account_name Also work on consistant structure feild names between these two pipes, and fix up some callers to use samr_Password for the netlogon credential code. Andrew Bartlett (This used to be commit 4e35418c2776f7b79be5b358ffd077754685d1ac)
2007-10-10r1009: Make all users of NT and LM passwords use the samr_Password structure.Andrew Bartlett1-1/+1
This includes the netlogon pipe, for the machine account password change system. Andrew Bartlett (This used to be commit 49d545a82057ee8b60d50aa55e908efe59875150)
2007-10-10r995: - renamed many of our crypto routines to use the industry standardAndrew Tridgell1-4/+8
names rather than our crazy naming scheme. So DES is now called des_crypt() rather than smbhash() - added the code from the solution of the ADS crypto challenge that allows Samba to correctly handle a 128 bit session key in all of the netr_ServerAuthenticateX() varients. A huge thanks to Luke Howard from PADL for solving this one! - restructured the server side rpc authentication to allow for other than NTLMSSP sign and seal. This commit just adds the structure, the next commit will add schannel server side support. - added 128 bit session key support to our client side code, and testing against w2k3 with smbtorture. Works well. (This used to be commit 729b2f41c924a0b435d44a14209e6dacc2304cee)
2007-10-10r961: convert 'uchar' to 'uint8_t'Stefan Metzmacher1-11/+11
metze (This used to be commit 9f914e4af99e18b469d4cf9d8b1514a2bd28ddec)
2007-10-10r950: - added netr_ServerAuthenticate3(). This is used by WinXP clients who ↵Andrew Tridgell1-10/+93
try to login to Samba4, as WinXP sees us as an ADS server. Unfortunately WinXP also uses a set of negotiate_flags that we don't support yet. Some crypto work needed. (This used to be commit 2d740b65706fb5b4ebc138587472a885d680517f)
2007-10-10r943: change samba4 to use 'uint8_t' instead of 'unsigned char'Stefan Metzmacher1-3/+3
metze (This used to be commit b5378803fdcb3b3afe7c2932a38828e83470f61a)
2007-10-10r937: - added a simple QuerySecurity implementation in samr serverAndrew Tridgell1-0/+28
- moved some sec desc defines into misc.idl - fixed pw_len field in UserInfo26 - made some pipes available on TCP - added netr_DsrEnumerateDomainTrusts() to netlogon - added templates for remaining netlogon IDL calls (from ethereal) - added a unistr_noterm vs unistr error detector in ndr basic decoder - added torture test for netr_DsrEnumerateDomainTrusts() (This used to be commit ae5a5113fb83640dcb9ae4642c1b9eaf28487956)
2007-10-10r890: convert samba4 to use [u]int8_t instead of [u]int8Stefan Metzmacher1-4/+4
metze (This used to be commit 2986c5f08c8f0c26a2ea7b6ce20aae025183109f)
2007-10-10r884: convert samba4 to use [u]int32_t instead of [u]int32Stefan Metzmacher1-9/+9
metze (This used to be commit 0e5517d937a2eb7cf707991d1c7498c1ab456095)
2007-10-10r874: This patch is a pile of work on NTLMSSP:Andrew Bartlett1-2/+3
Samba's NTLMSSP code is now fully talloc based, which should go a long way to cleaning up the memory leaks in this code. This also avoids a lot of extra copies of data, as we now allocate the 'return' blobs on a caller-supplied context. I have also been doing a lot of work towards NTLM2 signing and sealing. I have this working for sealing, but not for the verifier (MD5 integrity check on the stream) which is still incorrect. (I can aim a rpcecho sinkdata from a Win2k3 box to my server, and the data arrives intact, but the signature check fails. It does however match the test values I have...). The new torture test is cludged in - when we get a unit test suite back, I'll happliy put it in the 'right' place.... Andrew Bartlett (This used to be commit 399e2e2b1149b8d1c070aa7f0d5131c0b577d2b9)
2007-10-10r873: converted samba4 to use real 64 bit integers instead ofAndrew Tridgell1-10/+8
structures. This was suggested by metze recently. I checked on the build farm and all the machines we have support 64 bit ints, and support the LL suffix for 64 bit constants. I suspect some won't support strtoll() and related functions, so we will probably need replacements for those. (This used to be commit 9a9244a1c66654c12abe4379661cba83a73c4c21)
2007-10-10r816: - Make use of tridge's new samdb_result_sid_prefix() helper function.Andrew Bartlett1-8/+5
- Remove legacy sid_to_string (which contained a memleak) - Remove some unused parts of lib/util_sid.c Andrew Bartlett (This used to be commit 7c69a85984e47c004ddfd9bb5eadcb3191b56f9d)
2007-10-10r782: added torture test for level 6 logon level in netr_LogonSamLogonAndrew Tridgell1-104/+112
(This used to be commit 770322bfdfad7d7d33de0c5bc95bb0f51f7409c7)
2007-10-10r754: Implement the SetPassword operation on the netlogon pipe.Andrew Bartlett1-0/+2
This involves allowing the password set code in samdb to take an already hashed password, and some fixes to our torture code. Andrew Bartlett (This used to be commit f9f581b5804a20785df06cde157b23c952edc2ce)
2007-10-10r752: Remove debugging hack (make sure the cleanup test account after weAndrew Bartlett1-2/+5
leave) and test that the password change actually worked. Andrew Bartlett (This used to be commit a93c70154ac7126a7d6e638dcfdeef49d2966308)
2007-10-10r743: Start on a NETLOGON server in Samba4.Andrew Bartlett1-16/+25
Currently this only authentiates the machine, not real users. As a consequence of running the Samba4 NETLOGON test against Samba4, I found a number of issues in the SAMR server, which I have addressed. There are more templates in the provison.ldif for this reason. I also added some debug to our credentials code, and fixed some bugs in the auth_sam module. The static buffer in generate_random_string() bit me badly, so I removed it in favor of a talloc based system. Andrew Bartlett (This used to be commit 94624e519b66def97758b8a48a01ffe9029176f0)
2007-10-10r684: Note the fact that NTLMv2 provides a weath of futher testcases...Andrew Bartlett1-0/+1
Andrew Bartlett (This used to be commit d75558cdcbbb89dbe66287d7461b7abae14a8d36)
2007-10-10r610: - Merge the Samba3 'ntlm_auth --diagnostics' testsuite to Samba4.Andrew Bartlett1-55/+657
- This required using NETLOGON_NEG_AUTH2_FLAGS for the SetupCredentials2 negotiation flags, which is what Samba3 does, because otherwise the server uses different crypto. - This tests the returned session keys, which we decrypt. - Update the Samba4 notion of a 'session key' to be a DATA_BLOB in most places. - Fix session key code to return NT_STATUS_NO_SESSION_KEY if none is available. - Remove a useless argument to SMBsesskeygen_ntv1 - move netr_CredentialState from the .idl to the new credentials.h Andrew Bartlett (This used to be commit 44f8b5b53e6abd4de8a676f78d729988fadff320)
2007-10-10r582: added the LMSessKey in SamInfo and SamInfo2, thanks to work by abartletAndrew Tridgell1-14/+18
added test code for SamLogon validation level 2 and 3, so we test both SamInfo and SamInfo2 (This used to be commit 321dbb61cc0743379ceb6b8fff6a0ca37f308bc2)
2007-10-10r372: automatically create a fake BDC machine account and delete itAndrew Tridgell1-22/+188
afterwards for the RPC-NETLOGON test. This makes it much simpler to run the test and also means that it doesn't distrurb any existing domain join you might have. (This used to be commit feac996794d5cc16e3612fb2901668a9b1e1d274)
2007-10-10r133: don't try to do a database deltas with a -1 seq numAndrew Tridgell1-0/+4
(This used to be commit dcb172d207ca0b56e62165633b2f7f7fcc188f7c)
2004-02-03- add 'print' to the DCERPC binding stringsStefan Metzmacher1-2/+0
e.g. ncacn_np:myserver:[samr,sign,print] will now enable the packet debugging and the debugging is not bound anymore to the debuglevel >= 2 in the torture tests - also the dcesrv_remote module now supports debugging of the packets use the 'dcerpc_remote:binding' smb.conf parameter. metze (This used to be commit 40abf3c584efed7f977ddd688ea064540e5a5b13)
2003-12-02added netr_LogonControl2Ex()Andrew Tridgell1-1/+85
I also added IDL for netr_DatabaseRedo() but I don't yet know how it works thats the last of the netlogon IDL ! (This used to be commit 387d8f25ff4858943d1389974127d03a58bf4c8f)
2003-12-02added netr_DatabaseSync2()Andrew Tridgell1-0/+55
(This used to be commit 0f6af0c4bde0eb3758192b74dab797b558c944a1)
2003-12-02added netr_LogonControl2() and netr_ServerAuthenticate2()Andrew Tridgell1-3/+145
(This used to be commit cc4123db4baec6a217500dc55113f89e1ea8ef61)
2003-12-02added netr_LogonControl() and netr_GetAnyDCName()Andrew Tridgell1-5/+70
(This used to be commit 17b2be4e859bd7f625214d7e7de9758b5ab5fb90)
2003-12-02added netr_GetDcName() - quite a useful callAndrew Tridgell1-5/+30
(This used to be commit 63f46b223e16a3495b4a4a48c6489f1f0d7d84c4)
2003-12-02added netr_AccountSync(), another NT_STATUS_NOT_IMPLEMENTED callAndrew Tridgell1-1/+40
according to w2k3 (This used to be commit b2ca00ebc57774000af2de6132c29db4c6daae28)
2003-12-02added netr_AccountDeltas(), which w2k3 givesAndrew Tridgell1-0/+41
"NT_STATUS_NOT_IMPLEMENTED" for (This used to be commit aaf776a1c134d7b6112932f880e09ba497e8ebcf)