Commit Graph

38 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
d5583d2e54 tests: Make HDB writes async to speed tests 2026-01-18 16:09:31 -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
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
06ba7b1597 test: When kdc fails to start, show the log
This is an attempt to find out why the GitHub Actions OS X build is
failing.
2022-01-20 14:32:17 -06:00
Nicolas Williams
a7f0b14f59 kdc: Fix check-pkinit UPN test misquoting 2021-10-15 14:00:11 -05:00
Nicolas Williams
00358252d3 kdc: Add synthetic PKINIT principals option 2021-06-29 14:52:07 -05:00
Nicolas Williams
dc74e9d00c kdc: Add Heimdal cert ext for ticket max_life
This adds support for using a Heimdal-specific PKIX extension to derive
a maximum Kerberos ticket lifetime from a client's PKINIT certificate.

KDC configuration parameters:

 - pkinit_max_life_from_cert_extension
 - pkinit_max_life_bound

If `pkinit_max_life_from_cert_extension` is set to true then the
certificate extension or EKU will be checked.

If `pkinit_max_life_bound` is set to a positive relative time, then that
will be the upper bound of maximum Kerberos ticket lifetime derived from
these extensions.

The KDC config `pkinit_ticket_max_life_from_cert` that was added earlier
has been renamed to `pkinit_max_life_from_cert`.

See lib/hx509 and lib/krb5/krb5.conf.5.
2021-03-24 19:12:00 -05:00
Nicolas Williams
8e7c7209e8 kdc: Add param to derive max_life from client cert
This adds a KDC configuration parameter that can be used to indicate
that a PKINIT client's certificate's notAfter overrides the client
principal's HDB entry's max_life.  This parameter is a relative time
parameter, and it enables this only if set to a non-zero value (defaults
to zero).  The value of this parameter caps the max_life inferred from
the certificate.
2021-03-23 16:44:50 -05:00
Nicolas Williams
575c67806b Add bx509d 2019-12-04 21:34:44 -06:00
Nicolas Williams
dfada0ccad kx509: Add CSR support
This commit adds support for proof of posession to the kx509 protocol by
using PKCS#10 CSRs.

This allows conveyance of extReq CSR attributes requesting desired
Certificate Extensions.
2019-10-09 20:53:30 -05:00
Nicolas Williams
6a7e7eace6 Add kx509 client and revamp kx509 service
This commit adds support for kx509 in libkrb5, and revamps the KDC's
kx509 service (fixing bugs, adding features).

Of note is that kx509 is attempted optimistically by the client, with
the certificate and private key stored in the ccache, and optionally in
an external PEM or DER file.

NOTE: We do not optimistically use kx509 in krb5_cc_store_cred() if the
      ccache is a MEMORY ccache so we don't generate a key when
      accepting a GSS context with a delegated credential.

kx509 protocol issues to be fixed in an upcoming commit:

 - no proof of possession (this is mostly not too bad, but we'll want to
   fix it by using CSRs)
 - no algorithm agility (only plain RSA is supported)
 - very limited (no way to request any options in regards to the
   requested cert)
 - error codes are not very useful

Things we're adding in this commit:

 - libkrb5 kx509 client
 - automatic kx509 usage hooked in via krb5_cc_store_cred() of start TGT
 - per-realm templates on the KDC side
 - per-realm issuer certificates
 - send error messages on the KDC side
   (this is essential to avoid client-side timeouts on error)
 - authenticate as many error messages
 - add a protocol probe feature so we can avoid generating a
   keypair if the service is not enabled
   (once we add support for ECC algorithms we won't need this
    anymore; the issue is that RSA keygen is slow)
 - support for different types of client principals, not just username:

    - host-based service and domain-based service, each with its own
      template set per-{realm, service} or per-service

   (the idea is to support issuance of server certificates too, not
    just client/user certs)
 - more complete support for SAN types
 - tests (including that PKINIT->kx509->PKINIT works, which makes it
   possible to have "delegation" of PKIX credentials by just delegating
   Kerberos credentials)
 - document the protocol in lib/krb5/kx509.c

