1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

3766 Commits

Author SHA1 Message Date
Andrew Bartlett
f1452a2964 s3-libsmb: Initialise ticket to ensure we do not invalid memory
The free is however a talloc_free(), which has additional protection against
freeing the wrong thing.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Mar  2 01:45:19 CET 2012 on sn-devel-104
2012-03-02 01:45:19 +01:00
Jeremy Allison
049375ec51 Move to talloc from malloc. 2012-03-01 15:05:56 -08:00
Jeremy Allison
e735b52254 Fix mixup between talloc/malloc. 2012-03-01 15:05:56 -08:00
Michael Adam
727f3ee6ac s3:libsmb:smb2: pass previous session ID to session setup, not previous session
We only need the session, and under some circumstances, it might complicate
things for the caller to have to cope with the whole structure (talloc...).
2012-02-28 00:08:52 +01:00
Stefan Metzmacher
aa4331be9e libcli/smb/smbXcli: maintain smb2 channel_signing_key separate from the signing_key
The signing_key is fix across all channels and is used for session setups
on a channel binding.

Note:
 - the last session setup response is signed with the new channel signing key.
 - the reauth session setups are signed with the channel signing key.

It's also not needed to remember the main session key.

metze
2012-02-27 12:51:33 +01:00
Volker Lendecke
02ba9095e2 s3: Remove pointless parentheses
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sun Feb 26 11:10:15 CET 2012 on sn-devel-104
2012-02-26 11:10:15 +01:00
Andrew Bartlett
cab24da68d s3-libsmb: Remove unused spnego_parse_auth_and_mic 2012-02-24 15:43:03 +11:00
Andrew Bartlett
a61298e802 s3-libsmb: Remove unused ntlmssp_server_start() 2012-02-24 11:23:18 +11:00
Andrew Bartlett
bea05159e4 s3-libsmb: Remove unused spnego functions 2012-02-23 16:14:19 +11:00
Jeremy Allison
21528da9cd Fix a bunch of "unused variable" warnings.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 18 06:22:40 CET 2012 on sn-devel-104
2012-02-18 06:22:40 +01:00
Andrew Bartlett
f433baa3c8 auth: Make more of the ntlmssp code private or static
Now that there is only one gensec_ntlmssp server, some of these functions can be static

For the rest, put the implemtnation of the gensec_ntlmssp code into ntlmssp_private.h

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-02-17 10:48:10 +01:00
Andrew Bartlett
52ac479764 auth: Move the rest of the source4 gensec_ntlmssp code to the top level
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>
2012-02-17 10:48:09 +01:00
Christopher R. Hertel (crh)
b5b204184a Rename obscure defined constants.
Replaced the undescriptive SMB_PORT1 and SMB_PORT2 defined constants
with the slightly more descriptive names NBT_SMB_PORT and TCP_SMB_PORT.
Also replaced several hard-coded references to the well-known port
numbers (139 and 445, respectively) as appropriate.

Small changes to clarify some comments regarding the two transport
types.

