Commit Graph

29174 Commits

Author SHA1 Message Date
Nicolas Williams
d2542d8261 bx509: Make test work with older curl versions
The --connect-to option is much nicer and better than --resolve for testing,
but for testing against localhost --resolve is good enough and available in
older versions of curl.
2019-12-26 16:37:28 -06:00
Nicolas Williams
1482309565 iprop: Use test port for testing 2019-12-20 16:52:00 -06:00
Nicolas Williams
bc9054d4b5 hx509: Better handle OpenSSL diffs in test_req 2019-12-20 16:14:00 -06:00
Nicolas Williams
a79714da93 kdc: Fix build race 2019-12-20 16:05:03 -06:00
Nicolas Williams
4d96132cef bx509: Tolerate older microhttpd versions 2019-12-20 15:59:21 -06:00
Nicolas Williams
9a41785682 bx509: Fix cjwt_token_validator build 2019-12-20 15:58:44 -06:00
Nicolas Williams
ee0a288f92 bx509: Work around microhttpd bug 2019-12-20 15:54:27 -06:00
Nicolas Williams
73a9c95b7b hx509: Avoid double-free on CSR parse error 2019-12-20 15:50:22 -06:00
Nicolas Williams
5c7a8f63c7 Fix Windows build 2019-12-11 20:11:02 -06:00
Nicolas Williams
1d5062b167 kdc: Modernize kx509 logging too 2019-12-11 19:34:36 -06:00
Nicolas Williams
608c2876d4 kdc: Fix audit_addkv() typos and reason handling
Now we'll put the "reason=..." last in the log lines and we won't escape
spaces -- just newlines and other control characters.  This makes
reading log lines much easier without complicating parsing of log lines
because interior key=value pairs do get whitespace escaped or removed.
2019-12-10 22:14:38 -06:00
Nicolas Williams
9063d92dbb krb5: Fix fcc_open() leak on double-init, and msg 2019-12-10 21:26:47 -06:00
Nicolas Williams
18df68d6e9 bx509: Add proper logging 2019-12-10 21:26:47 -06:00
Nicolas Williams
58848fce7b kdc: Add missing exports 2019-12-10 17:23:46 -06:00
Nicolas Williams
5c25450e50 Revert docs changes for bx509 for now 2019-12-10 14:10:53 -06:00
Isaac Boukris
77b480d2a0 CVE-2019-14870: Validate client attributes in protocol-transition
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
2019-12-10 05:24:02 -05:00
Isaac Boukris
013210d1eb CVE-2019-14870: Apply forwardable policy in protocol-transition
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
2019-12-10 05:24:02 -05:00
Isaac Boukris
51415eaaae CVE-2019-14870: Always lookup impersonate client in DB
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
2019-12-10 05:24:02 -05:00
Nicolas Williams
733140553a kdc: Fix leaks 2019-12-09 21:39:30 -06:00
Nicolas Williams
d1a2652090 bx509: CSRF protection for /bnegotiate 2019-12-09 20:13:33 -06:00
Nicolas Williams
0a0a27ccec kdc: bx509: Do not vend issuer private keys 2019-12-09 18:10:10 -06:00
Nicolas Williams
e515745996 hx509: private key exclusion options
Add two ways to exclude private keys when dealing with an hx509
certificate store.  One as a load option (load no private keys, never
add private keys), one as a store option (store no private keys).

This is useful for CA code so it can have a single store with the
issuer's credentials _and_ the chain for it, and copy those to a store
with the issued certificate and _not_ accidentally include the issuer's
private key.

It would be much safer still to flip the default for this flag, but that
could break out-of-tree libhx509 dependents.
2019-12-09 18:10:10 -06:00
Nicolas Williams
3c0d1258ce hx509: Fix unauthorized feature accounting 2019-12-09 18:10:10 -06:00
Nicolas Williams
d021710efc gss: Fix leak in gss_add_cred_from() 2019-12-06 23:07:16 -06:00
Nicolas Williams
7102f2be9e krb5: Fix leak in PKINIT client 2019-12-06 23:07:16 -06:00
Nicolas Williams
90a59a064b krb5: Fix fcc_open() FD leak 2019-12-06 23:07:13 -06:00
Nicolas Williams
d4a319d57d gss: fix gss-token accept bug 2019-12-06 18:32:15 -06:00
Nicolas Williams
dd762e53d1 kadmin: Improve ext_keytab usage 2019-12-06 18:32:15 -06:00
Luke Howard
a17a6bcc54 hcrypto: support BCRYPT_HASH_REUSABLE_FLAG
support BCRYPT_HASH_REUSABLE_FLAG in the WinCNG backend on versions of Windows
that support it, to avoid destroying and recreating a hash object
2019-12-05 20:20:28 -05:00
Luke Howard
3daef8a5fd roken: Windows version support helpers
Add helper functions for determining the version of Windows upon which we are
running.
2019-12-05 20:20:28 -05:00
Nicolas Williams
61452235ad bx509: do not test bx509d if not built 2019-12-05 17:37:19 -06:00
Nicolas Williams
b5c158d9f7 Fix tests/can and tests/kdc
krb5_kdc_process_request() must return 0 when it produces a reply, and only
return non-zero when it could not construct any kind of reply (e.g., ENOMEM, or
-1 if no handler claimed responsibility for the request).
2019-12-05 17:22:47 -06:00
Nicolas Williams
52b8fae5e0 Fix Travis build moar 2019-12-05 15:34:09 -06:00
Nicolas Williams
6acb2e3f36 kdc: Fix JWK key rotation danger 2019-12-05 11:26:56 -06:00
Nicolas Williams
bdff7835a2 kdc: Fix warnings: fix _kdc_audit_addkv() usage 2019-12-05 11:26:44 -06:00
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