summaryrefslogtreecommitdiffstats
path: root/source4/auth/ntlmssp/ntlmssp_server.c
Commit message (Collapse)AuthorAgeFilesLines
* auth: Move the rest of the source4 gensec_ntlmssp code to the top levelAndrew Bartlett2012-02-171-357/+0
| | | | | | | | | | The ntlmssp_server code will be in common shortly, and aside from a symbol name or two, moving the client code causes no harm and makes less mess. We will also get the client code in common very soon. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
* auth: Pass in the SMB username (for %U) into generate_session_infoAndrew Bartlett2012-02-131-0/+1
| | | | | | | | | This matches what Samba3 does. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Mon Feb 13 01:25:59 CET 2012 on sn-devel-104
* gensec: inline gensec_generate_session_info() into only callerAndrew Bartlett2012-01-301-6/+18
| | | | | | | | | | | | | | This avoids casting to and from the struct auth_user_info_dc *user_info_dc to to this, the if (user_info_dc->info->authenticated) is moved into auth_generate_session_info_wrapper(), which is the function that gensec_security->auth_context->generate_session_info points to. Andrew Bartlett
* s4-auth: Return NT_STATUS_NOT_IMPLEMENTED if the challenge cannot be obtainedAndrew Bartlett2012-01-301-1/+1
|
* auth: Make check_password and generate_session_info hook genericAndrew Bartlett2012-01-301-17/+8
| | | | | | | | gensec_ntlmssp does not need to know the internal form of the struct user_info_dc or auth_serversupplied_info. This will allow the calling logic to be put in common. Andrew Bartlett
* s4:auth: Make sure to check the optional auth_context hooks before using themAndrew Bartlett2012-01-111-18/+26
| | | | | | | | | | | | These are optional to supply - some callers only provide an auth_context for the other plugin functions, and so we need to deal with this cleanly. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed Jan 11 10:49:13 CET 2012 on sn-devel-104
* s4-auth: match the new s3 gensec client and always negotiate SIGN with SEALAndrew Bartlett2011-10-181-0/+1
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* ntlmssp: Prepare gensec_ntlmssp_start() for broader useAndrew Bartlett2011-10-181-2/+14
| | | | | | | | This moves the allocation of the ntlmssp pointer back to the callers. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
* ntlmssp: Move ntlmssp code to auth/ntlmsspAndrew Bartlett2011-10-181-2/+3
| | | | | | | | | This brings in the code from both libcli/auth and source4/auth/ntlmssp. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s4:auth - remove unused variablesMatthias Dieter Wallnöfer2011-09-191-1/+0
| | | | Reviewed-by: Jelmer
* gensec: Don't keep a second copy of the auth4_context in gensec_ntlmssp_stateAndrew Bartlett2011-08-031-6/+4
| | | | | | | | | The auth4_context is already in the gensec_security structure, which is available by de-reference here anyway. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* gensec: clarify memory ownership for gensec_session_info() and ↵Andrew Bartlett2011-08-031-6/+4
| | | | | | | | | | | | | | | gensec_session_key() This is slightly less efficient, because we no longer keep a cache on the gensec structures, but much clearer in terms of memory ownership. Both gensec_session_info() and gensec_session_key() now take a mem_ctx and put the result only on that context. Some duplication of memory in the callers (who were rightly uncertain about who was the rightful owner of the returned memory) has been removed to compensate for the internal copy. Andrew Bartlett
* s4:auth/ntlmssp/ntlmssp_server.c - add "const" in front of "dnsdomain"Matthias Dieter Wallnöfer2011-05-211-1/+1
| | | | Signed-off-by: Metze
* s4-auth Rename auth -> auth4 to avoid conflict with s3 authAndrew Bartlett2011-05-081-4/+4
|
* Remove strlower_m() and strupper_m() from source4 and common code.Andrew Bartlett2011-05-031-14/+14
| | | | | | | | | This function is problematic because a string may expand in size when changed into upper or lower case. This will then push characters off the end of the string in the s3 implementation, or panic in the former s4 implementation. Andrew Bartlett
* s4-auth Rework auth subsystem to remove struct auth_serversupplied_infoAndrew Bartlett2011-02-091-10/+10
| | | | | | | | | | | | | This changes auth_serversupplied_info into the IDL-defined struct auth_user_info_dc. This then in turn contains a struct auth_user_info, which is the only part of the structure that is mainted into the struct session_info. The idea here is to avoid keeping the incomplete results of the authentication (such as session keys, lists of SID memberships etc) in a namespace where it may be confused for the finalised results. Andrew Barltett
* s4:auth/ntlmssp/ntlmssp_server.c - remove unnecessary ";"Matthias Dieter Wallnöfer2010-11-291-1/+1
|
* libcli/auth/ntlmssp Be clear about talloc parents for session keysAndrew Bartlett2010-09-161-0/+5
| | | | | | | | | | The previous API was not clear as to who owned the returned session key. This fixes a valgrind-found use-after-free in the NTLMSSP key derivation code, and avoids making allocations - we steal and zero instead. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s4:auth Move struct auth_usersupplied_info to a common locationAndrew Bartlett2010-08-141-1/+1
| | | | | | | | | This also changes the calling convention slightly - we should always allocate this with talloc_zero() to allow some elements to be optional. Some elements may only make sense in Samba3, which I hope will use this common structure. Andrew Bartlett
* libcli/auth Make the source3/ implementation of the NTLMSSP server commonAndrew Bartlett2010-08-101-520/+1
| | | | | | | | | This means that the core logic (but not the initialisation) of the NTLMSSP server is in common, but uses different authentication backends. Andrew Bartlett Signed-off-by: Günther Deschner <gd@samba.org>
* libcli/auth Move some source3/ NTLMSSP functions to the common code.Andrew Bartlett2010-08-101-30/+0
| | | | | | | | libcli/auth Use true and false rather than True and False in common code Andrew Bartlett Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp Merge more aspects of the source3/ NTLMSSP layerAndrew Bartlett2010-08-071-20/+21
| | | | | | | | | | | | This changes the talloc treatment of the session keys to avoid memory duplication - the session key has always been allocated onto the ntlmssp_context by the auth subsystem callback. The remainder of the changes are cosmetics, such as avoiding using lm_session_key as a pointer (and avoiding then doing an if statement on something that is always true). Andrew Bartlett
* s4:ntlmssp Re-add gensec_ntlmssp wrapper to allow merge with source3/Andrew Bartlett2010-08-071-18/+52
| | | | | | | | | By re-adding this wrapper, the actual guts of these functions are now very similar to that found in source3/libsmb/ntlmssp.c This should make it easier to merge the implementations. Andrew Bartlett
* s4:ntlmssp Always setup the session keys and signing stateAndrew Bartlett2010-08-071-9/+1
| | | | | | | | | | While it would save some CPU to only setup the session key when requested (like windows does), this instead matches the implementation in source3/libsmb/ntlmssp.c We could re-add this later after the codebase is merged. Andrew Bartlett
* s4:ntlmssp Adjust Samba4 ntlmssp code to look more like the code in Samba3.Andrew Bartlett2010-08-061-70/+118
| | | | | | | | This does not change behaviour, and some of the whitespace isn't ideal, but at the moment making this code more similar, even in cosmetics, will assist later merge efforts. Andrew Bartlett
* s4-loadparm: 2nd half of lp_ to lpcfg_ conversionAndrew Tridgell2010-07-161-5/+5
| | | | | | | this converts all callers that use the Samba4 loadparm lp_ calling convention to use the lpcfg_ prefix. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s4:ntlmssp Merge ntlmssp structures with version from source3/Andrew Bartlett2010-06-011-69/+9
| | | | | | | Use this as an excuse to get rid of ntlmssp_set_domain() etc, which don't do anything useful now that msrpc_parse() use talloc anyway. Andrew Bartlett
* Add in support for the NTLMSSP version reply.Jeremy Allison2010-05-241-3/+30
| | | | Jeremy.
* s4:auth Change auth_generate_session_info to take an auth contextAndrew Bartlett2010-04-141-5/+5
| | | | | | | | | | | | | | | | | | The auth context was in the past only for NTLM authentication, but we need a SAM, an event context and and loadparm context for calculating the local groups too, so re-use that infrustructure we already have in place. However, to avoid problems where we may not have an auth_context (in torture tests, for example), allow a simpler 'session_info' to be generated, by passing this via an indirection in gensec and an generate_session_info() function pointer in the struct auth_context. In the smb_server (for old-style session setups) we need to change the async context to a new 'struct sesssetup_context'. This allows us to use the auth_context in processing the authentication reply . Andrew Bartlett
* s4:ntlmssp: move doing_ntlm2 to ntlmssp_server_auth_stateStefan Metzmacher2010-03-241-2/+3
| | | | | | metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: move NTLM2 session_nonce to ntlmssp_server_auth_stateStefan Metzmacher2010-03-241-5/+7
| | | | | | metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: move encrypted_session_key to ntlmssp_server_auth_stateStefan Metzmacher2010-03-241-26/+19
| | | | | | metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: keep a ntlmssp_server_auth_state to transport variables from ↵Stefan Metzmacher2010-03-241-10/+23
| | | | | | | | preauth to postauth hooks metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: remove unused server_multiple_authentications feature.Stefan Metzmacher2010-03-241-11/+1
| | | | | | metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: rename gensec_ntlmssp_state => ntlmssp_stateStefan Metzmacher2010-03-241-164/+164
| | | | | | | | Inspired by the NTLMSSP merge work by Andrew Bartlett. metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: calculate server names at startup and store them in ↵Stefan Metzmacher2010-03-241-24/+33
| | | | | | | | | | (gensec_)ntlmssp_state->server.* Inspired by the NTLMSSP merge work by Andrew Bartlett. metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: replace server_role by a server.is_standalone in ↵Stefan Metzmacher2010-03-241-2/+6
| | | | | | | | | | (gensec_)ntlmssp_state Inspired by the NTLMSSP merge work by Andrew Bartlett. metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: keep struct gensec_ntlmssp_context in gensec_security->private_dataStefan Metzmacher2010-03-241-8/+16
| | | | | | | | Inspired by the NTLMSSP merge work by Andrew Bartlett. metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: remove gensec_security from (gensec_)ntlmssp_stateStefan Metzmacher2010-03-241-1/+1
| | | | | | | | Inspired by the NTLMSSP merge work by Andrew Bartlett. metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: remove backend specifix stuff from (gensec_)ntlmssp_stateStefan Metzmacher2010-03-241-19/+46
| | | | | | | | Inspired by the NTLMSSP merge work by Andrew Bartlett. metze Signed-off-by: Günther Deschner <gd@samba.org>
* s4:ntlmssp: remove mem_ctx from check_password() callback to match s3Stefan Metzmacher2009-12-291-4/+2
| | | | metze
* s4:ntlmssp_server: always call ntlmssp_server_postauth() and decide there if ↵Stefan Metzmacher2009-12-291-5/+11
| | | | | | it's a noop metze
* s4:ntlmssp_server: don't use a mem_ctx for ntlmssp_server_auth()Stefan Metzmacher2009-12-291-13/+7
| | | | metze
* s4:ntlmssp_server: don't use mem_ctx in auth_ntlmssp_check_password()Stefan Metzmacher2009-12-291-16/+8
| | | | metze
* s4:ntlmssp_server: clear session key in ntlmssp_server_preauth()Stefan Metzmacher2009-12-291-3/+1
| | | | metze
* s4:ntlmssp: use data_blob_null in ntlmssp_server_auth()Stefan Metzmacher2009-12-291-4/+6
| | | | metze
* s4:ntlmssp_server: remove unused variableStefan Metzmacher2009-12-291-7/+0
| | | | metze
* s4:auth/ntlmssp: let get_challenge() return a NTSTATUS and fill a stack bufferStefan Metzmacher2009-12-291-12/+11
| | | | metze
* s4:auth Change 'get_challenge' API to be more like Samba3Andrew Bartlett2009-12-221-2/+5
| | | | | | | It is just easier to fill in the known to be 8 byte challenge than stuff about with allocated pointers. Andrew Bartlett
* s4-gensec: Replace gensec_get_peer_addr with new tsocket based fn.Andreas Schneider2009-12-161-1/+2
|