Commit Graph

29239 Commits

Author SHA1 Message Date
Luke Howard
920cfc5584 gss: use _gss_ntlm_set_keys() in gss_init_sec_context()
DRY: use the _gss_ntlm_set_keys() helper function to initialize the key state
for both initiator and acceptor.
2020-02-04 17:28:35 +11:00
Luke Howard
c510e6d474 gss: don't provide domain to nsi_probe() in NTLM
_gss_ntlm_accept_sec_context() does not provide the acceptor domain to
nsi_probe(); for consistency, _gss_ntlm_acquire_cred_from() should do that
same. Providing the acceptor domain was breaking tests.

Note that the Heimdal NTLM implementation is old and has few consumers (Apple
and Samba use their own implementations). Arguably we should merge the Apple
implementation or remove it.
2020-02-04 17:28:35 +11:00
Luke Howard
bf14eb29df gss: NTLM nsi_probe returns a krb5, not gss error
The nsi_probe() error code was treated as a GSS error code, rather than a krb5
error. Return a GSS error code, setting the krb5 error in minor_status.
2020-02-04 17:28:35 +11:00
Luke Howard
fd572363a5 gss: register GSS_KRB5_S error table
The Kerberos GSS mechanism specific error table in gkrb5_err.et was never
registered with libkrb5, so the messages corresponding to those errors would
never be available. Register them with the thread local context used by the
krb5 mechanism.
2020-02-04 17:28:35 +11:00
Rod Widdowson
7b8fa4758c Windows: Fix type cast warning.
Since at least SDK V6.1 HCRYPTPROV has been specified as ULONG_PTR
this means that comparing or setting one with NULL causes a cast
warning.

Use an explicit cast from zero to that type.
2020-02-01 12:32:09 +11:00
Jeffrey Altman
cc7610b77c Update README.md 2020-01-10 15:00:16 -05:00
Nicolas Williams
1cbbca8dcf bx509: Add /, /health for load balancer checking
A HEAD or GET of / or /health will now produce a 200 instead of a 404.

Ideally we should add configuration arguments that would allow /health
to get a token, make a CSR, and test the /bx509 (and/or /bnegotiate)
functionality, that way we'd have a real health check.  For now we defer
that work, as external health monitoring can be done using a simple
script anyways.
2020-01-10 11:43:00 -06:00
Nicolas Williams
e7ad9da3cc bx509: Do not clobber library error info 2020-01-10 11:34:33 -06:00
Nicolas Williams
62c0261cff kdc: add test_token_validator -a option 2020-01-10 11:32:59 -06:00
Nicolas Williams
8430acfe95 kdc: implement test_kdc_ca -a option 2020-01-10 11:30:56 -06:00
Nicolas Williams
8ef971786b bx509: Fix CSR authorizer IPC plugin bug
When marking SANs authorized, mark the SAN, not some EKU, authorized!
2020-01-10 11:29:21 -06:00
Nicolas Williams
2b92d938ae Add bx509d.8 man page 2020-01-03 00:12:43 -06:00
Nicolas Williams
027941b858 Document Heimdal's PKIX, kx509, bx509
This reverts commit 5c25450e50.
2020-01-02 23:50:59 -06:00
Luke Howard
8fd3cc84eb kdc: link test_token_validator against libgssapi
The Negotiate token validation plugin links against libgssapi, but on macOS the
dynamic linker cannot find it before Heimdal is installed. This causes tests to
fail. Although test_token_validator itself does not require libgsaspi, link
against it so that the test can proceed.
2020-01-01 19:15:59 +11:00
Nicolas Williams
1a3716a132 krb5: Do not write start_realm ccconfig twice 2019-12-30 20:45:40 -06:00
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