206 Commits

Author SHA1 Message Date
Nicolas Williams
1baec53f8d kpasswdd: Fix out-of-bounds read (#1058) 2023-01-04 01:36:02 -06:00
Nicolas Williams
ff4c82cd47 kpasswdd: Fix leak of keytab on exit 2022-01-19 13:41:29 -06:00
Nicolas Williams
cb751670dd kpasswdd: Fix warning 2022-01-14 17:10:16 -06:00
Nicolas Williams
4aa8677081 kadm5: Use KADM5_PASS_Q_GENERIC 2021-12-16 10:40:01 +11:00
Nicolas Williams
1ae941af9b roken_detach_prep() should return fd 2019-10-03 13:09:18 -05:00
Luke Howard
014f16883c libhcrypto: UI_UTIL_FLAG_VERIFY_SILENT 2018-12-30 15:39:49 -06:00
Luke Howard
c6bf100b43 kadm5: move password quality checks out of daemons and into libkadm5
Note that this has a slight behavior change to c89d3f3b in order to continue
allow kadmin in local mode to bypass password quality checks. Password quality
checks are always bypassed if the *client* kadmin principal is kadmin/admin,
i.e. that of the kadmin service itself. This is the case when running kadmin in
local mode. As this is the equivalent of a superuser account, one would
anticipate that deployments would use specific administrator instances for
appropriate ACLs for day-to-day administration; operations by these will be
subject to password quality checks if enforce_on_admin_set is TRUE, or if the
user is changing their own password.
2018-12-26 11:04:05 -06:00
Luke Howard
d150c9989b kpasswd: don't log "Changing password for %s" when setting password
Fix a regression introduced in c89d3f3b where administrative password changes
would be logged as user password changes, if enforce_on_admin_set was set.
2018-12-26 16:45:59 +11:00
Luke Howard
c89d3f3b8c kadmin: allow enforcing password quality on admin password change
This patch adds the "enforce_on_admin_set" configuration knob in the
[password_quality] section. When this is enabled, administrative password
changes via the kadmin or kpasswd protocols will be subject to password quality
checks. (An administrative password change is one where the authenticating
principal is different to the principal whose password is being changed.)

Note that kadmin running in local mode (-l) is unaffected by this patch.
2018-12-26 15:38:48 +11:00
Viktor Dukhovni
7dc4481ed2 Avoid interposing pidfile(), use rk_pidfile() instead 2016-12-19 19:10:49 -05:00
Nicolas Williams
3ba12317a0 Misc fixes (coverity) 2016-11-28 15:09:55 -06:00
Jeffrey Altman
87d56ef018 kpasswd: check krb5_unparse_name return
In verify() if krb5_unparse_name() fails 'sname' will be used
unitialized in the subsequent krb5_warnx() and free() calls.

Change-Id: I5a49bf06879eb5a77cf2d1d3f0d4b9c6549aeff8
2016-04-17 15:17:30 -05:00
Nicolas Williams
490337f4f9 Make OpenSSL an hcrypto backend proper
This adds a new backend for libhcrypto: the OpenSSL backend.

Now libhcrypto has these backends:

 - hcrypto itself (i.e., the algorithms coded in lib/hcrypto)
 - Common Crypto (OS X)
 - PKCS#11 (specifically for Solaris, but not Solaris-specific)
 - Windows CNG (Windows)
 - OpenSSL (generic)

The ./configure --with-openssl=... option no longer disables the use of
hcrypto.  Instead it enables the use of OpenSSL as a (and the default)
backend in libhcrypto.  The libhcrypto framework is now always used.

OpenSSL should no longer be used directly within Heimdal, except in the
OpenSSL hcrypto backend itself, and files where elliptic curve (EC)
crypto is needed.

Because libhcrypto's EC support is incomplete, we can only use OpenSSL
for EC.  Currently that means separating all EC-using code so that it
does not use hcrypto, thus the libhx509/hxtool and PKINIT EC code has
been moved out of the files it used to be in.
2016-04-15 00:16:17 -05:00
Nicolas Williams
33e3f7fb94 kpasswd-generator: fix sizeof() 2016-02-29 19:13:13 -06:00
Nicolas Williams
c6f24e99f0 Revamp cf/db.m4; test LMDB 2016-02-26 00:55:32 -06:00
Nicolas Williams
b48bed5f42 Daemons detach atomically to avoid having to wait
Tests that start daemons have to "wait" for them to start.

This commit makes Heimdal daemons prep to detach (when requested) by
forking early, then having the child signal readiness to the parent when
the child really is ready.  The parent exits only which the child is
ready.  This means that tests will no longer need to wait for daemons.

However, tests will still need a pidfile or such so they can stop the
daemons.

Note that the --detach options should not be used on OS X from launchd,
only from tests.
2015-03-24 11:49:59 -05:00
Love Hornquist Astrand
1d84562886 add HDBGET: that only supports get, iteration doesnt really make sense for the HDB keytab except when dumping 2013-10-15 12:40:39 +02:00
Jeffrey Altman
6bd12cb399 kpasswd: move roken.h after config.h in kpasswd_local.h
With roken.h at the end of the include list two different versions
of Winsock get imported on Windows.  roken.h should always be
immediately after config.h if included.

Change-Id: Id3f6761028ddaa5b44183fe6648c5ab292ca8865
2013-09-10 22:31:30 -04:00
Viktor Dukhovni
511cd18458 kpasswdd should not enforce principal realm =~ default realm(s)
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2013-04-24 16:27:16 -07:00
Roland C. Dowdeswell
e8779d5d4a Add -Wshadow and deal with the warnings. 2012-02-21 11:17:55 +00: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
Love Hornquist Astrand
a66a23bb45 Apply old patch from me that handles client's behind NAT
Tested by Harald Barth and bugfix by Ragnar Sundblad
2011-12-15 22:00:00 -08:00
Love Hornquist Astrand
c4d97ae93e encode result code with right length, pointed out by Rangar Sundblad, thanks! 2011-12-11 18:22:29 -08:00
Love Hornquist Astrand
2eb0d6ec82 dont entrust sprintf to encode binary packets 2011-12-11 18:08:05 -08:00
Nicolas Williams
a5e77c578e Deferred hostname canon using name canon rules 2011-10-22 14:54:13 -05:00
Nicolas Williams
e16360e2db Add --keepold option to cpw. 2011-07-22 16:07:05 -05:00
Love Hörnquist Åstrand
7aaba443bc add NTMakefile and windows directories 2011-07-17 12:16:59 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Thomas Klausner
3772533acd Convert to UTF-8.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-05-21 11:54:21 -07:00
Thomas Klausner
db8e287e41 Use "Fl Fl" for long options.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-05-21 11:54:14 -07:00
Love Hornquist Astrand
b1909b2daa Fixes from NetBSD via Thomas Klausner and Roland C. Dowdeswell 2011-05-04 21:31:10 -07:00
Love Hornquist Astrand
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Asanka C. Herath
cb712170ff Windows: Build and install kpasswd 2010-11-24 15:33:00 -05:00
Andrew Bartlett
d9f4d53dda s4:heimdal Use correct variable to advance past -- options in kpasswd
This bug was introduced when kpasswd was migrated to a local getarg()
call, in Heimdal commit 7dd146072c

Andrew Bartlett

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-03-27 01:20:52 -07:00
Russ Allbery
97648fc257 Disable kpasswdd error replies to completely malformed requests
Only send an error reply if the request passes basic verification.
Otherwise, kpasswdd would reply to every UDP packet, allowing an
attacker to set up a ping-pong DoS attack via a spoofed UDP packet with
a source address of another UDP service that also replies to every
packet.

Also suppress the error reply if ap_req_len is 0, since this indicates
an error packet.  An error packet may be the result of a ping-pong
attacker pointing us at another kpasswdd.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-03-16 11:50:22 -07:00
Love Hornquist Astrand
c867fd3e2e Make libtool pull in the depenency on libldap
Put in explicy depenency on libdap so that libtool
might to the right thing for us.

Patch from Jan Rekorajski
2009-12-08 00:15:10 -08:00
Love Hornquist Astrand
c6bbdb545b First drop of Windows build infrastructure from Secure Endpoints 2009-11-24 12:12:53 -08:00
Love Hornquist Astrand
7dd146072c switch to getarg directly 2009-11-23 07:36:34 -08:00
Love Hornquist Astrand
01ae59fb03 Copyright (c) 1997, 2000 - 2005 Kungliga Tekniska Högskolan 2009-10-24 14:18:05 -07:00
Love Hornquist Astrand
290255ee0b Drop optind variable since its only set (and -Wshadow libsystem)
From Matthias Dieter Wallnöfer
2009-10-16 08:26:43 -07:00
Love Hörnquist Åstrand
aa5b66d1e8 plug a memory leak.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25324 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-07-15 22:16:49 +00:00
Love Hörnquist Åstrand
b77ee0c2f8 Close f, from cppcheck
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25277 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-06-08 20:33:22 +00:00
Love Hörnquist Åstrand
5c0fc04d81 use krb5_cc_new_unique, use constants for cache types
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25050 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:05:48 +00:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
979ac09247 return exit_value
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23508 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-08-11 10:00:39 +00:00
Love Hörnquist Åstrand
07482fe5ad Switch to krb5_set_password.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23398 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-26 18:28:07 +00:00
Love Hörnquist Åstrand
185e54925d use krb5_free_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23321 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-24 23:49:06 +00:00
Love Hörnquist Åstrand
d26d184367 Use hdb_db_dir().
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22252 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-09 05:59:34 +00:00
Love Hörnquist Åstrand
2cfc283d68 Fix pointer vs strict alias rules.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21511 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-12 12:43:46 +00:00