Commit Graph

98 Commits

Author SHA1 Message Date
Nicolas Williams
cbe156d927 Use OpenSSL 3.x _only_ and implement RFC 8636
- No more OpenSSL 1.x support
 - Remove 1DES and 3DES
 - Remove NETLOGON, NTLM (client and 'digest' service)
2026-01-18 19:06:16 -06:00
Nicolas Williams
7439820618 hcrypto, otp: Remove hcrypto and otp!
We must switch to OpenSSL 3.x, and getting lib/hcrypto to provide
OpenSSL 3.x APIs is too large an undertaking.  Plus the hcrypto backend
is not safe, not secure (probably has timing leaks galore), and no one
has the resources to make it a world-class crypto library, so it just
has to go.
2026-01-18 16:09:31 -06:00
Nicolas Williams
07ce06e7b2 kadm5: Add test_marshall program
The lib/kadm5/test_marshall program allows one to construct and check
encodings for various struct types for which we have
{kadm5,krb5}_{ret,store}_<type>() functions.

Currently supported are:

 - krb5_keyblock
 - krb5_principal
 - krb5_times
 - krb5_address
 - krb5_addresses
 - krb5_authdata
 - krb5_creds
 - krb5_key_data
 - krb5_tl_data
 - kadm5_principal_ent_rec

With this we'll be able to a) construct test vectors, b) use those to
drive fuzzing with AFL or other fuzzers.
2022-12-21 22:14:03 -06:00
Luke Howard
803efebca5 krb5, kadm5: refactor plugin API
Refactor plugin framework to use a single list of loaded plugins; add a new
plugin API where DSOs export a load function that can declare dependencies and
export multiple plugins; refactor kadm5 hook API to use krb5 plugin framework.

