1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-19 10:03:58 +03:00

320 Commits

Author SHA1 Message Date
Andrew Bartlett
47b7419fa7 r19660: Forgot to tell gsskrb5 not to canonicalize hostnames. Shoudl fix
valrind issues on fort, because we won't hit NSS any more.

Andrew Bartlett
(This used to be commit 6f67fa01ab4f946c9a9aae0d4e8d028153873e04)
2007-10-10 14:25:26 -05:00
Andrew Bartlett
e5974a1b5f r19650: Allow Samba to use Heimdal's SPNEGO code. Currently this can only
negotiate krb5, but if this works, I'll add NTLM as a GSSAPI backend
by some means or other.

Andrew Bartlett
(This used to be commit 476452e143f61a3878a3646864729daaddccdf68)
2007-10-10 14:25:25 -05:00
Andrew Bartlett
ed77e4e57b r19644: Merge up to current lorikeet-heimdal, incling adding
gsskrb5_set_default_realm(), which should fix mimir's issues.

Andrew Bartlett
(This used to be commit 8117e76d2adee163925a29df872015ff5021a1d3)
2007-10-10 14:25:24 -05:00
Andrew Bartlett
cb3a884048 r19635: It appears that under CFX, different keys are used in each direction
(or something like that).

In any case, we need to stick with the initiator subkey for now, until
we figure out what Vista uses for the CIFS session key.

Andrew Bartlett
(This used to be commit b91a921e1393581ca0102ad1f49a1075acb91b4e)
2007-10-10 14:25:22 -05:00
Andrew Bartlett
f722b07438 r19633: Merge to lorikeet-heimdal, removing krb5_rd_req_return_keyblock in favour of a more tasteful replacement.
Remove kerberos_verify.c, as we don't need that code any more.
Replace with code for using the new krb5_rd_req_ctx() borrowed from
Heimdal's accecpt_sec_context.c

Andrew Bartlett
(This used to be commit 13c9df1d4f0517468c80040d3756310d4dcbdd50)
2007-10-10 14:25:21 -05:00
Andrew Bartlett
daa463070c r19629: No need to special case use of DCE_STYLE sign and seal away any more...
Andrew Bartlett
(This used to be commit 247b9f1ca907cf921087e6840400ddf68289b8f2)
2007-10-10 14:25:20 -05:00
Andrew Bartlett
a77b25cea7 r19628: This hint via Love at the IETF meeting:
Larry told me that most context flags needed to be set to, otherwise
it wouldn't work.

This fixes DCE_STYLE against Win2k3 SP1.  It seems they just tightened
up their end of the GSSAPI code, as DCE_STYLE is explicity rejected in
the session setup too (being the wrong layer).

Andrew Bartlett
(This used to be commit b2b77f34a4d0cebb828cac7bf9a73826fecab5b6)
2007-10-10 14:25:20 -05:00
Andrew Bartlett
3c1e780ec7 r19604: This is a massive commit, and I appologise in advance for it's size.
This merges Samba4 with lorikeet-heimdal, which itself has been
tracking Heimdal CVS for the past couple of weeks.

This is such a big change because Heimdal reorganised it's internal
structures, with the mechglue merge, and because many of our 'wishes' have been granted:  we now have DCE_STYLE GSSAPI, send_to_kdc hooks and many other features merged into the mainline code.  We have adapted to upstream's choice of API in these cases.

In gensec_gssapi and gensec_krb5, we either expect a valid PAC, or NO
PAC.  This matches windows behavour.  We also have an option to
require the PAC to be present (which allows us to automate the testing
of this code).

This also includes a restructure of how the kerberos dependencies are
handled, due to the fallout of the merge.

Andrew Bartlett
(This used to be commit 4826f1735197c2a471d771495e6d4c1051b4c471)
2007-10-10 14:25:03 -05:00
Andrew Bartlett
13dbee3ffe r19598: Ahead of a merge to current lorikeet-heimdal:
Break up auth/auth.h not to include the world.

