2003-01-13 15:48:37 +03:00
/*
Unix SMB / Netbios implementation .
Version 3.0
handle NLTMSSP , server side
Copyright ( C ) Andrew Tridgell 2001
2012-01-30 15:11:41 +04:00
Copyright ( C ) Andrew Bartlett 2001 - 2005 , 2011
Copyright ( C ) Stefan Metzmacher 2005
2003-01-13 15:48:37 +03:00
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-09 23:25:36 +04:00
the Free Software Foundation ; either version 3 of the License , or
2003-01-13 15:48:37 +03:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 04:52:41 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2003-01-13 15:48:37 +03:00
*/
# include "includes.h"
2011-03-25 04:28:05 +03:00
# include "auth.h"
2014-04-23 21:00:26 +04:00
# include "libcli/security/security.h"
2010-05-25 09:34:06 +04:00
2012-02-04 10:49:49 +04:00
NTSTATUS auth3_generate_session_info ( struct auth4_context * auth_context ,
TALLOC_CTX * mem_ctx ,
2012-01-30 15:11:41 +04:00
void * server_returned_info ,
const char * original_user_name ,
uint32_t session_info_flags ,
struct auth_session_info * * session_info )
2011-07-26 06:35:09 +04:00
{
2014-04-23 21:00:26 +04:00
struct auth_user_info_dc * user_info = NULL ;
struct auth_serversupplied_info * server_info = NULL ;
2011-07-26 06:35:09 +04:00
NTSTATUS nt_status ;
2011-07-27 07:34:34 +04:00
2014-04-23 21:00:26 +04:00
/*
* This is a hack , some callers . . .
*
* Some callers pass auth_user_info_dc , the SCHANNEL and
* NCALRPC_AS_SYSTEM gensec modules .
*
* While the reset passes auth3_check_password ( ) returned .
*/
user_info = talloc_get_type ( server_returned_info ,
struct auth_user_info_dc ) ;
if ( user_info ! = NULL ) {
const struct dom_sid * sid ;
int cmp ;
/*
* This should only be called from SCHANNEL or NCALRPC_AS_SYSTEM
*/
if ( user_info - > num_sids ! = 1 ) {
return NT_STATUS_INTERNAL_ERROR ;
}
sid = & user_info - > sids [ PRIMARY_USER_SID_INDEX ] ;
cmp = dom_sid_compare ( sid , & global_sid_System ) ;
if ( cmp = = 0 ) {
return make_session_info_system ( mem_ctx , session_info ) ;
}
cmp = dom_sid_compare ( sid , & global_sid_Anonymous ) ;
if ( cmp = = 0 ) {
2018-03-02 16:40:19 +03:00
return make_session_info_anonymous ( mem_ctx , session_info ) ;
2014-04-23 21:00:26 +04:00
}
return NT_STATUS_INTERNAL_ERROR ;
}
server_info = talloc_get_type_abort ( server_returned_info ,
struct auth_serversupplied_info ) ;
2011-07-27 07:34:34 +04:00
nt_status = create_local_token ( mem_ctx ,
2012-01-30 04:17:44 +04:00
server_info ,
2012-01-30 15:11:41 +04:00
NULL ,
original_user_name ,
2011-07-27 07:34:34 +04:00
session_info ) ;
2011-02-11 03:50:37 +03:00
if ( ! NT_STATUS_IS_OK ( nt_status ) ) {
DEBUG ( 10 , ( " create_local_token failed: %s \n " ,
nt_errstr ( nt_status ) ) ) ;
2011-07-26 06:35:09 +04:00
return nt_status ;
2010-05-25 09:34:06 +04:00
}
2011-07-26 06:35:09 +04:00
return NT_STATUS_OK ;
}
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
/**
* Return the challenge as determined by the authentication subsystem
* @ return an 8 byte random challenge
*/
2012-01-30 15:11:41 +04:00
NTSTATUS auth3_get_challenge ( struct auth4_context * auth4_context ,
2009-12-29 13:57:28 +03:00
uint8_t chal [ 8 ] )
2003-01-13 15:48:37 +03:00
{
2012-01-30 15:11:41 +04:00
struct auth_context * auth_context = talloc_get_type_abort ( auth4_context - > private_data ,
struct auth_context ) ;
2012-02-03 14:58:44 +04:00
auth_get_ntlm_challenge ( auth_context , chal ) ;
2009-12-29 13:57:28 +03:00
return NT_STATUS_OK ;
2003-01-13 15:48:37 +03:00
}
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
/**
2005-06-28 02:06:18 +04:00
* NTLM2 authentication modifies the effective challenge ,
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
* @ param challenge The new challenge value
*/
2012-01-30 15:11:41 +04:00
NTSTATUS auth3_set_challenge ( struct auth4_context * auth4_context , const uint8_t * chal ,
const char * challenge_set_by )
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
{
2012-01-30 15:11:41 +04:00
struct auth_context * auth_context = talloc_get_type_abort ( auth4_context - > private_data ,
struct auth_context ) ;
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
2010-04-11 14:20:24 +04:00
auth_context - > challenge = data_blob_talloc ( auth_context ,
2012-01-30 15:11:41 +04:00
chal , 8 ) ;
NT_STATUS_HAVE_NO_MEMORY ( auth_context - > challenge . data ) ;
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
2012-01-30 15:11:41 +04:00
auth_context - > challenge_set_by = talloc_strdup ( auth_context , challenge_set_by ) ;
NT_STATUS_HAVE_NO_MEMORY ( auth_context - > challenge_set_by ) ;
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
DEBUG ( 5 , ( " auth_context challenge set by %s \n " , auth_context - > challenge_set_by ) ) ;
DEBUG ( 5 , ( " challenge is: \n " ) ) ;
2007-03-28 17:34:59 +04:00
dump_data ( 5 , auth_context - > challenge . data , auth_context - > challenge . length ) ;
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
return NT_STATUS_OK ;
}
/**
* Check the password on an NTLMSSP login .
*
* Return the session keys used on the connection .
*/
2012-01-30 15:11:41 +04:00
NTSTATUS auth3_check_password ( struct auth4_context * auth4_context ,
TALLOC_CTX * mem_ctx ,
const struct auth_usersupplied_info * user_info ,
2017-03-17 13:52:51 +03:00
uint8_t * pauthoritative ,
2012-01-30 15:11:41 +04:00
void * * server_returned_info ,
DATA_BLOB * session_key , DATA_BLOB * lm_session_key )
2003-01-13 15:48:37 +03:00
{
2012-01-30 15:11:41 +04:00
struct auth_context * auth_context = talloc_get_type_abort ( auth4_context - > private_data ,
struct auth_context ) ;
struct auth_usersupplied_info * mapped_user_info = NULL ;
2012-01-30 04:17:44 +04:00
struct auth_serversupplied_info * server_info ;
2003-01-15 23:39:33 +03:00
NTSTATUS nt_status ;
2007-10-19 04:40:25 +04:00
bool username_was_mapped ;
2017-03-17 13:52:51 +03:00
/*
* Be authoritative by default .
*/
* pauthoritative = 1 ;
2003-01-13 15:48:37 +03:00
2012-02-15 07:51:35 +04:00
/* The client has given us its machine name (which we only get over NBT transport).
We need to possibly reload smb . conf if smb . conf includes depend on the machine name . */
2003-01-13 15:48:37 +03:00
2012-01-30 15:11:41 +04:00
set_remote_machine_name ( user_info - > workstation_name , True ) ;
2003-01-13 15:48:37 +03:00
2003-01-15 23:39:33 +03:00
/* setup the string used by %U */
/* sub_set_smb_name checks for weird internally */
2012-01-30 15:11:41 +04:00
sub_set_smb_name ( user_info - > client . account_name ) ;
2003-01-13 15:48:37 +03:00
2014-07-30 19:00:36 +04:00
lp_load_with_shares ( get_dyn_CONFIGFILE ( ) ) ;
2003-01-13 15:48:37 +03:00
2014-03-27 00:17:15 +04:00
nt_status = make_user_info_map ( talloc_tos ( ) ,
& mapped_user_info ,
2012-01-30 15:11:41 +04:00
user_info - > client . account_name ,
user_info - > client . domain_name ,
user_info - > workstation_name ,
user_info - > remote_host ,
2017-02-24 03:29:12 +03:00
user_info - > local_host ,
2017-02-20 04:52:07 +03:00
user_info - > service_description ,
2012-01-30 15:11:41 +04:00
user_info - > password . response . lanman . data ? & user_info - > password . response . lanman : NULL ,
user_info - > password . response . nt . data ? & user_info - > password . response . nt : NULL ,
2004-04-03 19:41:32 +04:00
NULL , NULL , NULL ,
2010-06-01 15:52:01 +04:00
AUTH_PASSWORD_RESPONSE ) ;
2003-01-13 15:48:37 +03:00
2003-01-15 23:39:33 +03:00
if ( ! NT_STATUS_IS_OK ( nt_status ) ) {
return nt_status ;
2003-01-13 15:48:37 +03:00
}
2012-01-30 15:11:41 +04:00
mapped_user_info - > logon_parameters = user_info - > logon_parameters ;
2010-11-10 00:24:03 +03:00
2012-01-30 15:11:41 +04:00
mapped_user_info - > flags = user_info - > flags ;
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
2014-02-18 13:19:57 +04:00
nt_status = auth_check_ntlm_password ( mem_ctx ,
auth_context ,
mapped_user_info ,
2017-03-17 11:43:59 +03:00
& server_info ,
2017-03-17 13:52:51 +03:00
pauthoritative ) ;
2006-05-06 23:24:35 +04:00
2012-01-31 05:53:30 +04:00
if ( ! NT_STATUS_IS_OK ( nt_status ) ) {
2017-03-17 11:43:59 +03:00
DEBUG ( 5 , ( " Checking NTLMSSP password for %s \\ %s failed: "
" %s, authoritative=%u \n " ,
2012-01-31 05:53:30 +04:00
user_info - > client . domain_name ,
user_info - > client . account_name ,
2017-03-17 11:43:59 +03:00
nt_errstr ( nt_status ) ,
2017-03-17 13:52:51 +03:00
* pauthoritative ) ) ;
2012-01-31 05:53:30 +04:00
}
2012-01-30 15:11:41 +04:00
username_was_mapped = mapped_user_info - > was_mapped ;
2014-03-27 00:17:15 +04:00
TALLOC_FREE ( mapped_user_info ) ;
2003-01-13 15:48:37 +03:00
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
if ( ! NT_STATUS_IS_OK ( nt_status ) ) {
2014-02-18 16:52:49 +04:00
nt_status = do_map_to_guest_server_info ( mem_ctx ,
nt_status ,
2012-01-30 15:11:41 +04:00
user_info - > client . account_name ,
2014-02-18 16:52:49 +04:00
user_info - > client . domain_name ,
& server_info ) ;
2015-07-17 11:54:17 +03:00
if ( NT_STATUS_IS_OK ( nt_status ) ) {
2017-03-17 13:52:51 +03:00
* pauthoritative = 1 ;
2015-07-17 11:54:17 +03:00
* server_returned_info = talloc_steal ( mem_ctx , server_info ) ;
}
2011-07-26 06:35:09 +04:00
return nt_status ;
2011-08-02 05:28:51 +04:00
}
2012-01-30 04:17:44 +04:00
server_info - > nss_token | = username_was_mapped ;
2006-05-06 23:24:35 +04:00
2010-09-16 08:37:20 +04:00
/* Clear out the session keys, and pass them to the caller.
* They will not be used in this form again - instead the
* NTLMSSP code will decide on the final correct session key ,
2011-08-02 05:29:43 +04:00
* and supply it to create_local_token ( ) */
2012-01-30 15:11:41 +04:00
if ( session_key ) {
2005-09-30 21:13:37 +04:00
DEBUG ( 10 , ( " Got NT session key of length %u \n " ,
2012-01-30 04:17:44 +04:00
( unsigned int ) server_info - > session_key . length ) ) ;
* session_key = server_info - > session_key ;
talloc_steal ( mem_ctx , server_info - > session_key . data ) ;
server_info - > session_key = data_blob_null ;
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
}
2012-01-30 15:11:41 +04:00
if ( lm_session_key ) {
2005-09-30 21:13:37 +04:00
DEBUG ( 10 , ( " Got LM session key of length %u \n " ,
2012-01-30 04:17:44 +04:00
( unsigned int ) server_info - > lm_session_key . length ) ) ;
* lm_session_key = server_info - > lm_session_key ;
talloc_steal ( mem_ctx , server_info - > lm_session_key . data ) ;
server_info - > lm_session_key = data_blob_null ;
Changes all over the shop, but all towards:
- NTLM2 support in the server
- KEY_EXCH support in the server
- variable length session keys.
In detail:
- NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).
* This is known as 'NTLMv2 session security' *
(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes. We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)
This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed. This also needs to be turned off for
'security=server', which does not support this.
- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.
- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.
- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation.
- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.
- The other big change is to allow variable length session keys. We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter. However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.
* This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *
- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe. This
should help reduce some of the 'it just doesn't work' issues.
- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer. (just allocate)
REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc)
2003-11-22 16:19:38 +03:00
}
2012-01-30 15:11:41 +04:00
* server_returned_info = talloc_steal ( mem_ctx , server_info ) ;
return nt_status ;
}