Future work:

 - add option for longer-ticket-lifetime service certs
 - add support for ECDSA, and some day for ed25519 and ed448
 - reuse private key when running kinit
   (this will require rethinking how we trigger optimistic kx509
    usage)
 - HDB lookup for:
    - optional revocation check (not strictly necessary)
    - adding to certificates those SANs listed in HDB
       - hostname aliases (dNSName SANs)
       - rfc822Name (email)
       - XMPP SANs
       - id-pkinit-san (a user could have aliases too)
 - support username wild-card A RRs, ala OSKT/krb5_admin
    i.e., if a host/f.q.d.n principal asks for a certificate for
    some service at some-label.f.q.d.n, then issue it
   (this is not needed at OSKT sites because OSKT already
    supports keying such service principals, which means kx509
    will issue certificates for them, however, it would be nice
    to be able to have this independent of OSKT)
   (a better way to do this would be to integrate more of OSKT
    into Heimdal proper)
 - a kx509 command, or heimtools kx509 subcommand for explicitly
   attempting use of the kx509 protocol (as opposed to implicit, as is
   done in kinit via krb5_cc_store_cred() magic right now)

Issues:

 - optimistically trying kx509 on start realm TGT store -> timeout issues!
    - newer KDCs will return errors because of this commit; older ones
      will not, which causes timouts
    - need a separate timeout setting for kx509 for optimistic case
    - need a [realm] config item and DNS SRV RR lookup for whether a
      realm is expected to support kx509 service
2019-10-08 21:26:50 -05:00
Isaac Boukris
efb111e450 Separate enterprise and canonicalize flags
The meaning of the two is different and we should
not implicitly set both if one was requested (this
aligns the logic with MIT kinit -C/-E options).

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
2018-12-26 16:55:13 -06:00
Quanah Gibson-Mount
7c16ce3457 Minor typo/grammar fixes 2017-03-10 15:47:43 -05:00
Nicolas Williams
2027aa11ed Use --detach in tests to avoid waiting 2016-12-07 19:52:29 -06:00
Love Hornquist Astrand
4ebfd6b818 make sure logs are truncated 2012-10-07 11:11:17 -07:00
Love Hornquist Astrand
86da42df1d abstract out --no-afslog and --no-unlog 2010-06-01 14:42:16 -07:00
Love Hornquist Astrand
918b64e6d8 test pk-enterprise 2009-09-29 14:27:13 -07:00
Love Hornquist Astrand
72908828b1 remove $Id$ 2009-09-21 10:36:37 -07:00
Love Hornquist Astrand
9002b81a5d migrate to ${env_setup} 2009-09-07 15:40:44 -07:00
Love Hornquist Astrand
84d880b0a5 migrate to ${env_setup} 2009-09-07 15:13:54 -07:00
Love Hörnquist Åstrand
d93ac20298 kill -9 to make store its dead
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24993 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-03-29 09:03:47 +00:00
Love Hörnquist Åstrand
df0cc7d1b4 use leaks-kill.sh
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24165 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-12-11 05:10:51 +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
ba3dde32d7 x
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22474 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-17 11:16:25 +00:00
Love Hörnquist Åstrand
fab67065a9 x
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22473 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-17 11:15:48 +00:00
Love Hörnquist Åstrand
2ac4b7aa00 Test the PKCS11 provider built-in to libhx509.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22436 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-14 20:54:50 +00:00
Love Hörnquist Åstrand
1659ec6697 empty messages.log
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21853 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-08-08 06:58:36 +00:00
Love Hörnquist Åstrand
ca216f69b5 Fix hxtool issue-certificate --req.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21348 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-26 15:12:59 +00:00
Love Hörnquist Åstrand
6eb6bb6ad0 Try pkinit in w2k mode, also add tests for MS SAN.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20749 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-05-31 17:34:17 +00:00
Love Hörnquist Åstrand
645f5f1ca4 try principal subject in DB
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20650 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-05-10 19:05:26 +00:00
Love Hörnquist Åstrand
ea808c9c0e use diffrent port, 49188, and hope that it isnt used, help on solaris where the help services runs on port 8888
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20202 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-02-08 00:59:47 +00:00
Love Hörnquist Åstrand
6d5ecc74b9 drop remove that is no longer used
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19988 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-17 23:29:00 +00:00
Love Hörnquist Åstrand
987aecf5b5 tell me about certifiate that we have generated
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19915 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-15 02:24:06 +00:00
Love Hörnquist Åstrand
8a02fd12ed no random, no RSA/DH tests
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19858 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-11 20:48:34 +00:00
Love Hörnquist Åstrand
434a734ae8 Prefix key with FILE:
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19779 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-09 10:52:54 +00:00
Love Hörnquist Åstrand
2cd6e32202 Generate a ca, kdc cert and client cert and try to use them
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19662 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-04 01:58:51 +00:00