Commit Graph

1013 Commits

Author SHA1 Message Date
Roland C. Dowdeswell d67a2c36c4 tests: avoid ephemeral port range
On our MacOS X CI job, provjobd2 sometimes held local TCP port 49195,
colliding with check-iprop.  And so we move all listening ports in the
test setup out of the ephemeral port ranges on Linux and Mac.
2026-06-16 09:46:42 -05:00
Roland C. Dowdeswell e1ab030717 kdc: reject kx509 requests when disabled
Fixes #1378.
2026-05-28 21:30:06 -05:00
Roland C. Dowdeswell abec12ef7f ipropd-slave: get a TGT before authenticating
Do not request an iprop/<master> initial ticket directly. With
name_canon_rules = as-is: this can leave the acquired credential
mismatched with what krb5_sendauth() later asks for. Get a normal TGT
and let sendauth acquire the service ticket.

Fixes #1332.
2026-05-26 17:20:15 -05:00
Roland C. Dowdeswell 2e3bb95430 Add KDC-free GSS tests 2026-05-25 20:18:06 -05:00
Roland C. Dowdeswell a105e8e117 tests: cover MEMORY gss_store_cred storage for #132 2026-05-25 20:01:05 -05:00
Roland C. Dowdeswell 73bab3fea5 tests/kdc/leaks-kill.sh: typo 2026-05-25 17:32:30 -05:00
Jennifer Sutton 378a367c9e kdc: Allow KDC plugin to handle attempts to authenticate without using hardware authentication
Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2026-05-20 11:47:28 -05:00
Nicolas Williams 4fe0ad8e2c GHA: Get diagnostics data from hanging check-context test 2026-02-07 22:45:45 -06:00
Nicolas Williams ce85c64b84 iprop: Make ipropd-master not lock the log (fix #1308) 2026-02-07 17:59:03 -06:00
Nicolas Williams df0e15fcdf tests: Disable cheeck-iprop until fix is ready 2026-01-24 14:42:38 -06:00
Nicolas Williams 118004e85c Revert "tests: Speed up tests/gss/check-gssmask"
This reverts commit 366016b1f6.
2026-01-22 10:48:59 -06:00
Taylor R Campbell 82f7b8072c Nix bashisms.
This isn't fully POSIX shell, because POSIX shell still doesn't have
`local' variable declarations, but at least it is reasonably portable
now.

fix https://github.com/heimdal/heimdal/issues/1299
2026-01-21 12:40:26 -06:00
Nicolas Williams 4d80b16a30 Revert "kdc: Fix kinit of principal aliases"
This reverts commit d2047065bd.
2026-01-21 11:37:25 -06:00
Nicolas Williams d2047065bd kdc: Fix kinit of principal aliases 2026-01-20 13:48:25 -06:00
Nicolas Williams b02d4d4569 krb5: Add SOCKS4a test 2026-01-20 12:57:01 -06:00
Nicolas Williams 76db37d833 sanon: Do not acquire creds for GSS_C_NO_NAME 2026-01-18 23:47:40 -06:00
Taylor R Campbell 814f03ad7f kdc_test_plugin: rk_UNCONST for krb5_pac_add_buffer. 2026-01-18 19:06:17 -06:00
Nicolas Williams f36629d150 osx: Fix check-iprop 2026-01-18 19:06:16 -06:00
Nicolas Williams ae7d6746d1 gsstool: Add GSS-based kinit-like acquire_cred cmd
This has most of the features needed to act as a kinit that uses GSS
APIs, specifically gss_acquire_cred_from() and gss_store_cred_into2().

It's missing some functionality, such as being able to drive prompts
from AS responses (if we add minor status codes for representing KDC
pre-auth proposals, then we do drive prompts, but we would have to
encode a lot of mechanism-specific knowledge into gsstool).

The point of this commit is to explore:

 - GSS functionality for kinit-like actions

 - credential store key/value pairs supported by the mechanisms

 - document the credential store key/value pairs (in gsstool.1)

that might lead to further enhancements.  But gsstool acquire-cred
is quite functional at this point!
2026-01-18 19:06:16 -06:00
Nicolas Williams 8964be1eee tests: Prep for older Heimdal interop testing 2026-01-18 19:06:16 -06:00
Nicolas Williams d1f56c6966 tests: Work around OpenSSL legacy provider being disabled 2026-01-18 19:06:16 -06:00
Nicolas Williams b9773f7839 tests: Add another MIT Kerberos interop test
We do a small amount of MIT interop testing in tests/kdc/check-fast.in,
which tests some MIT clients against Heimdal KDCs.  This commit adds
more testing via tests/kdc/check-mit-kdc.in, wherein we set up and run
an MIT Kerberos realm and KDCs and test Heimdal clients against it.
2026-01-18 19:06:16 -06:00
Nicolas Williams 9b88e9ec3b tests: Use new framework in tests/gss
Claude-coded with heavy human guidance.  This found several bugs in
tests/gss/check-negoex, and also in SPNEGO.

WARNING: Needs more review.
2026-01-18 19:06:16 -06:00
Nicolas Williams e362d69972 tests: Improving the tests/ framework
- `test_section "..."` replaces `echo "Now we're testing ..."`

 - `test_run ...` replaces `... || { ...; eval "testsfailed"; }`

 - `test_run not ...` replaces `... && { ...; eval "testsfailed"; }`

`test_section` saves the output of the program and shows it only in the
case of failures.

`test_run` arranges to exit with non-zero status if a test fails.
Use `set -e` to force early exit.  Conversely use `set +e` to continue
running the remaining tests when one fails -- this will be very useful
in reducing the number of CI test runs (e.g., GitHub Actions), thus
saving time and money.

This is Claude-generated code, guided by me, with minor corrections.
2026-01-18 19:06:16 -06:00
Nicolas Williams 167849d621 kdc: Replace token validator plugin system 2026-01-18 19:06:16 -06:00
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 318183f90b tests: Avoid DNS 2026-01-18 16:09:31 -06:00
Nicolas Williams d5583d2e54 tests: Make HDB writes async to speed tests 2026-01-18 16:09:31 -06:00
Nicolas Williams 4fd6a9acf0 tests: Work around race in check-iprop
We need to wait_for the changes to show up, not for log messages or log
entries.  The latter can come before the HDB writes are committed.
2026-01-18 16:09:31 -06:00
Nicolas Williams 10271fe8d5 klist: Show ticket session key enctype too 2026-01-18 16:08:40 -06:00
Nicolas Williams 21bcabb47f ldap: Switch from bdb to mdb 2026-01-18 16:08:40 -06:00
Nicolas Williams 6dc1508e8c gss: Add threaded testing of GSS-API! 2026-01-18 16:08:40 -06:00
Nicolas Williams 0d2ee355ee tests: Fix intr --version 2026-01-07 17:49:17 -06:00
Stefan Metzmacher ba8c3dbc62 lib/gssapi/krb5: implement GSS_C_CHANNEL_BOUND_FLAG for gss_init_sec_context()
This will force KERB_AP_OPTIONS_CBT to be sent.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15621

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2024-07-06 16:14:43 -04:00
Nicolas Williams 1b62220778 tests: Use here-doc kadmin in Java test 2024-01-20 16:13:21 -06:00
Nicolas Williams 366016b1f6 tests: Speed up tests/gss/check-gssmask 2024-01-17 16:55:35 -06:00
Nicolas Williams 1aa0a495c2 tests: Use kadmin w/ here-document to speed up tests 2024-01-16 16:28:35 -06:00
Nicolas Williams 016373931d tests: Kill daemons on ^C 2024-01-16 16:28:35 -06:00
Nicolas Williams 7a0915c630 tests: Make check-hdb-mitdb a bit more verbose 2024-01-16 16:28:35 -06:00
Taylor R Campbell ad23636db8 Add a test for potential DNS leaks via symbol interposition.
We build variants of kinit and test_acquire_cred that define their
own symbols rk_dns_lookup, gethostbyname, gethostbyname2, and
getaddrinfo to print a message and abort.  For getaddrinfo, we abort
only if the caller failed to specify AI_NUMERICHOST; otherwise we use
dlsym(RTLD_NEXT, "getaddrinfo") instead.

The new test tests/gss/check-nodns is like tests/gss/check-basic, but
uses kinit_auditdns and test_acquire_cred_auditdns to verify that no
DNS resolution happens.

This test should work and be effective on ELF platforms where the
getaddrinfo function is implemented by the symbol `getaddrinfo'.  On
non-ELF platforms it may not be effective -- and on platforms where
the getaddrinfo function is implemented by another symbol (like
`__getaddrinfo50') it may not work, but we can cross that bridge when
we come to it.

Verified manually that the test fails, with the expected error
message and abort, without `block_dns = yes' in krb5-nodns.conf.  No
automatic test of the mechanism for now because it might not work on
some platforms.

XXX check-nodns.in is copypasta of check-basic.in, should factor out
the common parts so they don't get out of sync.
2024-01-08 10:22:02 -06:00
Nicolas Williams f455ea9834 tests: Make make -j8 check work
In the future we should also make it so that `make check` for `tests/db`,
`tests/gss`, and `tests/kdc` first initializes all the realms and starts all
the daemons, then runs the actual checks possibly in parallel, then shuts down
the daemons.  This will require quite a bit of work, so for now we just disable
parallel make in those directories.
2024-01-03 18:48:02 -06:00
Nicolas Williams d274f0e240 bx509: Test CSRs w/ BasicConstraints in extReq 2023-11-08 14:22:02 -06:00
Nicolas Williams 27cdf81995 kdc: Honor no-auth-data-reqd on cross-real TGTs
Nowadays we use PACs instead of AD-SIGNEDPATH, so we want a PAC on every
TGT, but we don't necessarily want PACs on cross-realm TGTs.

Specifically, we don't interop well yet with AD when issuing cross-realm
TGTs with AD realms as the destination realm (see #1091).
2023-06-23 13:44:13 -05:00
Nicolas Williams 77a452f4fd kdc: Make path to MIT Kerberos for testing configurable 2023-01-04 00:43:35 -06:00
Nicolas Williams 131d90c414 bx509d: Fix tests skipping on OS X 2022-12-21 22:14:03 -06:00
Nicolas Williams fd6597614e bx509d: Add test of IPC CSR authorizer
We have a CSR authorizer plugin for calling to an IPC service.

In this commit we add test implementation of such a service.

We also remove the simple_csr_authorizer plugin and fold its
functionality into the new test_csr_authorizer functionality.
2022-12-15 17:44:41 -06:00
Nicolas Williams f727a4bdfd bx509: Fix test moar 2022-11-02 10:57:55 -05:00
Nicolas Williams 3e1befe633 bx509: Make test run with UBSAN 2022-11-01 16:10:57 -05:00
Nicolas Williams 56c6120522 httpkadmind: Make more like bx509d internally
- Correct handling of POST (before POSTs with non-zero-length bodies
   would cause the server to close the connection).

 - Add CSRF features from bx509d.
2022-10-02 22:46:37 -05:00