Commit Graph

27942 Commits

Author SHA1 Message Date
Stefan Metzmacher
bafefad87f lib/gssapi/krb5: split out a arcfour_mic_cksum_iov() function
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
ef0059b8b6 lib/gssapi/krb5: add const to arcfour_mic_key()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
5f79ac2bb9 lib/gssapi/krb5: clear temporary buffer with cleartext data.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
e33e47650a lib/gssapi/krb5: fix indentation in _gk_wrap_iov()
Now it matches _gk_unwrap_iov() and _gk_wrap_iov_length().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
63ed962041 lib/gssapi/krb5: make _gssapi_verify_pad() more robust
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
078e6f5dd2 kdc: add support for HDB_ERR_WRONG_REALM
A backend can return this if asked with HDB_F_GET_CLIENT|HDB_F_FOR_AS_REQ
for a KRB5_NT_ENTERPRISE_PRINCIPAL record or for HDB_F_GET_SERVER | HDB_F_FOR_TGS_REQ.

entry_ex->entry.principal->realm needs to return the real realm of the principal
(or at least a the realm of the next cross-realm trust hop).

This is needed to route enterprise principals between AD domain trusts.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
81f9ed4a6c kdc: generic support for 3part servicePrincipalNames
This is not DRSUAPI specific, it works for all 3 part principals.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
a873e21d7c kdc: base _kdc_fast_mk_error() on krb5_mk_error_ext()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
25f3db919f lib/krb5: add krb5_mk_error_ext() helper function
This gives the caller the ability to skip the client_name
and only provide client_realm. This is required for
KDC_ERR_WRONG_REALM messages.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
bbff216dc6 lib/krb5: correctly follow KRB5_KDC_ERR_WRONG_REALM client referrals
An AS-REQ with an enterprise principal will always directed to a kdc of the local
(default) realm. The KDC directs the client into the direction of the
final realm. See rfc6806.txt.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
ae4d222f58 lib/krb5: verify_logonname() to handle multi component principal
FreeIPA can generate tickets with a client principal of
'host/hostname.example.com'.

verify_logonname() should just verify the principal name
in the PAC_LOGON_NAME is the same as the principal of
the client principal (without realm) of the ticket.