Add credentials_krb5.h with the kerberos dependent prototypes.

Andrew Bartlett
(This used to be commit 2b569c42e0fbb596ea82484d0e1cb22e193037b9)
2007-10-10 14:25:00 -05:00
Andrew Bartlett
c755bb5025 r19597: Ahead of the merge to current lorikeet-heimdal:
Supply the correct OID to the error display functions.

Rework the session key functions.

Andrew Bartlett
(This used to be commit 363628c13f4e4a8904802dcf4d80e296ed2f9e02)
2007-10-10 14:25:00 -05:00
Andrew Bartlett
97aec1a70c r19595: Seperate debug messages between database failure and simple lack of
records.

Andrew Bartlett
(This used to be commit 163f75372792b0afa72f48d64d78d82b72d8eda5)
2007-10-10 14:24:59 -05:00
Andrew Bartlett
c45262582c r19566: Predeclare some useful structures.
(This used to be commit 160a59f0733a90db157ad48747c7fb72c2912829)
2007-10-10 14:24:53 -05:00
Jelmer Vernooij
4fa24df98d r19507: Merge my DSO fixes branch. Building Samba's libraries as shared libraries
works again now, by specifying --enable-dso to configure.
(This used to be commit 7a01235067a4800b07b8919a6a475954bfb0b04c)
2007-10-10 14:24:41 -05:00
Simo Sorce
7f833458ca r19489: Change ldb_msg_add_value and ldb_msg_add_empty to take a foruth argument.
This is a pointer to an element pointer. If it is not null it will be
filled with the pointer of the manipulated element.
Will avoid double searches on the elements list in some cases.
(This used to be commit 0fa5d4bc225b83e9f63ac6d75bffc4c08eb6b620)
2007-10-10 14:24:38 -05:00
Andrew Bartlett
3c203ab927 r19465: Rather than use the non-standard API for determining the signature
length, use the amount the wapped message expanded by.

This works, because GSSAPI doesn't do AEAD (signing of headers), and
so changing the signature length after the fact is valid.

Andrew Bartlett
(This used to be commit bd1e0f679c8f2b9755051b8d34114fa127a7cf26)
2007-10-10 14:21:37 -05:00
Jelmer Vernooij
8773e743c5 r19339: Merge my 4.0-unittest branch. This adds an API for more fine-grained
output in the testsuite rather than just True or False for a
set of tests.

The aim is to use this for:
 * known failure lists (run all tests and detect tests that
						started working or started failing). This
   would allow us to get rid of the RPC-SAMBA3-* tests
 * nicer torture output
 * simplification of the testsuite system
 * compatibility with other unit testing systems
 * easier usage of smbtorture (being able to run one test
						and automatically set up the environment for that)

