Commit Graph

29239 Commits

Author SHA1 Message Date
Nicolas Williams
2d1454c686 Fix Travis build 2019-12-04 23:12:04 -06:00
Roland C. Dowdeswell
001e312ba5 Make krb5_cc_close(ctx, NULL) stop SEGV'ing. 2019-12-05 00:05:56 -05:00
Roland C. Dowdeswell
05e8517542 kdc/fast.c: fix leak in unusual error path. 2019-12-05 00:05:56 -05:00
Roland C. Dowdeswell
430e18c074 kdc/process.c: add tracing messages. 2019-12-05 00:05:56 -05:00
Roland C. Dowdeswell
c76e30e90c Document that log level 7 is for tracing. 2019-12-05 00:05:56 -05:00
Roland C. Dowdeswell
6db323157f Reduce older log messages to level 4 and collect some errors.
We take all of the kdc_log() and _kdc_r_log() calls in AS and TGS
and move their log levels down to debugging on the assumption that
our new log line subsumes the "informational" requirements.  We
collect some additional information in the kv-pair "pe-text" which
is like e-text except it is not returned to the client.
2019-12-05 00:05:56 -05:00
Roland C. Dowdeswell
7d353d0557 Generate a single summary audit line for AS/TGS.
We refactor the code a bit to extend kdc_request_t which until now
was only used for the AS.  We make the structure extensible and
start using it for the TGS as well.  We leave digest and kx509
alone for the time being.

We also define the concept of kv-pairs in our audit trail which
allows us to define a rigorous but extensible format:

type error from-addr client server key1=val1 key2=val2 ...
2019-12-05 00:05:56 -05:00
Roland C. Dowdeswell
fb9a78223c We stop strnvisx(3)ing logs to FILE: by default.
Our logging framework used to strnvisx(3) each and every line
iff it is written to a FILE.  This is often unhelpful because
the line usually contains a number of elements that have already
been quoted and it makes the logs much more difficult to read in
this case.  An example if krb5_unparse_name() which will already
quote most characters that one cares about.

We change the behaviour to simply drop unprintable characters
rather than encoding them.  We thus rely on the rest of the
code to properly encode data elements written into the logs.
2019-12-05 00:05:56 -05:00
Nicolas Williams
575c67806b Add bx509d 2019-12-04 21:34:44 -06:00
Nicolas Williams
4d4c7078cd kx509: Add desired_life to Kx509CSRPlus 2019-12-04 21:34:37 -06:00
Nicolas Williams
a7a1d798c3 hx509: keep track of authorized CSR features
This commit adds a few functions for marking KU, EKUs, and SANs as
authorized, and for getting a count of unsupported certificate
extensions requested, and a count of authorized KU/EKUs/SANs.

The intent is to make it easier to build CSR authorization and CA code
that is robust in the face of future support for certificate extensions
and SAN types not currently supported.  An application could parse a
CSR, iterate all KU/EKUs/SANs, check a subject's authorization to them,
mark them authorized where authorized, then check if there are any
remaining unauthorized extensions or unsupported extensions requested.

Ultimately, if a CSR's KU/EKUs/SANs are all authorized, then they can
all be copied to a TBS, and a certificate can be issued.
2019-12-04 21:34:37 -06:00
Nicolas Williams
d519094117 hxtool: fix leak 2019-12-04 13:40:28 -06:00
Nicolas Williams
4f8577a988 hxtool: add cert type: https-negotiate-server 2019-12-04 13:40:28 -06:00
Nicolas Williams
f9a0e8f076 roken: add rkbase64 noinst program
This will be useful in tests.
2019-12-04 13:40:28 -06:00
Nicolas Williams
982ba80b6e roken: fix leak in roken_detach_prep() 2019-12-04 13:40:28 -06:00
Roland C. Dowdeswell
8c5d2f7cc4 kuser/kx509.c: Fix add1_2chain. 2019-11-26 13:38:17 -06:00
Roland C. Dowdeswell
62d13ebf28 lib/krb5/kx509.c: fix memory leak in an error case. 2019-11-26 13:38:17 -06:00
Roland C. Dowdeswell
9265c1ce54 Fix windows build
In 0cc708ba36, we removed the definition of id-ms-client-authentication
without a corresponding removal from lib/asn1/libasn1-exports.def.