Signed-off-by: Simo Sorce <idra@samba.org>

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Thu Feb 16 08:29:41 CET 2012 on sn-devel-104
2012-02-16 08:29:41 +01:00
Andrew Bartlett
5c2a2135c9 s3-libsmb: Remove unused kerberos_set_creds_enctype()
Also remove the unused configure tests for krb5_c_enctype_compare.

Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:15 +11:00
Andrew Bartlett
292974ed0c s3-libsmb: Remove unused kerberos_compatible_enctypes
Also remove the unused configure tests for krb5_c_enctype_compare.

Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:14 +11:00
Andrew Bartlett
a7835f4736 s3-libsmb: Remove unused smb_krb5_mk_error()
Also remove now-unused configure checks for krb5_mk_error().

Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:13 +11:00
Andreas Schneider
2464a7b0dd s3-libsmb: Remove obsolete smb_krb5_locate_kdc.
Signed-off-by: Günther Deschner <gd@samba.org>

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Feb  9 14:58:57 CET 2012 on sn-devel-104
2012-02-09 14:58:57 +01:00
Jeremy Allison
9fec2c0ea9 Allow a SACL to be sent in cli_set_secdesc(). 2012-02-02 16:28:06 -08:00
Andreas Schneider
3101d9bc2d s3-libsmb: Remove dead gssapi code.
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Wed Feb  1 23:29:44 CET 2012 on sn-devel-104
2012-02-01 23:29:44 +01:00
Andreas Schneider
8080dbad78 s3-lib: Fix util_cmdline which doesn't use popt.
This creates its own header file for util_cmdline so it doesn't need to
link against popt.
This should fix linking on FreeBSD.
2012-02-01 21:54:21 +01:00
Andrew Bartlett
5ad7665b63 libcli/smb: Convert struct smb_trans_enc_state to talloc
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-31 20:17:10 +01:00
Andrew Bartlett
fce53e0e79 s3-libsmb: Remove unused enum smb_trans_enc_type
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-31 20:17:10 +01:00
Andrew Bartlett
a1a667dd37 s3-libsmb: Use gensec_spnego in smb seal client
This is intead of the inline, manual spnego code currently
in use.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-31 20:17:10 +01:00
Stefan Metzmacher
204dfd2c1d s3:libsmb/auth_generic: make use of gensec_spnego in the client
metze
2012-01-31 20:17:09 +01:00
Andrew Bartlett
7d14f89e29 s3-libsmb Do not limit read replies to NBT packet sizes
With the posix extensions, we can read 16MB at a time, so we need to check
the full size of the packet, not the size rounded down to the old NBT
limit.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-01-27 13:36:06 -08:00
Andrew Bartlett
41ed715d42 s3-libsmb: use struct gensec_security directly
This is rather than via a now one-element union.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-20 23:55:55 +01:00
Andrew Bartlett
06f7105490 s3-libcli Change krb5 smb sealing to call via gensec and gensec_gse
This also fixes the support for smb sealing with krb5 in make test, as
this now relies on secrets.tdb rather than /etc/krb5.keytab.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-20 23:55:54 +01:00
Andrew Bartlett
40715e1251 s3-librpc: pass struct ndr_interface_table down to cli_pipe_open_generic/spnego()
This allows the target service (as determined from the IDL) to be
passed to GSSAPI (rather than the current, incorrect, "cifs").

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-18 16:23:24 +01:00
Andrew Bartlett
1b6356298c s3-libsmb Use the gse_krb5 gensec module as client
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-18 16:23:22 +01:00
Andrew Bartlett
138121c516 s3-libsmb: split out auth_generic client functions into auth_generic.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-11 09:04:56 +01:00
Andrew Bartlett
b89a0439b3 s3-librpc Rename and rework cli_rpc_pipe_open_ntlmssp() to be generic
This also includes renaming the helper function
rpccli_ntlmssp_bind_data, and allows this function to operate on any
gensec-supplied auth type.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-11 09:04:41 +01:00
Andrew Bartlett
cfe68f2d5f krb5: Require krb5_set_real_time is available to build with krb5 2012-01-10 21:50:07 +01:00
Andrew Bartlett
39d73e2420 krb5: Require krb5_get_renewed_creds be available to build with krb5 2012-01-10 21:50:07 +01:00
Andrew Bartlett
39b476d1c9 krb5: Require krb5_get_init_creds_opt_alloc/free for build with krb5
This also assumes the modern API with a krb5_context argument.

