Commit Graph

213 Commits

Author SHA1 Message Date
Isaac Boukris
efb111e450 Separate enterprise and canonicalize flags
The meaning of the two is different and we should
not implicitly set both if one was requested (this
aligns the logic with MIT kinit -C/-E options).

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
2018-12-26 16:55:13 -06:00
Luke Howard
070d0cf928 krb5: krb5_get_init_creds_opt_set_change_password_prompt incomplete (#322)
krb5_get_init_creds_opt_set_change_password_prompt() was being ignored by
krb5_init_creds_step() which broke pam_krb5 tests. MIT doesn't handle password
expiration within krb5_init_creds_step(), instead deferring to higher level
functions such as krb5_get_init_creds_password(). However, Heimdal kinit uses
krb5_init_creds_step() directly and thus requires this behaviour to be
implemented to pass its own tests.
2018-12-23 16:59:25 +11:00
Andrew Bartlett
de4fbc9514 lib/krb5: Do not re-send the AS-REQ if fast was disabled
Without this, in an AS-REQ that has no local key for FAST
we would send the AS-REQ again, which can bump the bad
password count on the KDC twice.

So only try again if FAST was actually tried.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2018-12-14 16:38:43 -06:00
Chris Lamb
276476c595 Correct "updateing" typos.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

(cherry-picked from Samba commit fccdf34a0f7ebe510769743a99b9ef2da2a20045)
2018-09-10 14:42:18 -04:00
Jeffrey Altman
93518bfab4 use memset_s
lib roken includes support for memset_s() but it was not applied
to the Heimdal source tree.

Change-Id: I8362ec97a9be50205bb2d398e65b629b88ce1acd
2017-04-29 01:05:59 -04:00
Nicolas Williams
6e5bbbf65d Fix FAST client memleak 2016-12-06 22:44:23 -06:00
Nicolas Williams
52a562a3a4 Misc fixes (coverity) 2016-11-18 22:21:45 -06:00
Nicolas Williams
953dc07391 Round #1 of scan-build warnings cleanup 2016-11-15 21:27:20 -06:00
Jeffrey Altman
09bdb3ab3e Set the right name type for anon princ (client)
In fast_wrap_req() set the correct type in KDC_REQ client principal
name.

Also fix ENOMEM handling.
2016-11-14 21:29:47 -06:00
Florian Best
7422cd1f6b Implement krb5_get_init_creds_opt_set_change_password_prompt() 2016-11-11 11:48:43 -06:00
Jeffrey Altman
a013e93e95 default life/renewlife time to KDC policy
Instead of imposing a default 10 hour ticket lifetime and 1 month renew
lifetime when requesting tickets, increase the default lifetime and
renew lifetime to 2147483647 seconds.  This ensures that in the absence
of any other configuration or command line parameters that the KDC will
determine the ticket lifetime and renew lifetime.

Change-Id: I52b6eeac1ee830a9bf4d0130e8f4ec7b70bc8694
Signed-off-by: Nicolas Williams <nico@twosigma.com>
2016-11-10 16:13:10 -06:00
Nicolas Williams
b4cf4de807 Fix warnings (clang 3.6) 2016-02-26 01:04:31 -06: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
Nicolas Williams
e010254cc2 coverity 745495 2015-04-18 23:19:25 -05:00
Jeffrey Altman
e8e9cd9710 krb5: Introduce KRB5_TKT_LIFETIME_DEFAULT
Instead of hard coding 10 hours as the default ticket lifetime within
lib/krb5/init_cred_pw.c init_cred(), add a preprocessor macro,
KRB5_TKT_LIFETIME_DEFAULT, that can be overridden at build time.

The value of KRB5_TKT_LIFETIME_DEFAULT is 10 hours if not previously
defined.

Change-Id: I63e729fedee8e8c6f542e4a4665de5f40db34c03
2015-04-16 20:40:21 -04:00
Nicolas Williams
fb177480bd Fix memory leak in init_creds_pw.c 2015-04-15 12:37:52 -05:00
Nicolas Williams
487b6820f6 Revamp name canonicalization code 2015-03-24 11:49:58 -05:00
Love Hörnquist Åstrand
a84b572747 resurrect password change support again 2014-08-22 20:19:36 -07:00
Love Hornquist Astrand
1a8038d8a6 don't free armor_ccache, since krb5_cc are not yet ref counted 2013-07-19 14:56:01 +02:00
Nico Williams
ea1e3776fb heim_ipc is not available on Win32 yet 2013-07-16 21:06:34 -05:00
Love Hornquist Astrand
f49339f31b make fast work with mit kerberos 2013-07-16 15:31:30 +02:00
Love Hornquist Astrand
ad74581850 add KRB5_PADATA_FX_FAST_ARMOR to the fast armor data 2013-07-16 15:17:25 +02:00
Roland C. Dowdeswell
f0f07ff408 Use krb5_enomem() more consistently in lib/krb5. 2013-02-13 16:15:00 +08:00
Love Hörnquist Åstrand
7b411b3993 fixup logic for prompting for password 2012-03-10 09:59:34 -08:00
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00
Russ Allbery
911c993757 Fix reauthentication after password change in init_creds_password
When retrying authentication after a password change of an expired
password, use the new password instead of the original one.  Also,
pass in the correct length for the new password buffer to
change_password and zero the buffer that holds the new password on
function exit.

Signed-off-by: Russ Allbery <rra@stanford.edu>
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2011-12-22 14:53:08 -06:00
Love Hornquist Astrand
477738a80d try w/o FAST if the KDC doesnt seem to handle it 2011-12-14 08:46:05 -08:00
Nicolas Williams
81293d9334 krb5_get_init_creds*() should not krb5_cc_close() the FAST ccache! 2011-11-22 17:04:35 -06:00
Love Hornquist Astrand
118f99e308 tell if keytab is missing principal 2011-11-22 11:00:51 -08:00
Nicolas Williams
3bebbe5323 Fixes to make Heimdal -Wall -Werror clean
These fixes make developer mode build, at least on Ubuntu.
2011-11-02 21:42:08 -05:00
Love Hörnquist Åstrand
b6fc70019e better error message 2011-07-24 22:33:39 -07:00
Love Hornquist Astrand
242d7e1602 comment 2011-07-24 20:24:39 -07:00
Love Hornquist Astrand
5d1ae998f9 "better" error codes 2011-07-24 20:24:39 -07:00
Love Hornquist Astrand
067072f81e complete KrbFastFinished message work 2011-07-24 20:24:39 -07:00
Love Hornquist Astrand
b6d5637b61 fill in more bits 2011-07-24 20:24:39 -07:00
Love Hornquist Astrand
04c7dd7cee start completion of KrbFastFinished 2011-07-24 20:24:38 -07:00
Love Hornquist Astrand
b73d402a47 export process last request 2011-07-24 20:24:38 -07:00
Love Hornquist Astrand
7b398263da Partial FAST 2011-07-24 20:24:38 -07:00
Love Hornquist Astrand
7c55029060 Add fast armor bits 2011-07-24 20:24:37 -07:00
Love Hornquist Astrand
16d16588d2 move back init_as_req when building packet 2011-07-24 20:24:36 -07:00
Love Hornquist Astrand
c148c2b432 unused key 2011-07-24 20:24:35 -07:00
Love Hörnquist Åstrand
1879af9e43 Break out fast state, shuffle around state so that as-req is inited earlier 2011-07-24 20:24:34 -07:00
Love Hörnquist Åstrand
04128ac081 Use reply_key from fast layer. 2011-07-24 20:24:34 -07:00
Love Hörnquist Åstrand
fd7c870550 add reply reply_key 2011-07-24 20:24:34 -07:00
Love Hörnquist Åstrand
a5e342f8ba Add fast_state. 2011-07-24 20:24:34 -07:00
Love Hörnquist Åstrand
8060a561db switch to KRB5_ENCTYPE 2011-07-24 16:02:22 -07:00
Love Hörnquist Åstrand
f60ec15834 partly unify enctype/keytype since there is only enctypes 2011-07-24 14:03:08 -07:00
Love Hörnquist Åstrand
0f489b7b28 unexport krb5_init_etype, remove duplicate code 2011-06-14 21:08:52 -07:00
Nicolas Williams
2fbad6432b Initial support for default_{as, tgs}_etypes.
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2011-06-14 20:35:19 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00