This is still a work-in-progress; expect more updates over the next couple of
days.
(This used to be commit 0eb6097305776325c75081356309115f445a7218)
2007-10-10 14:21:12 -05:00
Simo Sorce
59b66744f7 r19299: Fix possible memleaks
(This used to be commit 6fad80bb09113a60689061a2de67711c9924708b)
2007-10-10 14:21:04 -05:00
Andrew Bartlett
541339fbd2 r19265: It is not an error to set the target hostname to NULL.
Andrew Bartlett
(This used to be commit c9c2e90e2e3937d05c58c681af187413b12d9220)
2007-10-10 14:21:00 -05:00
Andrew Bartlett
cbed4ba5af r18354: It seems safe to enable the DIGEST-MD5 module now.
Andrew Bartlett
(This used to be commit 8357f8be45ef93bd1b648350c951bbe3b1bb5682)
2007-10-10 14:18:17 -05:00
Andrew Tridgell
9adf2883ef r18321: fixed some warnings on AIX
(This used to be commit 449fab2c264aa50601f9a2d3310f1910ba97706b)
2007-10-10 14:18:08 -05:00
Andrew Tridgell
30ee8beb93 r18301: I discovered how to load the warnings from a build farm build into
emacs compile mode (hint, paste to a file, and compile as "cat
filename").

This allowed me to fix nearly all the warnings for a IA_64 SuSE build
very quickly.
(This used to be commit eba6c84efff735bb0ca941ac4b755ce2b0591667)
2007-10-10 14:18:04 -05:00
Andrew Tridgell
dfd4c8e84d r18295: pass write type for packet_size
this fixes a crash on IA_64 systems
(This used to be commit 22c39027621fb65663122b4959b171d328b549d4)
2007-10-10 14:18:03 -05:00
Andrew Bartlett
c1ec0da99c r18257: Order the GENSEC modules, with unknown modules last.
Andrew Bartlett
(This used to be commit 8ae880b5019ab275fe0eca48120ab9e0fcca6293)
2007-10-10 14:17:57 -05:00
Andrew Bartlett
40cf47fa56 r18255: Remove the SMB_ASSERT(), as these are not talloc()'ed structures.
Andrew Bartlett
(This used to be commit 73fba185eba6b059d34790c95a30d49b296759f5)
2007-10-10 14:17:56 -05:00
Andrew Bartlett
71a9ca56d0 r18253: Turn Cyrus-SASL DIGEST-MD5 off by default for now.
Andrew Bartlett
(This used to be commit 2da948cb6ecc75e2b4b97c770c8ba13b7f831d6e)
2007-10-10 14:17:56 -05:00
Andrew Bartlett
c062b12fba r18250: Add an ordering of GENSEC modules, so we do preferred modules first.
Andrew Bartlett
(This used to be commit 0afb4d1992b3c93557dec1e1cdca467efc299853)
2007-10-10 14:17:55 -05:00
Andrew Bartlett
2f6d723e1f r18249: Keep trying to start an GENSEC mech from the list until one actually
starts.

Andrew Bartlett
(This used to be commit 7dba525f5598199e89badbf15e0f5f09023c6cfa)
2007-10-10 14:17:55 -05:00
Andrew Bartlett
a22780bd4c r18242: The cyrus-sasl encode/decode routines process the entire input.
Andrew Bartlett
(This used to be commit 32d8a23d5499ef3d913240b5693b54eb2e78cd7d)
2007-10-10 14:17:54 -05:00
Andrew Bartlett
9ca2814c3f r18198: Fix callbacks to use allocated or constant memory, not the stack.
These values are used by SASL at a later time, and must remain valid.

Make the password callback actually return the password.

Andrew Bartlett
(This used to be commit 8e12f92bbe3aa878292169f4699502e241ef6c0b)
2007-10-10 14:17:48 -05:00
Andrew Bartlett
3549adc7ce r18155: Add my work in progress, a module to link with Cyrus-SASL, for a
DIGEST-MD5 implemenation in particular.

However, I can't make this work:  Cyrus-SASL isn't loading the mech...

Andrew Bartlett
(This used to be commit 0b193d28c896c9d212a536da7d87634543d971a5)
2007-10-10 14:17:43 -05:00
Andrew Bartlett
c3b54cf75b r18068: This splits the handling of multiple SASL packets between the GENSEC
backend (if it chooses to implement it), or the GENSEC socket code.

This is to allow us to handle DIGEST-MD5 across to cyrus-sasl.

Andrew Bartlett
(This used to be commit 0a098006b431f4aa48632a27ca08e9adca8d9609)
2007-10-10 14:17:11 -05:00
Simo Sorce
a23b63a8e5 r17516: Change helper function names to make more clear what they are meant to do
(This used to be commit ad75cf869550af66119d0293503024d41d834e02)
2007-10-10 14:15:31 -05:00
Stefan Metzmacher
bdbc9b3908 r17344: move the gensec_update_request structure into the header file
and add a private_data for the backends.

metze
(This used to be commit 015a65e00187e684b3e4d1f4ca07edb9f022f61b)
2007-10-10 14:15:17 -05:00
Stefan Metzmacher
7a845bcb01 r17341: pass a messaging context to auth_context_create()
and gensec_server_start().

calling them with NULL for event context or messaging context
is no longer allowed!

metze
(This used to be commit 679ac74e71b111344f1097ab389c0b83a9247710)
2007-10-10 14:15:17 -05:00
Andrew Bartlett
582cf8c1c0 r17332: May as well make this a round number
(This used to be commit a2d614147663c4f9b80d6e383819e92ca45e013b)
2007-10-10 14:15:16 -05:00
Stefan Metzmacher
de4c2bbc6c r17272: move the callback stuff into a substructure
metze
(This used to be commit c49e27d5d0289e3525f7f6197b031e7d300df81b)
2007-10-10 14:10:26 -05:00
Stefan Metzmacher
64d6abac74 r17267: - add an async interface for gensec_update() to the public gensec api
- note this is still uses the sync update() hook of the gensec modules
  but it allows me to fix the callers first

Later auth_check_password() will also get an async version,
so that we can later implement an async version of auth_winbind
using async IRPC to the winbind task.

metze
(This used to be commit d5638a4fafd1d60ccc4cd76e92a1b2b0093865a7)
2007-10-10 14:10:25 -05:00
Andrew Bartlett
1ea4f560fc r17223: In some protocols it is not possible to negoitate off some features,
without the agreement of the peer.  This can cause problems, because
one side things sealing is disabled, while the other thinks it is
enabled.

Andrew Bartlett
(This used to be commit 68ddc4921f43252b3fba73e9d85cc38c359d599d)
2007-10-10 14:10:20 -05:00
Andrew Bartlett
9d6f276717 r17222: Change the function prototypes for the GENSEc and TLS socket creation
routines to return an NTSTATUS.  This should help track down errors.

Use a bit of talloc_steal and talloc_unlink to get the real socket to
be a child of the GENSEC or TLS socket.

Always return a new socket, even for the 'pass-though' case.

Andrew Bartlett
(This used to be commit 003e2ab93c87267ba28cd67bd85975bad62a8ea2)
2007-10-10 14:10:20 -05:00
Andrew Bartlett
ba07fa43d0 r17197: This patch moves the encryption of bulk data on SASL negotiated security
contexts from the application layer into the socket layer.

This improves a number of correctness aspects, as we now allow LDAP
packets to cross multiple SASL packets.  It should also make it much
easier to write async LDAP tests from windows clients, as they use SASL
by default.  It is also vital to allowing OpenLDAP clients to use GSSAPI
against Samba4, as it negotiates a rather small SASL buffer size.

This patch mirrors the earlier work done to move TLS into the socket
layer.

Unusual in this pstch is the extra read callback argument I take.  As
SASL is a layer on top of a socket, it is entirely possible for the
SASL layer to drain a socket dry, but for the caller not to have read
all the decrypted data.  This would leave the system without an event
to restart the read (as the socket is dry).

As such, I re-invoke the read handler from a timed callback, which
should trigger on the next running of the event loop.  I believe that
the TLS code does require a similar callback.

In trying to understand why this is required, imagine a SASL-encrypted
LDAP packet in the following formation:

+-----------------+---------------------+
| SASL  Packet #1 | SASL Packet #2      |
----------------------------------------+
| LDAP Packet #1       | LDAP Packet #2 |
----------------------------------------+

In the old code, this was illegal, but it is perfectly standard
SASL-encrypted LDAP.  Without the callback, we would read and process
the first LDAP packet, and the SASL code would have read the second SASL
packet (to decrypt enough data for the LDAP packet), and no data would
remain on the socket.

Without data on the socket, read events stop.  That is why I add timed
events, until the SASL buffer is drained.

Another approach would be to add a hack to the event system, to have it
pretend there remained data to read off the network (but that is ugly).

In improving the code, to handle more real-world cases, I've been able
to remove almost all the special-cases in the testnonblock code.  The
only special case is that we must use a deterministic partial packet
when calling send, rather than a random length.  (1 + n/2).  This is
needed because of the way the SASL and TLS code works, and the 'resend
on failure' requirements.

Andrew Bartlett
(This used to be commit 5d7c9c12cb2b39673172a357092b80cd814850b0)
2007-10-10 14:10:18 -05:00
Andrew Bartlett
b718193b6b r17173: Check for oversize output, not oversize input, and fix the GSSAPI mech
to work (it broke it in the previous commit).

Andrew Bartlett
(This used to be commit e96638bc74f0752ce8af6626a04c92d48b917ffe)
2007-10-10 14:10:16 -05:00
Andrew Bartlett
048d0c64f9 r17171: Add a gensec function to determine the maximum negotiated buffer size,
and the maximum amount of user data that may be fitted into that.

This is used in the new SASL code, to correctly honour SASL buffer sizes.

Andrew Bartlett
(This used to be commit cbbe99d9c1f0262e67a495fb098cacc09fd78e05)
2007-10-10 14:10:15 -05:00
Andrew Bartlett
3ed1e8ff3c r16829: Fix a number of issues raised by the IBM checker, or gcc warnings.
In particular, this removes one use of the LDB_DN_NULL_FAILED macro,
which was being used on more than DNs, had an embedded goto, and
confused the IBM checker.

In the password_hash code, ensure that sambaAttr is not, before
checking the number of values.

In GENSEC, note that this switch value can't occour.  This seems to be
the only way to quiet both the IBM checker and gcc, as well as cope
with possibly invalid inputs.

Andrew Bartlet
(This used to be commit 3e58350ec2ab883795b1dd03ac46a3520cac67d0)
2007-10-10 14:09:48 -05:00
Jelmer Vernooij
4bd40183af r16516: Get rid of file_exists() as there already is a file_exist().
(This used to be commit c4b3c2b18c6df43c8a4808fab72bc45439ba9421)
2007-10-10 14:09:31 -05:00
Andrew Bartlett
e0bb0e9f95 r16056: Fix errors found by trying to use our kpasswd server and the Apple client.
Andrew Bartlett
(This used to be commit ae2913898c983dcba69b5d0b89c428e450e9bf5f)
2007-10-10 14:08:54 -05:00
Andrew Tridgell
cdc64c448d r15853: started the process of removing the warnings now that
talloc_set_destructor() is type safe. The end result will be lots less
use of void*, and less calls to talloc_get_type()
(This used to be commit 6b4c085b862c0932b80b93e316396a53b993544c)
2007-10-10 14:08:32 -05:00
Andrew Bartlett
44c36af9b6 r15485: This 'fake' GSSAPI doesn't do the extra SASL negotiation correctly, so
don't attribute the GSSAPI SASL mech to it.

Andrew Bartlett
(This used to be commit 23a4db28ed825bc8c45e5f704137a72386394f45)
2007-10-10 14:05:40 -05:00
Andrew Bartlett
5f4d86f955 r15426: Implement SPNEGO as the default RPC authentication mechanism. Where
this isn't supported, fallback to NTLM.

Also, where we get a failure as 'logon failure', try and do a '3
tries' for the password, like we already do for CIFS.  (Incomplete:
needs a mapping between RPC errors and the logon failure NTSTATUS).

Because we don't yet support Kerberos sign/seal to win2k3 SP1 for
DCE/RPC, disable this (causing SPNEGO to negotiate NTLM) when kerberos
isn't demanded.

Andrew Bartlett
(This used to be commit b3212d1fb91b26c1d326a289560106dffe1d2e80)
2007-10-10 14:05:36 -05:00
Jelmer Vernooij
e0e8743baf r15363: Fix dependencies for shared library
(This used to be commit f2ca71f1229f4c20296895116c09bacbd6a53b55)
2007-10-10 14:05:26 -05:00
Andrew Bartlett
de74d11322 r15330: Add comment for IBM checker.
Andrew Bartlett
(This used to be commit d2832a849dd570a6cc1b49d8071735270b2fb83f)
2007-10-10 14:05:17 -05:00