Commit Graph

29515 Commits

Author SHA1 Message Date
Nicolas Williams
b0e5c471f6 kinit: Do not switch cache when --default-for given
Unless --change-default is also given.
2021-03-31 22:59:38 -05:00
Nicolas Williams
5443189b96 krb: Fix ccache resolve bug affecting ssh/kinit 2021-03-31 22:59:38 -05:00
Nicolas Williams
614b3a5914 asn1: Fix OS X build
We can't use VIS_DQ on when the OS has a vis implementation but lacks
VIS_DQ.
2021-03-27 23:29:34 -05:00
Nicolas Williams
eb2bd63207 roken: Fix OS X build? 2021-03-27 11:35:21 -05:00
Nicolas Williams
5dfe9b706e travis: Do not brew update [harder] 2021-03-27 01:08:56 -05:00
Nicolas Williams
c414fbbfd2 travis: Do not brew update
Running brew update times out the OS X build.
2021-03-27 00:55:55 -05:00
Nicolas Williams
0205237a6e kdc: Add missing dep for tests/kdc/check-pkinit.in 2021-03-26 23:37:52 -05:00
Benjamin Kaduk
7f3445f1b7 Replace dead link in kerberos.8
While Ken Hornstein's FAQ was useful in its day, much of its content
is no longer relevant (e.g., Kerberos 4) or even actively harmful
(e.g., the latest version of MIT krb5 is not 1.2.1).  It was also
somewhat MIT-krb5-focused, especially relating to configuration file
snippets, which is not necessarily a great fit for the Heimdal
documentation.

Replace it with a tutorial hosted on kerberos.org and the classic
"dialogue" from Bill Bryant.

Fixes: #766
2021-03-26 18:47:49 -05:00
Nicolas Williams
7985f402cb asn1: Attempt to fix makefile concurrency bug 2021-03-26 17:27:47 -05:00
Nicolas Williams
c74c57a143 asn1: Fix lib/asn1/Makefile.am buglet 2021-03-26 17:27:47 -05:00
Nicolas Williams
28cdea6de4 kdc: Reduce log level of some messages 2021-03-26 16:40:52 -05:00
Nicolas Williams
6abb8bc286 Document OID arcs delegated to Heimdal by SU 2021-03-25 10:38:28 -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
15b2094079 hx509: 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:

 - a `--pkinit-max-life` to the `hxtool ca` command
 - `hx509_ca_tbs_set_pkinit_max_life()`
 - `hx509_cert_get_pkinit_max_life()`
 - `HX509_CA_TEMPLATE_PKINIT_MAX_LIFE`

There are two extensions.  One is an EKU, which if present means that
the maximum ticket lifetime should be derived from the notAfter minus
notBefore.  The other is a certificate extension whose value is a
maximum ticket lifetime in seconds.  The latter is preferred.
2021-03-24 19:12:00 -05:00
Nicolas Williams
f0e628c2cf asn1: Add Heimdal cert ext for ticket max_life 2021-03-24 19:12:00 -05:00
Nicolas Williams
09274ca3dc hx509: Finish any-EKU support 2021-03-24 17:48:17 -05:00
Nicolas Williams
cb2064d387 krb5: Make q param of DH moduli optional
MSFT makes the `q` field of `DomainParameters` OPTIONAL even though it's
actually required.  We currently validate DH groups not by validating
that p is a Sophie Germain prime but by checking the proposed group
against a compiled-in list and against a krb5.moduli file, therefore we
don't need q.  Besides, for Oakley groups, because p is a Sophie Germain
prime, we'd have q=p/j and j=2, so we can always compute q as needed
(and MIT Kerberos does).
2021-03-24 17:48:17 -05:00
Nicolas Williams
5d939ba1b6 hx509: Make hxtool default store type to FILE
A common complaint about hxtool(1) is that if one fails to add a TYPE:
prefix to a CSR or certificate/private key store names, then hxtool
fails somewhat inscrutably.  We can't just fix hx509_certs_init() or
hx509_certs_append() because they default to "MEMORY" so who knows what
might break.  Instead we fix all uses of user-provided store names in
hxtool to have a FILE: prefix if no type was given.  For CSRs we'll
default to adding the only type prefix supported, "PKCS10".
2021-03-24 11:03:14 -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
dfdc6c3a06 kdc: Document PKINIT config options 2021-03-23 16:24:25 -05:00
Nicolas Williams
94f9d67b3d asn1: Update AFL screenshot 2021-03-18 18:07:23 -05:00
Nicolas Williams
36c6342230 asn1: Fix Linux build 2021-03-18 18:03:34 -05:00
Lars Wendler
22352b90e7 autoconf-2.70 fix
autoconf-2.70 and newer are more strict with quoting etc. and thus generate
a broken configure file:

  configure: 20855: Syntax error: ")" unexpected (expecting "fi")