Maybe we should generate lib*-exports.def?
2019-11-21 09:56:29 -05:00
Roland C. Dowdeswell
8ee86db261 Add enforce_ok_as_delegate setting
If this flag is set to true, then GSSAPI credential delegation will
be disabled when the "ok-as-delegate" flag is not set in the service
ticket.
2019-11-20 18:18:57 -05:00
Roland C. Dowdeswell
b5449e6c97 disable test_cc on Windows 2019-11-20 18:14:44 -05:00
Roland C. Dowdeswell
8b20d436d9 disable test-detach on Windows 2019-11-20 18:14:44 -05:00
Roland C. Dowdeswell
3b828e23e7 Don't build the docs on appveyor 2019-11-20 18:14:44 -05:00
Roland C. Dowdeswell
69dd82d33e Stop stuttering in libkrb5-exports.def.in 2019-11-20 18:14:44 -05:00
Roland C. Dowdeswell
cd297eb462 Declare variables at the beginning of a block.
Looks like this fixes the Appveyor build.
2019-11-20 18:14:44 -05:00
Roland C. Dowdeswell
01126367d3 w32-check-exported-symbols: Eliminate perl warning
This will become fatal in the next version of Perl, so we need
to eliminate it now.
2019-11-20 18:14:44 -05:00
Roland C. Dowdeswell
06f3507c77 Update .gitignore to catch more test remains 2019-11-20 18:14:44 -05:00
Nicolas Williams
4500a14f95 hx509: Show query expression parse errors 2019-11-19 23:00:41 -06:00
Nicolas Williams
a40d4056bd asn1: Add der_find_or_parse_heim_oid() 2019-11-19 23:00:41 -06:00
Nicolas Williams
944eae82cf asn1: Remove alias of id-kp-clientAuth 2019-11-19 23:00:41 -06:00
Nicolas Williams
c1841f2f67 gssapi: Import elric1's gss-token 2019-11-19 23:00:41 -06:00
Nicolas Williams
56c5f5909e roken: Add rkvis program for test scripts
This will help programs that need to URL-escape strings.

Also, this changes `do_hvis()` to not fallback on `do_svis()` for chars in
`extra` -- that `do_hvis()` was doing that seems like an oversight.  Christos
Zoulas, of NetBSD, agrees.  `do_hvis()` still falls back on `do_svis()` for
characters not in the RFC 1808 / 3986 to-be-escaped set *and* characters not in
the `extra` set -- that much seems to have been the intent.
2019-11-19 22:33:20 -06:00
Nicolas Williams
4981cfc420 roken: base64: set errno on decode errors 2019-11-18 17:28:32 -06:00
Roland C. Dowdeswell
a8b749685c include <sys/exec_elf.h> if it's available.
This fixes the auxval logic on NetBSD.
2019-11-18 14:20:19 -06:00
Nicolas Williams
ba5bb07495 krb5: disable automatic kx509 by default 2019-11-13 18:42:28 -06:00
Roland C. Dowdeswell
84ffa22c93 Add an "EFILE:" target for logging.
This target will write to a file IFF it exists.
2019-11-10 17:47:36 -05:00
Roland C. Dowdeswell
e44c680d8e Make logging path definitions subject to token expansion. 2019-11-10 17:47:36 -05:00
Roland C. Dowdeswell
0c869176f4 Define a token expansion for %{strftime:<string>}. 2019-11-10 17:47:36 -05:00
Roland C. Dowdeswell
3c7da79838 derived keys: ensure that princ is correct
We copy the princ in the hdb_entry so that if it is later used, it
will reflect what we want.
2019-11-07 20:11:55 -05:00
Nicolas Williams
a2650ef20b kx509: Fix uninitalized ret var use 2019-11-06 19:51:21 -06:00
Nicolas Williams
fce3f16859 hx509: Add hx509_ca_tbs_get_name()
This is so we can check if a TBS gets an empty subject name, then refuse
to issue the certificate if it doesn't also have at least one SAN.
2019-11-06 19:51:21 -06:00
Viktor Dukhovni
12826c9586 Handle partial writes on non-blocking sockets
Now that we're using krb5_net_write() with non-blocking sockets in
ipropd_master, we MUST correctly account for partial writes.

Therefore, roken net_write() called from krb5_net_write() now
returns the number of bytes written when the socket error was
EWOULDBLOCK (or EAGAIN).

Also, fix potential issue on Windows, where errno was used instead
of rk_SOCKET_ERRNO whether or not we used _write() or send().
2019-11-06 20:27:58 -05:00
Nicolas Williams
9ca5d710f9 hx509: fix hx509_request_get_eku() 2019-11-04 14:11:40 -06:00
Jeffrey Altman
efb27f15ac Windows: update default timestamping service
The Verisign and Symantec timestamping services have been shutdown.
Switch to the Digicert service which replaced the Symantec services
as of 31 Oct 2019.

  http://timestamp.digicert.com

Change-Id: I365e6c3698b8fc99b18e8d1e5a54ce3519f3c5eb
2019-11-02 21:14:00 -04:00
Nicolas Williams
0cc708ba36 kx509: add time-to-live for kx509 -t option
It's useful to check for having so many seconds left in useful
credential lifetime.
2019-11-02 18:49:42 -05:00
Nicolas Williams
94bf464f8d krb5: Add krb5_ticket_get_times() 2019-11-02 18:49:42 -05:00
Nicolas Williams
66cde3e580 hx509: Fix hx509_request_get_exts() 2019-11-02 18:49:42 -05:00
Nicolas Williams
35c91324ed hx509: Add hx509_get_instance() 2019-11-02 18:49:42 -05:00
Nicolas Williams
427751a204 hxtool: Add "acert" (assert cert contents) command
This will prove useful in testing kx509.
2019-11-02 18:49:42 -05:00
Nicolas Williams
6612090ba0 hx509: Export missing symbols 2019-11-02 18:49:42 -05:00
Nicolas Williams
ddbc36d86b hx509: Store priv keys first in PEM stores
Most consumers of PEM files don't care about the order in which private
keys and certificates are stored.  However, Postfix does care when
multiple EE certs (and chains) are stored in a file, in which case it
requires that private keys come before their certificates.
2019-11-02 18:49:42 -05:00