Commit Graph

34 Commits

Author SHA1 Message Date
Nicolas Williams
6b64ae2cde kadmin: Fix leak of dup context 2022-03-23 23:39:34 -05:00
Nicolas Williams
621deed047 kadmin: Fix re-entrance in iterations
Any callback of kadm5_iter_principals() that wants to call other kadm5
functions (such as kadm5_get_principal()) needs to do so on a different
kadm5 handle than the one used for kadm5_iter_principals().
2022-03-23 18:03:38 -05:00
Jeffrey Altman
912b20c4d7 kadmin: refactor set_random_password
Obtain the unparsed principal name early so that there is no
risk of memory allocation failure after kadm5_chpass_principal_3()
succeeds.

Change-Id: I389281004826da5752081c2f26127d55e3dc3989
2022-01-21 00:31:56 -05:00
Nicolas Williams
c2b106def5 Fix wrong keepold default in kadmin and ktutil 2019-01-09 00:14:11 -06:00
Nicolas Williams
d8394c65b7 Add new kadmin/ktutil --keep* and --enctypes opts
- Add --keepold/keepallold/pruneall options to various kadmin/ktutil
   commands.  Default behavior to "prune old keys".

 - When setting keys for a service, we need to specify enctypes for it:

    - Always use kadm5_randkey_principal_3() instead of the older
      kadm5_randkey_principal().

    - Add krb5_string_to_keysalts2(), like MIT's krb5_string_to_keysalts(),
      but with a context, and simpler.

    - Add --enctypes options to various kadmin/ktutil commands.

    - Add [libdefaults] supported_enctypes param with enctype[:salttype]
      list.

    - Add [realms] realm supported_enctypes param with enctype[:salttype]
      list.

      Default to aes128-cts-hmac-sha1-96:normal.
2019-01-02 17:29:08 -06:00
Luke Howard
014f16883c libhcrypto: UI_UTIL_FLAG_VERIFY_SILENT 2018-12-30 15:39:49 -06:00
Roland Hopferwieser
bcfe538228 kadmin/cpw: Add error code on password missmatch 2017-10-10 23:22:59 -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
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
Nicolas Williams
0d90e0c4d0 Complete --keepold support and fix crasher in kadmin cpw -r --keepold. 2011-07-22 16:07:06 -05:00
Nicolas Williams
e16360e2db Add --keepold option to cpw. 2011-07-22 16:07:05 -05:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
433b1d5073 drop RCSID 2010-03-16 12:52:58 -07: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
f7238b7deb (cpw_entry): make sure ret have a defined value
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16755 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-02-18 23:30:32 +00:00
Love Hörnquist Åstrand
464c8d8ca6 (cpw_entry): return 1 on failure.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16657 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-25 12:20:49 +00:00
Johan Danielsson
d970c48c81 print error messages to stderr; change all in-string quoting to use "
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14021 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-07-04 15:09:42 +00:00
Johan Danielsson
9929f779ec move kadmin-commands.h from kadmin_locl.h so kadmind does not depend on it
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14000 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-06-27 15:04:07 +00:00
Johan Danielsson
d7f9fac88e convert to use slc; also add stash subcommand
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13970 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-06-21 19:19:45 +00:00
Love Hörnquist Åstrand
54fc57ccb5 s/des_read_pw_string/UI_UTIL_read_pw_string/
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12753 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-09-03 09:37:03 +00:00
Johan Danielsson
49c4b89cbe call this operation "passwd" in usage
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10457 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-08-10 08:05:35 +00:00
Assar Westerlund
91e5aa9091 (cpw_entry): new foreach_principal
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9851 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-05-07 05:30:23 +00:00
Assar Westerlund
cdc518c087 (do_cpw_entry): call set_password if no argument is given, it will
prompt for the password.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8180 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-04-12 10:45:54 +00:00
Assar Westerlund
4bfe69645d add --key
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8052 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-03-23 15:20:43 +00:00
Johan Danielsson
c5b916ca6f remove advertising clause
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7464 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-12-02 17:05:13 +00:00
Assar Westerlund
19e96f8094 (set_password): use correct variable. From Love <lha@e.kth.se>
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6865 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-08-24 23:28:07 +00:00
Assar Westerlund
c22bb92415 add support for --random-password
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6853 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-08-21 12:38:58 +00:00
Johan Danielsson
aaae186ab9 merge new-crypto branch
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5332 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-02-11 21:03:59 +00:00
Assar Westerlund
fc1956b05f new arg_printusage
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5130 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-08-18 21:17:01 +00:00
Assar Westerlund
9ef9b4a301 (do_cpw_entry): initialize `ret'
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5045 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-06-30 16:06:57 +00:00
Johan Danielsson
bae1697bdb Use `foreach_principal'.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4499 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-03-01 04:04:07 +00:00
Johan Danielsson
b7ebe1debf Rename krb5_free_keyblock to krb5_free_keyblock_contents.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3917 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-11 01:52:46 +00:00
Johan Danielsson
a9f1581a4c Simple kadmin utility.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3738 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-01 02:53:06 +00:00