Commit Graph

29373 Commits

Author SHA1 Message Date
Nicolas Williams
d336730534 roken: Add (re)allocating strvis functions
These are a Heimdal innovation.
2021-01-13 20:17:58 -06:00
Nicolas Williams
57c3219e2c appveyor: Fix build
It's not entirely clear why pacman broke, or what the right way to fix
it is.  This is an attempt.
2021-01-13 20:17:21 -06:00
Nicolas Williams
23f553ffd5 asn1: Generate 1/0 instead of TRUE/FALSE
TRUE/FALSE may not be defined, so emitting those symbols when generating
code for `... BOOLEAN DEFAULT TRUE -- or FALSE` causes the generated
code to fail to compile.  We could move the definitions of TRUE/FALSE to
krb5-types.h, or maybe we could have an asn1_compile option to force
inclusion of more than one header file so we can have headers defining
such constants.  But the simplest fix is to just emit 1/0 instead of
TRUE/FALSE.

This explains why some BOOLEAN DEFAULT usages in PKIX are made OPTIONAL
in Heimdal.
2020-12-18 00:44:47 -06:00
Nicolas Williams
7d5c309eee asn1: TRUE is 1, not 0 2020-12-18 00:44:47 -06:00
Nicolas Williams
01fb86c0a6 roken: rk_strpoolfree(NULL) should work 2020-12-18 00:44:47 -06:00
Nicolas Williams
137638a6fe asn1: Fix C enum v1 conflict 2020-12-18 00:44:47 -06:00
Nicolas Williams
45451814b3 asn1: Add breadcrumbs for future work 2020-12-16 15:12:00 -06:00
Nicolas Williams
7f0349e1fb asn1: Import ASN.1 modules from RFCs 4043 and 4108
In preparation for adding support for TPM attestations as an authentication
method in bx509d for a host trust bootstrap mechanism based on TPMs and their
endorsement keys and endorsement key certificates.

The plan is to add support to libhx509 and hxtool for PermanentIdentifier
(RFC4043) and HardwareModuleName (RFC4108) SANs, and then to add a query
parameter to bx509d for passing an attestation and a proof-of-possession
(either CMS or CSR), and add an authorizer plugin call for authorizing a device
manufacturer and serial number to hostname.  Support for TPMs w/o endorsement
key certificates should also be possible based on a digest of the endorsement
key as the "serial number".
2020-12-16 15:11:51 -06:00
Luke Howard
fb6f89f295 lib/krb5: do not pack ccapi on Apple Silicon
macOS packs ccapi structures to 16 bits on PowerPC and Intel platforms only;
no special packing is used on ARM (Apple Silicon). Harmonize so Heimdal is ABI
compatible.
2020-11-19 11:04:19 +11:00
duncan-mcewan
06c871ef5a Add more test cases for issue #704 2020-11-06 12:55:31 -05:00
duncan-mcewan
72055a2911 Fix incorrect pointer increment
When encountering a backslash character the memmove() call removes it.  But then the pointer p should only be incremented by 1 to skip the escaped character rather than 2, which also skips the character following the escaped one.
2020-11-06 12:55:31 -05:00
Jeffrey Altman
70ac849844 lib/krb5: acc_resolve_2 leak if ccErrCacheNotFound
Fix the possible leak of 's' allocated by asprintf()

When squashing the changes reference "this fixes an issue introduced by 7bf4d76 ("krb5: Improve cccol sub naming; add gss_store_cred_into2()")" in the commit message.
2020-11-06 09:09:01 -05:00
Nicolas Williams
68eba10cf1 krb5: Fix API: ccache failure 2020-11-06 09:09:01 -05:00
Nicolas Williams
5716b51c18 hdb: Fix HDB corruption with LMDB backend 2020-10-27 13:30:57 -05:00
Nicolas Williams
ea8f3991fb hdb: Fix leak in SQLite3 backend 2020-10-27 13:30:57 -05:00
Nicolas Williams
21e2ba2573 sqlite: Upgrade to SQLite3 3.33.0 2020-10-27 13:30:57 -05:00
Nicolas Williams
2036b431dc krb5: Expose trace functions 2020-10-27 13:30:57 -05:00
Nicolas Williams
a7ba8855cc travis: get stack traces from cores on OS X too 2020-10-27 13:30:57 -05:00
Roland C. Dowdeswell
dcac4e1ff9 gss-token: implement -m to specify what mech to use. 2020-10-12 21:55:51 +01:00
Roland C. Dowdeswell
4336c944e0 gss-token: turn initiator and acceptor into loops. 2020-10-12 21:55:51 +01:00
Roland C. Dowdeswell
0055c1c80b gss-token: implement -S to split tokens up on output. 2020-10-12 21:55:51 +01:00
Roland C. Dowdeswell
9693bdb272 gss-token: restructure and refactor the code a bit. 2020-10-12 21:55:51 +01:00
Roland C. Dowdeswell
ca59ee0ddd Add flags and options missing from upstream gss-token. 2020-10-12 21:55:51 +01:00
Roland C. Dowdeswell
8f0506c514 gssapi/gssapi.h: we need stdarg.h because va_list is ref'd here. 2020-10-12 21:55:51 +01:00
Nicolas Williams
5d156a5799 hdb: Fix concurrency test 2020-10-08 20:34:38 -05:00
Nicolas Williams
18e8ccf4c2 hdb: WAL mode setting was done incorrectly 2020-10-08 20:34:15 -05:00
Nicolas Williams
da04b45c7f hdb: Fix SQLite3 backend bug 2020-10-08 20:30:21 -05:00
Nicolas Williams
f87ba4f23b hdb: Test LMDB and SQLite3 HDB concurrency
Test that we can dump an HDB w/o blocking write transactions.

