Commit Graph

29060 Commits

Author SHA1 Message Date
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
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