Samba commit b7cc8c1187ff967e44587cd0d09185330378f366
break this. We try to compare ['host']['hostname.example.com']
with ['host/hostname.example.com]' (as we interpret it as enterprise principal)
this fail if we don't compare them as strings.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11142

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
20da6cad02 doc/standardisation: add rfc6806.txt
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Stefan Metzmacher
be37f24ef4 lib/ntlm: add missing dependency to libwind.la
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-31 17:30:23 +12:00
Andrew Bartlett
71c95fb38d Merge pull request #137 from douglasbagnall/oid-regenerate
Oid regenerate

The GSSAPI oid C files were originally generated by a perl 4 script that no longer runs on a modern system. Subsequently the C has been manually modified.

These patches update the script to perl 5 and alter its output to reflect the manually changed C.

Because modern perl uses hash randomisation, the order of the oids in the C file is sorted -- otherwise
they will be ordered differently every time, making changes hard to review.
2015-07-31 16:15:55 +12:00
Douglas Bagnall
832d7af018 GSSAPI: regenerate lib/gssapi/mech/gss_oid.c with consistent sort
This is generated from lib/gssapi/oid.txt using lib/gssapi/gen-oid.pl,
which sorts the entries to ensure minimal diff churn when an oid is
added or changed.

The lack of effective changes can be seen by sorting both versions, a
bit like this:

$ git show HEAD~~:lib/gssapi/mech/gss_oid.c | sort > /tmp/gss_oid.c-OLD
$ cat lib/gssapi/mech/gss_oid.c | sort > /tmp/gss_oid.c-NEW
$ diff -u /tmp/gss_oid.c*
$ #Nothing to see!

This is of course not a reliable check in general, but works for this
simple file in concert with ordinary inspection.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2015-07-31 15:51:13 +12:00
Douglas Bagnall
0d31145e9d GSSAPI: generate full NULL structure initializers in gen-oid.pl
As seen in commit cc47c8fa7 (Roland C. Dowdeswell <elric@imrryr.org>,
"Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix
issues"), compilers can be persuaded to dislike a single {NULL} and
prefer {NULL, NULL, NULL, NULL}. That patch altered the C code
directly; here we change the generating file to match.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2015-07-31 15:51:13 +12:00
Douglas Bagnall
0c36f11f17 GSSAPI: keep consistent sort order in lib/gssapi/gen-oid.pl
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2015-07-31 15:51:13 +12:00
Douglas Bagnall
afab2ff867 GSSAPI: use rk_UNCONST() on password and cert oid
These missed out on the rk_UNCONST()ification by virtue of being added
in a parallel branch. In the diagram below, they got added in 02cf28e,
while the rk_UNCONSTs were added in f5f9014.

* cc47c8f Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
*   3069d80 Merge branch 'master' into lukeh/acquire-cred-ex
|\
| * f5f9014 Warning fixes from Christos Zoulas
* | 02cf28e implement gss_acquire_cred_ex with password support
|/
* 2170219 add more oids

rk_UNCONST amounts to a cast to (void *), removing const.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2015-07-31 15:51:13 +12:00
Douglas Bagnall
f132e0b2a3 GSSAPI: update lib/gssapi/gen-oid.pl to work with Perl 5
The invocation `require "getopts.pl"; Getopts(...)` works in Perl 4,
but not in recent Perl 5.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2015-07-31 15:51:13 +12:00
Love Hörnquist Åstrand
db4175c225 Merge pull request #136 from HenryJacques/pkinit_improvements
PK-INIT improvements
2015-07-24 12:04:47 +02:00
HenryJacques
5a4e9d1539 Fix typo 2015-07-20 10:45:06 +02:00
HenryJacques
35a569bd83 Allow to use more than one token
This is needed if the first is not usable
2015-07-20 10:14:38 +02:00
HenryJacques
1639697c97 add error codes related to User PIN 2015-07-20 10:12:50 +02:00
HenryJacques
75a304c452 Fix typo 2015-07-20 10:08:57 +02:00
HenryJacques
5cf302def7 Add new error codes related to PIN
Not all error codes have been added, only the most common ones.
2015-07-20 10:07:08 +02:00
Stefan Metzmacher
be63a2914a heimdal:krb5.asn1: remove KRB5_PADATA_CLIENT_CANONICALIZED handling
This got removed between draft-ietf-krb-wg-kerberos-referrals-11.txt
and the final rfc6806.txt.

The number 133 was reassigned to PA-FX-COOKIE in rfc6113.txt.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-06-17 17:41:27 -05:00
Andrew Bartlett
29f6290fe6 lib/krb5: Remove KRB5_PADATA_CLIENT_CANONICALIZED from ticket.c
This will shortly be removed from krb5.asn1.

This got removed between draft-ietf-krb-wg-kerberos-referrals-11.txt
    and the final rfc6806.txt.

    The number 133 was reassigned to PA-FX-COOKIE in rfc6113.txt.

Andrew Bartlett based on work by metze to remove it from othert parts of the code

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2015-06-17 17:41:27 -05:00
Stefan Metzmacher
358e2b7b0a kdc: remove KRB5_PADATA_CLIENT_CANONICALIZED handling
This got removed between draft-ietf-krb-wg-kerberos-referrals-11.txt
and the final rfc6806.txt.

The number 133 was reassigned to PA-FX-COOKIE in rfc6113.txt.

(Samba commit 9ebd10b3432c271625db9fbc1987759c02b23f83 forward-ported
to Heimdal master by Andrew Bartlett)
2015-06-17 17:41:27 -05:00
Stefan Metzmacher
8c8a39b0b7 heimdal:lib/krb5: let build_logon_name() use KRB5_PRINCIPAL_UNPARSE_DISPLAY
An ENTERPRISE principal should result in 'administrator@S4XDOM.BASE'
instead of 'administrator\@S4XDOM.BASE'.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11142
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-06-17 17:41:27 -05:00
Stefan Metzmacher
2e6318f09a heimdal:lib/krb5: allow enterprise principals in verify_logonname()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11142
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-06-17 17:41:26 -05:00
Volker Lendecke
02616866e5 heimdal: Fix the developer O3 build
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2015-06-17 17:41:26 -05:00
Andrew Bartlett
c450abd01a heimdal: Ensure that HDB_ERR_NOT_FOUND_HERE, critical for the RODC, is not overwritten
This change ensures that our RODC will correctly proxy when asked to provide
a ticket for a service or user where the keys are not on this RODC.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2015-06-17 17:41:26 -05:00
Günther Deschner
0f19fdec83 s4-heimdal: fix krb5_get_init_creds_opt_set_process_last_req().
Most probably just a copy/paste error.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-17 17:41:26 -05:00
Santosh Kumar Pradhan
e5144acab0 heimdal: Use krb5_free_default_realm() for free()
The resource allocated by krb5_default_default_realm() should be
free()'d by krb5_free_default_realm() instead of plain free()
for better readability.

Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-06-17 17:41:26 -05:00
Andrew Bartlett
324ac13b32 heimdal: remove checking of KDC PAC signature, delegate to wdc plugin
The checking of the KDC signature is more complex than it looks, it may be of a different
enc type to that which the ticket is encrypted with, and may even be prefixed
with the RODC number.

This is better handled in the plugin which can easily look up the DB for the
correct key to verify this with, and can also quickly determine if this is
an interdomain trust, which we cannot verify the PAC for.

Andrew Bartlett
2015-06-17 17:41:26 -05:00
Andrew Bartlett
5c8e3c6108 Fix shell syntax in COVERITY_SCAN_BRANCH test
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2015-06-17 17:41:25 -05:00
Andrew Bartlett
95256a6129 kdc: Preserve error code from Pre Authentication .validate hook
This is required to ensure the client still gets errors like KRB5KDC_ERR_PREAUTH_FAILED, rather than
KRB5KDC_ERR_PREAUTH_REQUIRED, which become a confusing KRB5_GET_IN_TKT_LOOP.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
2015-06-17 17:41:25 -05:00
Andrew Bartlett
960fa481be Add test for incorrect password
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2015-06-17 17:41:25 -05:00
Sergio Gelato
50e2a5ce95 (patch) man page syntax errors
A few fixes for syntax errors in man pages, as reported by lintian:

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2015-05-26 16:03:00 +02:00
Nicolas Williams
05a919b94b iprop slave: try incremental after complete xfer
The following sequence of events results in slave B having a stale HDB:

 - slave A connects to master, master dumps HDB for the slave
 - kadm5 operations
 - slave B connects to master, master sends previously dumped HDB

slave B won't discover any updates until the next transaction.

The fix is simple: the slave should immediately call ihave() after
receiving a complete HDB.
2015-05-20 10:07:52 -05:00
Nicolas Williams
4158ddbc25 Fix HDB rename/close order in iprop slave 2015-05-20 10:07:52 -05:00
Nicolas Williams
409501e5e4 Tolerate some time-travel by slaves 2015-05-20 10:07:51 -05:00
Nicolas Williams
854aaab182 iprop master: Don't ignore flock() result 2015-05-20 10:07:51 -05:00
Nicolas Williams
56b67ac2eb start-realm: don't write NUL 2015-05-20 10:07:51 -05:00
Jeffrey Altman
26c7affa70 roken: fix 0acef7729f
Should have used -- instead of == in the prior commit.

Change-Id: I90f8886b754dda19970c6579ffa477634e8dc4a5
2015-05-20 11:05:38 -04:00
Jeffrey Altman
0acef7729f roken: fix append_string "%.s" non-nul termination
It should be possible to pass a format string of "%.s" to permit
a non-nul terminated string to be used as input.  The test of remaining
precision and the test for NUL needs to be reversed to permit this
behavior to function correctly.

Change-Id: I200f9c2886419dc4c3870f5f44bc10e81245f56c
2015-05-20 10:27:12 -04:00
Love Hörnquist Åstrand
e51c2126e6 Merge pull request #128 from kiransj/patch-1
Fix compilation error in dlfcn.h
2015-04-30 00:25:30 -07:00
Kiran S J
a350c5265a Fix compilation error when in dlfcn.h
When dlfcn.h is included from a C++ file causes a compilation error due to missing '{'.
2015-04-30 12:30:28 +05:30
Love Hörnquist Åstrand
4c98e27eda call hdb_auth_status when password is wrong in the ENC-CHAL case too, thanks Andrew Bartlett for pointing this out 2015-04-28 08:54:24 -07:00
Love Hörnquist Åstrand
3d469d7386 Merge pull request #124 from Sp1l/master
Fix build when OpenSSL has no EGD support
2015-04-28 08:36:43 -07:00