This currently works for different processes (both backends), but not
for threads (for either backend), and it's not yet clear why.
2020-10-06 14:16:35 -05:00
Nicolas Williams
8c7900c40b hdb: Use db type preference from ./configure
Use the HDB backend type from the --with-db-type-preference=... option
to ./configure to make the default HDB backend more stable.
2020-10-05 14:51:03 -05:00
Nicolas Williams
93ada1fbf6 hdb: Remove default HDB backend footgun
Do not allow a change in build configuration time default HDB backend
selection cause existing default HDBs to not be possible to open.

Otherwise such a change will cause a KDC configured to use the default
HDB (i.e., without setting it in the "database" stanza in the "[kdc]"
section of krb5.conf) to not start.
2020-10-05 14:51:03 -05:00
Nicolas Williams
3f7868b969 httpkadmind: Fix error clobbering 2020-09-29 16:25:12 -05:00
Nicolas Williams
7ae2dfd853 krb5: Fix error msg when removing keytab entries
If a keytab was 0400 and one tried to delete with ktutil del then the
error message one would get prior to this commit is "entry not found".
2020-09-25 14:56:44 -05:00
Nicolas Williams
060ff3e09f httpkadmind: Check that host keys not vended 2020-09-25 11:10:09 -05:00
Nicolas Williams
753e636274 hdb: Fix new key delay special casing of kvno 1 2020-09-22 18:27:05 -05:00
Nicolas Williams
7845bda1e0 kadm5: Do not apply new service key delay in get
Using HDB_F_DELAY_NEW_KEYS in kadm5_s_get_principal() breaks OSKT's
expectations.
2020-09-19 21:48:49 -05:00
Nicolas Williams
95de81c9a7 kadm5: Avoid close(-1) 2020-09-18 14:31:43 -05:00
Nicolas Williams
461f360b58 iprop: Slight test race condition fix
tests/kdc/check-iprop.in tends to wait for a log message then it reads a
status file.  Well, we shouldn't write the log message before writing
the status file then!
2020-09-18 14:31:43 -05:00
Nicolas Williams
916cafe4e5 iprop: Warn about failures to write to iprop log 2020-09-18 14:31:43 -05:00
Nicolas Williams
7c947df247 ipropd: Improve multi-realm support
Running ipropd-slave on a system whose hostname's realm is not the
requested realm breaks.  Since the iprop client principal should really
be in the same realm as the master, we now force it after calling
krb5_sname_to_principal().
2020-09-18 14:31:43 -05:00
Nicolas Williams
0e09fa7fde iprop: Support hierarchical iprop 2020-09-18 14:31:43 -05:00
Nicolas Williams
c12ca129b6 httpkadmind: Fix FD leak
Using `mkstemp()` is nice, but if you don't need the FD, then don't
forget to close it!
2020-09-15 15:24:29 -05:00
Nicolas Williams
4a4ceaf287 httpkadmind: Fix NULL deref on ENOMEM 2020-09-15 11:31:29 -05:00
Nicolas Williams
3c7d12e116 krb5: Fix FD leak in ENOMEM in stdio_from_fd 2020-09-15 11:26:52 -05:00
Nicolas Williams
b2b6599f87 krb5: Fix NULL deref on ENOMEM in fkt_add_entry(2) 2020-09-15 11:26:06 -05:00
Nicolas Williams
f2f2cd18b6 kadm5: Fix auth_context leak on reconnect 2020-09-14 17:11:08 -05:00
Nicolas Williams
096888fe31 krb5: Fix NULL deref on ENOMEM in fkt_add_entry() 2020-09-14 16:38:20 -05:00
Nicolas Williams
821dcaec70 hdb: Test hdb_validate_key_rotations() 2020-09-09 22:45:17 -05:00
Nicolas Williams
ff13573ce5 hdb: Do not apply new service key delay to clients
The new [hdb] new_service_key_delay parameter should not apply to
principal entries when used as clients.  Otherwise new passwords would
not take effect immediately, and that would be very confusing.
2020-09-09 21:48:29 -05:00
Nicolas Williams
18459de867 travis: Install curl too 2020-09-08 14:34:08 -05:00
Nicolas Williams
9574783d04 kdc: Add httpkadmind
TBD:

 - improve error handling, logging, tracing!
 - move all REST services out of kdc/
2020-09-08 14:34:08 -05:00