Gentoo-bug: https://bugs.gentoo.org/776241
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
2021-03-17 13:05:46 -04:00
Nicolas Williams
57de79ce6d asn1: Make asn1_print good for benchmarking 2021-03-11 11:58:41 -06:00
Nicolas Williams
c4ff603adf asn1: Fix asn1_print build w/ templating 2021-03-11 11:58:18 -06:00
Nicolas Williams
36c6ff407e asn1: Fix Windows build harder 2021-03-11 09:57:18 -06:00
Nicolas Williams
a858821194 asn1: Fix Windows build 2021-03-11 09:50:48 -06:00
Nicolas Williams
4d39e8c1b2 asn1: Also fuzz using X.690 sample 2021-03-11 09:36:53 -06:00
Nicolas Williams
d0298e5804 asn1: Fix recent der_replace_tag() bug
Recently introduced.
2021-03-11 09:13:09 -06:00
Nicolas Williams
5bb5887f8c asn1: Fix recent der_match_tag2() bug
Recently introduced.
2021-03-11 09:12:43 -06:00
Nicolas Williams
1b5fe4a35c asn1: Test x690 sample with both backends
And remove it from the library itself.
2021-03-10 22:52:07 -06:00
Nicolas Williams
6595f080e1 hx509: Fix hxtool building w/o ASN.1 templating 2021-03-10 21:21:26 -06:00
Nicolas Williams
230580d21c hx509: Fix rfc2459.asn1 compilation w/o templates 2021-03-10 21:21:26 -06:00
Nicolas Williams
be2525ef29 asn1: Fix rfc2459.asn1 compilation w/o templates 2021-03-10 21:21:26 -06:00
Nicolas Williams
05a952dbb9 asn1: Fix IMPLICIT tagging (codegen) 2021-03-10 19:15:17 -06:00
Nicolas Williams
7f4e9db9f9 asn1: Make int sizing consistent and better 2021-03-10 19:15:17 -06:00
Nicolas Williams
440bfeda58 asn1: Allow asn1_print to build w/o templating 2021-03-10 16:00:04 -06:00
Nicolas Williams
c69a9764bc asn1: Update README.md 2021-03-10 12:24:01 -06:00
Nicolas Williams
659e444e3d asn1: Fix crash found by AFL 2021-03-10 12:23:51 -06:00
Nicolas Williams
a51eaab7b9 asn1: Update README.md 2021-03-09 14:51:19 -06:00
Nicolas Williams
cba34400fe asn1: Fix printing of open type choice names 2021-03-09 12:22:43 -06:00
Nicolas Williams
6b5feba91d asn1: Fix printing of bit string named members
Properly print commas between members.
2021-03-09 12:20:23 -06:00
Nicolas Williams
8bc4bae52d asn1: Free template memory leak
New AFL session in progress.
2021-03-09 11:21:54 -06:00
Nicolas Williams
2a826fb331 asn1: Results from latest AFL session 2021-03-09 11:21:47 -06:00
Nicolas Williams
a62dd9887f hx509: Fix bug found by clang (wrong enum)
We need to revisit a lot of code in lib/hx509/, lib/krb5/, and kdc/ now
that the ASN.1 compiler properly handles IMPLICIT tagging.  And we
should take advantage of automatic open type handling.
2021-03-08 17:53:50 -06:00
Nicolas Williams
77126b4058 asn1: Update README-X681.md 2021-03-08 16:16:00 -06:00
Nicolas Williams
fbb1a4e3ec bx509d: Allow requesting longer cert lifetimes
Add a `lifetime=NUMunit` query parameter.

Also add a krb5.conf parameter to indicate whether this is allowed.
We already have a max lifetime configuration parameter.
2021-03-07 22:20:06 -06:00
Nicolas Williams
00e0475ce2 asn1: Use name not gen_name for JSON enum printing 2021-03-07 16:32:41 -06:00
Nicolas Williams
5d7d1897de asn1: Pretty-print enum values 2021-03-07 13:36:37 -06:00
Nicolas Williams
be61d72be3 asn1: Some TPM fields have to be EXPLICIT
The TCG EK cert profile says that the context tags in the
TPMSecurityAssertions type are IMPLICIT.  The sample EK cert we have
has them as EXPLICIT.

What to do?
2021-03-07 00:31:47 -06:00