More information in krb5-plugin(7).
2019-01-03 20:06:27 -06:00
Radoslav Bodo
f3f06fcba9 kadmin selective prune of historic key for principal 2018-12-31 14:17:10 -06:00
Luke Howard
62c1790bf5 kadm5: pre/post-commit plugin hook for kadm5 update operations (#397)
This change adds plugin support to the kadmin libraries for performing
actions before and after a password change is committed to the KDC database
and after a change is made to the attributes of a principal (specifically,
a change to DISALLOW_ALL_TIX).

This change adds a hook_libraries configuration option to the [kadmin]
section of krb5.conf (or kdc.conf if you use that file) that must be set
to load the module. That configuration option is in the form:

[kadmin]
  hook_libraries = /usr/local/lib/krb5/plugins/kadm5_hook/krb5_sync.so

where the value is the full path to the plugin that you want to load. If
this option is not present, kadmind will not load a plugin and the changes
from the patch will be inactive. If this option is given and the plugin
cannot be loaded, kadmind startup will abort with a (hopefully useful)
error message in syslog.

Any plugin used with this patch must expose a public function named
kadm5_hook_init of type kadm5_hook_init_t that returns a kadm5_hook structure.
See sample_hook.c for an example of this initialization function.

typedef struct kadm5_hook {
    const char *name;
    uint32_t version;
    const char *vendor;
    void (KRB5_CALLCONV *fini)(krb5_context, void *data);

    krb5_error_code (KRB5_CALLCONV *chpass)(krb5_context context,
					    void *data,
					    enum kadm5_hook_stage stage,
                                            krb5_error_code code,
                                            krb5_const_principal princ,
                                            uint32_t flags,
                                            size_t n_ks_tuple,
                                            krb5_key_salt_tuple *ks_tuple,
                                            const char *password,
                                            char **error_msg);
    ...
};

where enum kadm5_hook_stage is:

enum kadm5_hook_stage {
    KADM5_HOOK_STAGE_PRECOMMIT,
    KADM5_HOOK_STAGE_POSTCOMMIT
};

init creates a hook context that is passed into all subsequent calls.
chpass is called for password changes, create is called for principal
creation (with the newly-created principal in the kadm5_principal_ent_t
argument), and modify is called when a principal is modified. The purpose of
the remaining functions should be self-explanatory.

returning 0 on success and a Kerberos error code on failure, setting the
Kerberos error message in the provided context. The error code passed in is
valid for post-commit hooks and contains the result of the update operation.

This change is submitted under the following license

Copyright 2012, 2013
The Board of Trustees of the Leland Stanford Junior University

Portions Copyright 2018 AuriStor Inc.

Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty provided the copyright notice and
this notice are preserved. This file is offered as-is, without any
warranty.
2018-12-26 11:04:05 -06:00
Nicolas Williams
de4bd036e1 lib/kadm5 parallel build fix went too far 2016-11-28 21:56:16 -06:00
Nicolas Williams
923105d130 Fix lib/kadm5 parallel build 2016-11-28 21:48:45 -06:00
Nicolas Williams
e1a244f0aa Make it possible to include krb5_locl.h in kadm5
This and ffc525aad1 are the correct fix
rather than f1d73a8e46.  The next commit
reverts f1d73a8 by re-applying ffc525a.
2016-04-11 16:00:12 -05:00
Viktor Dukhovni
579393c8b9 Optionally prune old keys when setting new keys.
When new keys are added (typically via kadm5_setkey_principal_3),
truncate the key history to remove old keys, that is keys older than
the newest key which was in effect prior longer ago than the principal's
maximum ticket lifetime.  This feature is controlled via the "[kadmin]"
section's "prune-key-history" boolean parameter, which defaults to false.

Currently this happens only when kadm5_setkey_principal_3()
is called directly on the server, the client API simulates
kadm5_setkey_principal_3() via a get, update, modify sequence that does
not prune the key history.  The plan is to add a new kadm5 protocol RPC
and convert clients to call that instead.

In setkey_principal_3 seal keys after entry key update

Also, for now, don't check the return value of kadm5_log_modify() in
the new kadm5_s_setkey_principal_3().  This has to be addressed more
globally.

Censor stale keys in kadm5_s_get_principal
2016-02-26 15:43:12 -05:00
Nicolas Williams
c6f24e99f0 Revamp cf/db.m4; test LMDB 2016-02-26 00:55:32 -06:00
Chaskiel Grundman
41da16b48a version-script-client.map needs to be in dist
version-script-client.map needs to be in lib/kadm5's EXTRA_DIST,
otherwise make distcheck fails
2014-07-07 12:39:49 -04:00
Jakub Čajka
6affa4ccec kadm5: fix race in Makefile with kadm5_err.h
When running make with -j4, occasionally kadm5 fails due to a missing
header file kadm5_err.h. Fix the race condition.

Reported at https://bugzilla.redhat.com/1115164

Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
2014-07-01 13:18:09 -06:00
Russ Allbery
22c7f07ed8 Add symbol versioning for libkadm5clnt
In order to support plugins for kadmin that use libkadm5srv, the
libkadm5clnt library has to be versioned to avoid hijacking all
of the function calls that should go to the server library.  Omit
the _kadm5_ clients from the public interface, and version
everything else.

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2013-12-23 13:20:26 +01:00
Roland C. Dowdeswell
be5afdbf7f Make concurrent builds work.
To stop the errors when building concurrently, we make a number of
changes:

        1.  stop including generated files in *_SOURCES,

        2.  make *-protos.h and *-private.h depend on the *_SOURCES,

        3.  make all objects depend on *-{protos,private}.h,

        4.  in a few places change dir/header.h to $(srcdir)/dir/header.h,

This appears to work for me with make -j16 on a 4-way box.
2012-08-08 00:04:04 +01:00
Linus Nordberg
2e35198908 Add version-script.map to _DEPENDENCIES.
Added to 11 out of 14 directories with map files.  Not lib/ntlm,
lib/hcrypto and kdc which have the map file as an explicit dependency
to _OBBJECTS.

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2011-07-24 14:07:59 -07:00
Love Hörnquist Åstrand
12403a31ce sprinkle more windows files 2011-07-23 11:18:21 -07:00
Love Hörnquist Åstrand
7aaba443bc add NTMakefile and windows directories 2011-07-17 12:16:59 -07:00
Love Hornquist Astrand
4835144bb2 Install kadm5-pwcheck.h header
Prompted by bug from Russ Allbery
2009-12-09 22:40:10 +01: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
dc4e8669ea Abstract out asn1_compile and slc 2009-09-16 00:12:13 -07:00
Love Hörnquist Åstrand
ae799d89d9 add check-cracklib.pl, flush.c, sample_passwd_check.c
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22403 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-11 14:37:26 +00:00
Love Hörnquist Åstrand
e70153e4a9 build sample_passwd_check.la as part of noinst.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21902 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-08-10 06:06:05 +00:00
Love Hörnquist Åstrand
60be9f084a add version-script for libkadm5srv.la
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21778 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-08-01 06:43:22 +00:00
Love Hörnquist Åstrand
0382061b7b add configuration for signal file and acl file, let user select hostname, catch signals and print why we are quiting, make nop cause one new version, not two
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21756 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-31 22:15:08 +00:00
Love Hörnquist Åstrand
19735d6efe New library version.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21445 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-10 12:45:08 +00:00
Love Hörnquist Åstrand
7ba2b2006c rename des to hcrypto
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20466 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-20 08:29:05 +00:00
Love Hörnquist Åstrand
0a66d3e486 use LIBADD_roken
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19985 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-17 18:45:03 +00:00
Love Hörnquist Åstrand
b6d9890960 update version number and remove depenency on libvers for libraries
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19974 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-17 17:30:31 +00:00
Love Hörnquist Åstrand
e13178a048 Add LIB_com_err to pacify AIX
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19185 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-28 22:34:38 +00:00
Love Hörnquist Åstrand
1b9fae5253 more files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18653 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-20 15:52:20 +00:00
Love Hörnquist Åstrand
056a9e0dd9 fix local install-build-headers (again * 2)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18342 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-07 22:54:13 +00:00
Love Hörnquist Åstrand
3e8d2b6dce fix local install-build-headers (again)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18341 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-07 22:50:47 +00:00
Love Hörnquist Åstrand
11a471b14f fix local install-build-headers
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18340 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-07 22:49:18 +00:00
Love Hörnquist Åstrand
a887c3389a split build files into dist_ and noinst_ SOURCES
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18282 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-07 09:11:49 +00:00
Love Hörnquist Åstrand
a6141957fa split build files into dist_ and noinst_ SOURCES
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18281 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-07 09:06:23 +00:00
Love Hörnquist Åstrand
2474f31fd1 (libkadm5clnt.la) doesn't depend on libhdb, remove dependency
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16566 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-15 20:28:41 +00:00
Love Hörnquist Åstrand
78040f283f man_MANS += iprop-log.8
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15979 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-24 18:44:40 +00:00
Love Hörnquist Åstrand
696fa86fa0 Move truncate_log and replay_log into iprop-log.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15974 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-24 18:09:08 +00:00
Love Hörnquist Åstrand
afbd69ded6 Make this work with a clean directory.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15973 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-24 17:36:21 +00:00
Love Hörnquist Åstrand
08d4557928 New program iprop-log that incorperates dump_log as a subcommand,
truncate_log and replay_log soon to come after.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15968 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-24 14:20:14 +00:00
Love Hörnquist Åstrand
61517aa5f0 man_MANS += iprop.8
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15095 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-05-05 19:51:37 +00:00
Love Hörnquist Åstrand
19963908b4 bump version to 7:7:0 and 6:5:2
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14598 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-02-24 15:45:23 +00:00
Love Hörnquist Åstrand
cd3c0f2aa6 man_MANS = kadm5_pwcheck.3
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13966 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-06-21 11:18:33 +00:00
Love Hörnquist Åstrand
a841a7ff7d (SOURCES_client): += ad.c
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13874 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-05-26 17:01:01 +00:00
Love Hörnquist Åstrand
d804698297 test program for verifying password quality function
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12986 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-10-10 01:09:10 +00:00
Love Hörnquist Åstrand
06bf61ec4a add and enable check program default_keys
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12741 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-09-03 00:46:50 +00:00
Johan Danielsson
904fa51b33 generate kadm5-{protos,private}.h
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11112 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-08-16 20:57:09 +00:00
Assar Westerlund
7eb959f340 (libkadm5srv_la_LDFLAGS): set version to 7:5:0
(libkadm5clnt_la_LDFLAGS): set version to 6:3:2


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10880 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-03-10 23:51:49 +00:00
Johan Danielsson
dc82f01d34 link with LIB_pidfile
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10662 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-09-05 14:14:56 +00:00