Andrew Bartlett
2012-01-10 21:50:07 +01:00
Andrew Bartlett
fc7b34c83a krb5: Require krb5_fwd_tgt_creds to be available to build with krb5 2012-01-10 21:50:07 +01:00
Andrew Bartlett
17e61e4290 krb5: Require krb5_c_enctype_compare is available to build with krb5 2012-01-10 21:50:07 +01:00
Volker Lendecke
7104ce3220 s3: Remove an unused label
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Jan  9 23:07:32 CET 2012 on sn-devel-104
2012-01-09 23:07:31 +01:00
Andrew Bartlett
13f5414f93 s3-libsmb: Do not look up FQDN or use host/ for krb5 encrypted CIFS
This is important, as we want to use exactly the same name and ticket
that the libsmb session setup code used, so we do not hit the KDC twice.

For the session setup to have succeded using the default 'client use
spnego principal = no', the cifs/ principal must exist anyway, so
looking for host/ is pointless.  The case of 'client use spnego
principal = yes' was never supported here.

Andrew Bartlett
2012-01-09 11:39:54 +11:00
Andrew Bartlett
4b9d52d735 s3-libsmb: match the rest of Samba3 in kerberos name selection in smb sealing
This mirrors 860ad734ba which in turn
mirrors the behaviour of the libsmb client code at session setup time.

Andrew Bartlett
2012-01-09 10:56:27 +11:00
Andrew Bartlett
fd69ebda26 s3-ntlmssp Remove unused ntlmssp_set_hashes() and do not set an invalid LM hash
When E_deshash() returns false, it indicates that the password is either > 14 chars
in length, or could not be represented as an LM hash value for some other
reason.  In this case, we should not regard the LM hash being missing
as an error or a no-password situation.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jan  6 14:59:13 CET 2012 on sn-devel-104
2012-01-06 14:59:12 +01:00
Andrew Bartlett
60c66118b3 ntlmssp: merge initial packet implementations
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-06 13:18:40 +01:00
Andrew Bartlett
a00032a92d s3-libsmb Make auth_ntlmssp client more generic
As well as renaming, this allows us to start the mech by DCE/RPC auth
type or OID.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-06 08:12:49 +01:00
Andrew Bartlett
21415568fe s3-libsmb Use gensec_settings to set s3 ntlmssp client backend
This prepares us for making the code generic to multiple mechansims

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-06 08:12:48 +01:00
Andrew Bartlett
860ad734ba s3-libads Factor out a new routine kerberos_get_principal_from_service_hostname()
This is now used in the GSE GSSAPI client, so that when we connect to
a target server at the CIFS level, we use the same name to connect
at the DCE/RPC level.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-05 17:17:28 +01:00
Andrew Bartlett
6391fff9da s3-auth rename auth_ntlmssp_state -> auth_generic_state
This structure handles more than NTLMSSP now, at least when we are an AD DC
and so changing the name may avoid some confusion in the future.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-12-22 19:25:10 +01:00
Volker Lendecke
75d3b9ce08 s3: Fix some False/NULL hickups
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 20 13:13:17 CET 2011 on sn-devel-104
2011-12-20 13:13:17 +01:00
Andreas Schneider
d0330c7dd6 s3-libsmb: Don't duplicate kerberos service tickets.
This fixes bug #8628.

Each time we do a client connection. Each time we call to function to
get the service ticket from the cache we duplicate it. So with each
connection we end up with one or three duplicated tickets.

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Dec 15 19:30:42 CET 2011 on sn-devel-104
2011-12-15 19:30:42 +01:00
Jeremy Allison
6be10cb761 Revert fac5c654e2
s3: Add a fallback for missing open&x support in OS/X Lion

This is now done inside the synchronous cli_open() wrapper
function.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sun Dec  4 08:19:31 CET 2011 on sn-devel-104
2011-12-04 08:19:31 +01:00
Jeremy Allison
c8a1082f2b Move the callers that need to use the new cli_open() back to calling
it from cli_openx().
2011-12-03 21:36:47 -08:00
Jeremy Allison
b44cfdf163 Add cli_open() back as a synchronous wrapper function the calls
NtCreateX followed by openX() if NtCreateX is unsupported.
2011-12-03 21:31:32 -08:00