]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
4 years agoFix input length checking in SPNEGO DER decoding 1098/head
Greg Hudson [Tue, 28 Jul 2020 16:58:26 +0000 (12:58 -0400)] 
Fix input length checking in SPNEGO DER decoding

In get_mech_set(), check the length before reading the first byte, and
decrease the length by the tag byte when reading and verifying the
sequence length.

In get_req_flags(), check the length before reading the first byte,
and check the context tag length after decoding it.

ticket: 8933 (new)
tags: pullup
target_version: 1.18-next
target_version: 1.17-next

4 years agoDo proper length decoding in SPNEGO gss_get_oid()
Greg Hudson [Tue, 28 Jul 2020 16:51:06 +0000 (12:51 -0400)] 
Do proper length decoding in SPNEGO gss_get_oid()

When reading an OID in a SPNEGO token, use gssint_get_der_length()
rather than assuming the length fits in one byte.  Although OID
lengths greater than 127 are unlikely, some NetApp products have been
observed to incorrectly encode the length in multiple bytes.  Reported
by Richard Sharpe.

ticket: 8932 (new)

4 years agoFix KRB5_GC_CACHED for S4U2Self requests 1107/head
Greg Hudson [Wed, 26 Aug 2020 15:15:11 +0000 (11:15 -0400)] 
Fix KRB5_GC_CACHED for S4U2Self requests

In krb5_get_credentials_for_user(), always exit after the first cache
check if KRB5_GC_CACHED is specified.  Not making network requests
with this flag is more important than finding a post-realm-discovery
cached entry.

If KRB5_GC_CACHED is specified without a principal name, fail
immediately, as we cannot check the cache by certificate.

ticket: 8942 (new)

4 years agoRename master_kdc and iprop_master_ulogsize 1090/head
Greg Hudson [Sun, 12 Jul 2020 01:47:08 +0000 (21:47 -0400)] 
Rename master_kdc and iprop_master_ulogsize

Use "primary_kdc" and "iprop_ulogsize" as the preferred names of the
two relations.  Fall back to the old keys if the new ones are not set.

ticket: 8921

4 years agoUse the term "primary KDC" in source and docs
Greg Hudson [Thu, 25 Jun 2020 00:48:14 +0000 (20:48 -0400)] 
Use the term "primary KDC" in source and docs

Where it does not affect program behavior, use the term "primary KDC".
This commit does not change any profile variables, DNS labels,
pathnames, or externally visible identifiers, nor does it change the
term "master key".

ticket: 8921 (new)

4 years agoSuppress Leash error popup on MSLSA renew failure 1104/head
Greg Hudson [Wed, 19 Aug 2020 15:49:29 +0000 (11:49 -0400)] 
Suppress Leash error popup on MSLSA renew failure

Attempting to renew the MSLSA cache can commonly fail with
KRB5_CC_NOTFOUND due to LSA policy.  Do not display an error popup in
this case.  Also fix a logic error in the existing suppressions.

ticket: 8939 (new)
tags: pullup
target_version: 1.18-next
target_version: 1.17-next

4 years agoHarmonize macOS pack declarations with Heimdal 1109/head
Greg Hudson [Tue, 1 Sep 2020 04:33:42 +0000 (00:33 -0400)] 
Harmonize macOS pack declarations with Heimdal

Replace the TARGET_OS_MAC conditionals with the conditionals used in
Heimdal, so that we do not pack structures inconsistently with macOS
on ARM.  Suggested by Luke Howard.

ticket: 8944 (new)

4 years agomake regen
Greg Hudson [Wed, 2 Sep 2020 20:50:32 +0000 (16:50 -0400)] 
make regen

4 years agoUnify kvno option documentation 1105/head
Robbie Harwood [Thu, 20 Aug 2020 21:49:29 +0000 (17:49 -0400)] 
Unify kvno option documentation

Add missing kvno options to the kvno.rst synopsis and option
descriptions, and to the kvno usage message.  Remove mention of '-h'
(help text), from kvno.rst as it is an implicit option.  Note that the
three new caching options were added in release 1.19.

Indicate the two exclusions (-u/-S and --u2u with the S4U2Self options)
and dependency (-P on S4U2Self) where they are missing.

Switch xusage() to print only a single localized string, rather than
running each line of output through localization separately.

Leave kvno -C undocumented for now, as the semantics of
KRB5_GC_CANONICALIZE are minimally useful and likely to change.

[ghudson@mit.edu: edited documentation and commit message]

ticket: 7476
tags: pullup
target_version: 1.18-next

4 years agoSet lockdown attribute when creating LDAP KDB 1101/head
Greg Hudson [Mon, 10 Aug 2020 16:44:21 +0000 (12:44 -0400)] 
Set lockdown attribute when creating LDAP KDB

In kdb5_ldap_util, set lockdown_keys on the special principals when
creating an LDAP KDB, as we do in kdb5_util when creating a regular
KDB.

ticket: 8936 (new)
tags: pullup
target_version: 1.18-next
target_version: 1.17-next

4 years agoRefactor cache checking in TGS client code 1095/head
Greg Hudson [Thu, 23 Jul 2020 05:52:43 +0000 (01:52 -0400)] 
Refactor cache checking in TGS client code

4 years agoCache S4U2Proxy requests by second ticket
Isaac Boukris [Mon, 20 Jul 2020 22:40:06 +0000 (00:40 +0200)] 
Cache S4U2Proxy requests by second ticket

krb5_get_credentials() does not know the client principal for an
S4U2Proxy request until the end, because it is in the encrypted part
of the evidence ticket.  However, we can check the cache by second
ticket, since all S4U2Proxy requests in a cache will generally be made
with the same evidence ticket.

In the ccache types, allow mcreds->client and mcreds->server to be
NULL (as Heimdal does) to ignore them for the purpose of matching.  In
krb5int_construct_matching_creds(), set mcreds->client to NULL for
S4U2Proxy requests.  Add a cache check to
k5_get_proxy_cred_from_kdc(), and remove the cache check from
krb5_get_credentials_for_proxy() and the krb5 mech's
get_credentials().

In get_proxy_cred_from_kdc(), fix a bug where cross-realm S4U2Proxy
would cache the evidence ticket used in the final request, rather than
the original evidence ticket.

[ghudson@mit.edu: debugged cache check and cross-realm caching;
switched from new flag to null matching cred principals; wrote commit
message]

ticket: 8931 (new)

4 years agoExpand dns_canonicalize_host=fallback support
Greg Hudson [Sat, 18 Jul 2020 02:57:45 +0000 (22:57 -0400)] 
Expand dns_canonicalize_host=fallback support

In krb5_sname_to_principal(), when using fallback, defer realm lookup
and any kind of hostname canonicalization until use.  Add a
lightweight iterator k5_canonprinc() to yield the one or two possible
candidates for a principal.  In the iterator, don't yield the same
hostname part twice.

Add fallback processing to the stepwise TGS state machine, and remove
it from krb5_get_credentials().  Add fallback processing to
k5_get_proxy_cred_from_kdc().

Add fallback processing to krb5_init_creds_set_keytab(), and use the
principal we find in the keytab as the request client principal.
Defer restart_init_creds_loop() to the first step call so that server
principal is built using the correct realm.

Add fallback processing to krb5_rd_req().

ticket: 8930 (new)

5 years agoDon't create hostbased principals in new KDBs 1099/head
Greg Hudson [Thu, 30 Jul 2020 16:14:27 +0000 (12:14 -0400)] 
Don't create hostbased principals in new KDBs

Unix-like platforms do not provide a simple method to find the
fully-qualified local hostname as the machine is expected to appear to
other hosts.  Canonicalizing the gethostname() result with
getaddrinfo() usually works, but potentially uses DNS.  Now that
dns_canonicalize_hostname=true is no longer the default, KDB creation
would generally create the wrong host-based principals.

kadmin/hostname is unnecessary because the client software can also
use kadmin/admin, and kiprop/hostname is one of several principals
that must be created for incremental propagation.

ticket: 8935 (new)

5 years agoTry kadmin/admin first in libkadm5clnt
Greg Hudson [Mon, 27 Jul 2020 05:19:01 +0000 (01:19 -0400)] 
Try kadmin/admin first in libkadm5clnt

The MIT krb5 kadmin protocol originally used kadmin/admin as the
service principal.  Commits 493f0da5fbf92b0ac2f10e887706d1964d8a15e8
and 5cfaec38a8e8f1c4b76228ba0a252987af797ca4 changed it to use
kadmin/hostname preferentially, with kadmin/admin as a fallback, for
interoperability with the Solaris SEAM administrative protocol.

Change the preference order so that kadmin/admin is tried first, with
kadmin/hostname as a fallback.

ticket: 8934 (new)

5 years agoFix three configure tests for Xcode 12 1100/head
Greg Hudson [Fri, 31 Jul 2020 22:35:15 +0000 (18:35 -0400)] 
Fix three configure tests for Xcode 12

Xcode 12 will change its clang to have
-Werror=implicit-function-declaration by default.  Fix three autoconf
tests which generate this warning due to missing include declarations.
Reported by Misty De Meo.

ticket: 8928

5 years agoFix leak in KERB_AP_OPTIONS_CBT server support 1097/head
Greg Hudson [Fri, 24 Jul 2020 20:05:24 +0000 (16:05 -0400)] 
Fix leak in KERB_AP_OPTIONS_CBT server support

In check_cbt(), use a local variable to hold the retrieved authdata
list, and free it before returning.

ticket: 8900

5 years agoFix token and type declarations in getdate.y 1096/head
Greg Hudson [Tue, 21 Jul 2020 05:41:21 +0000 (01:41 -0400)] 
Fix token and type declarations in getdate.y

Bison 3.5 adds a POSIX yacc compliance warning that %type should only
be applied to non-terminals.  Use %token for terminals in getdate.y.
Reported by Norm Green.

ticket: 8927

5 years agoIgnore bad enctypes in krb5_string_to_keysalts() 1094/head
Robbie Harwood [Wed, 15 Jul 2020 19:42:20 +0000 (15:42 -0400)] 
Ignore bad enctypes in krb5_string_to_keysalts()

Fixes a problem where the presence of legacy/unrecognized keysalts in
supported_enctypes would prevent the kadmin programs from starting.

[ghudson@mit.edu: ideally we would put a warning in the kadmind log,
but that is difficult to do when the parsing is done inside a library.
Even adding a trace log is difficult because the kadm5 str_conv
functions do not accept contexts.]

ticket: 8929 (new)

5 years agoAllow gss_unwrap_iov() of unpadded RC4 tokens 1093/head
Greg Hudson [Sun, 12 Jul 2020 01:57:30 +0000 (21:57 -0400)] 
Allow gss_unwrap_iov() of unpadded RC4 tokens

Windows Remote Management, when used with an RC4 session key, appears
to generate GSS wrap tokens with no padding instead of the expected
one byte (RFC 4757 section 7.3).  These tokens cannot be decoded with
gss_unwrap() or a STREAM buffer (even with Microsoft SSPI), but SSPI
allows them to be decoded using explicit IOVs with either a
zero-length padding buffer or no padding buffer.  Allow these cases to
work in kg_fixup_padding_iov().  (It is already possible to make this
work with HEADER | DATA | DATA, but only by
accident--kg_fixup_padding_iov() doesn't find a data buffer because
kg_locate_iov() only looks for singleton buffers, so it exits early.)

ticket: 8926 (new)
tags: pullup
target_version: 1.18-next

5 years agoAvoid backward seeks when reading keytab files 1092/head
Joshua Neuheisel [Fri, 3 Jul 2020 15:29:26 +0000 (11:29 -0400)] 
Avoid backward seeks when reading keytab files

When considering or bypassing an empty record in a keytab file, check
for a lenth of INT32_MIN.  Otherwise we could perform a backwards
seek, as the inverse of INT32_MIN is still negative.

[ghudson@mit.edu: adjusted comments; wrote commit message]

ticket: 8914

5 years agoAvoid using LMDB environments across forks 1088/head
Greg Hudson [Fri, 19 Jun 2020 19:05:37 +0000 (15:05 -0400)] 
Avoid using LMDB environments across forks

In krb5kdc and kadmind, reinitialize the DB state after daemonizing,
to prevent using an LMDB environment in a different process than it
was created.  Otherwise the daemon's reader table slot appears to be
stale and can be claimed by another process.

In kadmind, this change means that global_server_handle changes value
after the loop setup.  Add an extra level of pointer indirection so
that the handle passed to the loop remains valid.

kdb_init_hist() is now called twice by kadmind.  Change it to avoid
leaking hist_princ on the second invocation.

ticket: 8918
tags: pullup
target_version: 1.18-next
target_version: 1.17-next

5 years agoAdd GSS_KRB5_NT_X509_CERT name type 1081/head
Isaac Boukris [Mon, 12 Aug 2019 11:13:07 +0000 (11:13 +0000)] 
Add GSS_KRB5_NT_X509_CERT name type

If this name type is used for the desired_name parameter of
gss_acquire_cred_impersonate_name(), identify the S4U2Self user by
certificate.  Co-authored with Purand Chand <pchand@vmware.com>.

[ghudson@mit.edu: added documentation; updated to use a boolean at the
GSS layer rather than a new krb5 name type; rewrote commit message]

ticket: 8923 (new)

5 years agoTrace plugin module loading errors 1091/head
Greg Hudson [Sat, 27 Jun 2020 05:40:21 +0000 (01:40 -0400)] 
Trace plugin module loading errors

Add trace messages when dlopen() or dlsym() fails when loading a
plugin module.

ticket: 8922 (new)

5 years agoFix KDC choice to send encrypted S4U_X509_USER 1089/head
Greg Hudson [Tue, 23 Jun 2020 17:30:59 +0000 (13:30 -0400)] 
Fix KDC choice to send encrypted S4U_X509_USER

The KDC's decision to send a PA_S4U_X509_USER entry in encrypted
padata has no connection to the client USE_REPLY_KEY_USAGE flag.  Only
conditionalize on the enctype.

ticket: 8920 (new)

5 years agoAdd three kvno options from Heimdal kgetcred 1087/head
Greg Hudson [Thu, 18 Jun 2020 00:48:38 +0000 (20:48 -0400)] 
Add three kvno options from Heimdal kgetcred

Add the flags --cached-only and --no-store, which pass the
corresponding options to krb5_get_credentials().  Add the option
--out-cache to write the retrieved credentials to a specified output
cache.

Add a Python test script for kvno command-line options, including
tests for the new options.

ticket: 8917 (new)

5 years agoInterop with Heimdal KDC for S4U2Self requests 1083/head
Isaac Boukris [Tue, 9 Jun 2020 22:32:56 +0000 (01:32 +0300)] 
Interop with Heimdal KDC for S4U2Self requests

[MS-SFU] 3.1.5.1.1.1 says the KDC SHOULD send PA_S4U_X509_USER pa-data
if the TGT session key is of a newer enctype.  Our S4U2Self client
code has enforced this clause as if it were a MUST.  For consistency
with Microsoft and interoperability with Heimdal (which does not
implement PA_S4U_X509_USER), stop enforcing this constraint.

[ghudson@mit.edu: compressed code slightly; wrote commit message]

ticket: 8919 (new)

5 years agoPrevent deletion of K/M 1086/head
Greg Hudson [Sun, 14 Jun 2020 01:55:54 +0000 (21:55 -0400)] 
Prevent deletion of K/M

In libkadm5srv, do not allow deletion of the master key principal, as
it is very difficult to recover a KDB after doing so.

ticket: 8913

5 years agoTry to find <target>-ar when cross compiling 1085/head
Nikhil Benesch [Sat, 13 Jun 2020 23:54:34 +0000 (19:54 -0400)] 
Try to find <target>-ar when cross compiling

Teach the configure script to look for an ar tool prefixed with the
target triple (i.e., `<target>-ar`) when cross compiling. This matches
the behavior for tools that have built-in autoconf macros, like ranlib.
(For some reason there is no AC_PROG_AR macro.)

Also, remove the AC_PROG_ARCHIVE and AC_PROG_ARCHIVE_ADD macros, which
have been dead code since 780b34cd.

With this change, cross compiling libkrb5 works a bit better out of the
box.

ticket: 8915 (new)

5 years agoImprove negoex_parse_token() code hygiene 1082/head
Robbie Harwood [Tue, 9 Jun 2020 20:23:37 +0000 (16:23 -0400)] 
Improve negoex_parse_token() code hygiene

If the while loop in negoex_parse_token() runs for zero iterations,
major will be used initialized.  Currently this cannot happen, but
only because both of the call sites check for zero-length tokens.
Initialize major for safety.

[ghudson@mit.edu: rewrote commit message]

5 years agoOmit PA_FOR_USER if we can't compute its checksum 1080/head
Isaac Boukris [Sat, 6 Jun 2020 09:03:37 +0000 (11:03 +0200)] 
Omit PA_FOR_USER if we can't compute its checksum

OpenSSL in FIPS mode will refuse to perform hmac-md5.  Omit the legacy
PA_FOR_USER element in this case rather than failing out.

[ghudson@mit.edu: minor code and comment edits; wrote commit message]

ticket: 8912 (new)

5 years agoSet pw_expiration during LDAP load 1079/head
Greg Hudson [Thu, 4 Jun 2020 17:19:53 +0000 (13:19 -0400)] 
Set pw_expiration during LDAP load

When loading a principal entry in process_k5beta7_princ(), set the
KADM5_PW_EXPIRATION mask bit so that the password expiration time is
set on the principal entry.  Add a regression test.

Reported (with fix) by Glenn Machin.

ticket: 8882
tags: pullup
target_version: 1.18-next
target_version: 1.17-next

5 years agoFix typo in t_renew.py 1077/head
Robbie Harwood [Mon, 1 Jun 2020 19:31:17 +0000 (15:31 -0400)] 
Fix typo in t_renew.py

5 years agoRemove resolver test utility 1076/head
Greg Hudson [Thu, 28 May 2020 22:41:02 +0000 (18:41 -0400)] 
Remove resolver test utility

tests/resolve is no longer used after the previous commit.

5 years agoDefault dns_canonicalize_hostname to "fallback"
Greg Hudson [Wed, 27 May 2020 22:48:35 +0000 (18:48 -0400)] 
Default dns_canonicalize_hostname to "fallback"

This change should mitigate some of the pain caused by the rdns=true
default (generally associated with unwanted PTR records that cannot
easily be changed), with a minimum of fallout.

Update the documentation and tests accordingly.  In test environments,
disable qualify_shortname and use the uncanonicalized system hostname
(lowercased) to match the initial sn2princ result.

ticket: 8911 (new)

5 years agoAdd static object build rules for AESNI sources 1075/head
Nikhil Benesch [Tue, 26 May 2020 14:52:24 +0000 (10:52 -0400)] 
Add static object build rules for AESNI sources

ticket: 8910

5 years agoReturn GSS_S_NO_CRED from krb5 gss_acquire_cred 1074/head
Greg Hudson [Fri, 22 May 2020 17:10:36 +0000 (13:10 -0400)] 
Return GSS_S_NO_CRED from krb5 gss_acquire_cred

Earlier versions of the GSS-API spec (RFCs 1508 and 2078) do not list
GSS_S_NO_CRED as a valid error code for gss_acquire_cred.  As a
result, the OpenVision developers of the GSSAPI krb5 mech created
GSS_S_CRED_UNAVAIL as an alias for GSS_S_FAILURE and returned it when
no valid credentials could be obtained.  RFC 2743 lists GSS_S_NO_CRED
as the proper return code when matching credentials cannot be
accessed.  Change the krb5 gss_acquire_cred() implementation to return
GSS_S_NO_CRED where it currently returns GSS_S_CRED_UNAVAIL.

Also stop using GSS_S_CRED_UNAVAIL in the krb5 gss_store_cred(), but
change it to explicitly use GSS_S_FAILURE instead.  RFC 5588 specifies
GSS_S_NO_CRED as indicating a problem with input_cred_handle, not the
receiving store, so GSS_S_NO_CRED would be inappropriate.

ticket: 8909 (new)

5 years agoFix doc build
Greg Hudson [Wed, 27 May 2020 21:55:22 +0000 (17:55 -0400)] 
Fix doc build

Commits 5975ab86bf0ab791282cf1103b8143cccd1034fd and
4f7c77b64a048ca5e3199b26b31493698c777a9c added constants to krb5.hin
but did not update doc/appdev/refs/macros/index.rst.

5 years agoFix SPNEGO acceptor mech filtering 1073/head
Greg Hudson [Thu, 21 May 2020 18:15:25 +0000 (14:15 -0400)] 
Fix SPNEGO acceptor mech filtering

Commit c2ca2f26eaf817a6a7ed42257c380437ab802bd9 (ticket 8851)
accidentally changed the SPNEGO acceptor code to filter mechanisms by
the obtainability of initiator credentials rather than acceptor
credentials, when the default acceptor credential is used.

ticket: 8908 (new)
tags: pullup
target_version: 1.18-next

5 years agoAdd channel bindings tests 1047/head
Isaac Boukris [Thu, 19 Mar 2020 23:17:28 +0000 (00:17 +0100)] 
Add channel bindings tests

[ghudson@mit.edu: adjusted test program to output channel-bound state
instead of optionally enforcing it; adjusted tests to check program
output; split out tests into separate Python script; made cosmetic
changes]

ticket: 8900

5 years agoPass channel bindings through SPNEGO
Isaac Boukris [Tue, 28 Apr 2020 16:15:55 +0000 (18:15 +0200)] 
Pass channel bindings through SPNEGO

ticket: 8907 (new)

5 years agoAdd client_aware_channel_bindings option
Isaac Boukris [Tue, 10 Mar 2020 12:13:17 +0000 (13:13 +0100)] 
Add client_aware_channel_bindings option

Add client support for KERB_AP_OPTIONS_CBT in the form of a profile
option "client_aware_gss_bindings".  Adjust the make_etype_list()
helper so that enctype negotiation and AP_OPTIONS can be included in
the same IF-RELEVANT wrapper.

[ghudson@mit.edu: refactored; edited documentation; wrote commit
message]

ticket: 8900

5 years agoImplement KERB_AP_OPTIONS_CBT (server side)
Isaac Boukris [Mon, 9 Mar 2020 15:04:21 +0000 (16:04 +0100)] 
Implement KERB_AP_OPTIONS_CBT (server side)

Add server support for Microsoft's KERB_AP_OPTIONS_CBT as described in
MS-KILE.  If the client includes the AP option in the authenticator
authdata and the server passed channel bindings, require the bindings
to match.

[ghudson@mit.edu: refactored to put more logic in the helper function;
added a comment; clarified commit message]

ticket: 8900 (new)

5 years agoImplement GSS_C_CHANNEL_BOUND_FLAG
Alexander Scheel [Wed, 5 Jul 2017 15:38:30 +0000 (11:38 -0400)] 
Implement GSS_C_CHANNEL_BOUND_FLAG

Define a new channel-bound GSS return flag, and set it in the krb5
mech if the initiator sent channel bindings matching the acceptor's.
Do not error out if the acceptor specifies channel bindings and the
initiator does not send them.

[ghudson@mit.edu: simplified code changes; fleshed out commit message]

[iboukris: cherry-picked from another PR and reduced in scope]

ticket: 8899 (new)

5 years agoRefactor krb5 GSS checksum handling
Alexander Scheel [Fri, 30 Jun 2017 20:03:01 +0000 (16:03 -0400)] 
Refactor krb5 GSS checksum handling

Separate out checksum handling from kg_accept_krb5() into a new helper
process_checksum().

[ghudson@mit.edu: simplified checksum processing and made it use
k5-input.h instead of TREAD_ macros; moved more flag handling into
helper]

[iboukris: adjusted helper function arguments, allowing access to the
full authenticator for subsequent changes]

5 years agoFix typo ("in in") in the ksu man page 1071/head
Robbie Harwood [Thu, 14 May 2020 19:01:18 +0000 (15:01 -0400)] 
Fix typo ("in in") in the ksu man page

5 years agoAdd KDC helpers for current key and kvno 1072/head
Greg Hudson [Wed, 13 May 2020 17:01:31 +0000 (13:01 -0400)] 
Add KDC helpers for current key and kvno

Add a simple static inline function current_kvno() to safely fetch the
current kvno of a principal entry, and use it where we currently write
entry->key_data[0].key_data_kvno.

Add a function get_first_current_key() to find and decrypt the first
valid current key from an entry.  Use it in get_local_tgt() and when
selecting a ticket encryption key during AS and TGS processing.

Add a local_tgt_key field to krb5_kdcpreauth_rock_st and use it in
add_freshness_token() so we don't have to decrypt it again.

5 years agoPrevent use of invalid local TGT key 1070/head
Greg Hudson [Wed, 13 May 2020 17:05:49 +0000 (13:05 -0400)] 
Prevent use of invalid local TGT key

Commit 570967e11bd5ea60a82fc8157ad7d07602402ebb took a shortcut in
get_local_tgt() by using the first key data entry in the TGT principal
entry.  This is usually correct, but if the first key data entry has
an invalid enctype (such as a single-DES enctype), we can select a key
we can't use.  Call krb5_dbe_find_enctype() instead.  Reported by
Leonard Peirce.

ticket: 8906
tags: pullup
target_version: 1.18-next

5 years agoAdd stubs for some removed replay cache functions 1069/head
Greg Hudson [Sun, 10 May 2020 16:59:24 +0000 (12:59 -0400)] 
Add stubs for some removed replay cache functions

Commit dcb853ac32779b173f39e19c0f24b0087de85771 removed some replay
cache functions that haven't been considered part of the libkrb5 API.
Some of these functions were used in OpenSSL (despite the lack of
prototypes) prior to the OpenSSL 1.1 release.  Run-time linker errors
can occur if an OpenSSL 1.0.x (or earlier) libssl is used with a 1.18
libkrb5, even though the Kerberos code would likely never be used.

Add stubs for the four functions historically used in OpenSSL.

ticket: 8905 (new)
tags: pullup
target_version: 1.18-next

5 years agoAdd KRB5_PRINCIPAL_PARSE_NO_DEF_REALM flag 1068/head
Greg Hudson [Sun, 10 May 2020 16:25:52 +0000 (12:25 -0400)] 
Add KRB5_PRINCIPAL_PARSE_NO_DEF_REALM flag

Implement KRB5_PRINCIPAL_PARSE_NO_DEF_REALM from Heimdal.  This flag
for krb5_parse_name_flags() suppresses the addition of the default
realm, but allows and preserves the realm if one is specified in the
string.

ticket: 8904 (new)

5 years agoOmit KDC indicator check for S4U2Self requests 1067/head
Greg Hudson [Wed, 6 May 2020 20:03:13 +0000 (16:03 -0400)] 
Omit KDC indicator check for S4U2Self requests

As there was no initial ticket exchange from the client for an
S4U2Self request, the auth indicator check is inapplicable (and would
always fail if any auth indicators are required).

ticket: 8902 (new)

5 years agoStop reporting krb5 mech from IAKERB 1066/head
Greg Hudson [Wed, 6 May 2020 04:39:35 +0000 (00:39 -0400)] 
Stop reporting krb5 mech from IAKERB

In the IAKERB gss_init_sec_context() and gss_accept_sec_context(),
always report the IAKERB mech, as IAKERB is not a negotiation
mechanism.

ticket: 8901 (new)

5 years agoFix overzealous SPNEGO src_name/deleg_cred release 1065/head
Greg Hudson [Tue, 28 Apr 2020 15:37:10 +0000 (11:37 -0400)] 
Fix overzealous SPNEGO src_name/deleg_cred release

Commit 24b844714dea3e47b17511746b5df5b6ddf13d43 (ticket 8845) added
releases of sc->internal_name and sc->deleg_cred before calling the
underlying mech's gss_accept_sec_context(), to avoid a potential leak
if the mech reports a value multiple times.  Commit
c2ca2f26eaf817a6a7ed42257c380437ab802bd9 (ticket 8851) added a branch
which calls negoex_accept() instead of calling directly into the
underlying mech.  If negoex_accept() doesn't call into the mech on the
last acceptor leg, the src_name and deleg_cred values from the final
mech call are lost.

Move the releases to the non-NegoEx branch.  negoex_accept() already
does its own releases when it calls into the mech.

Reported by Luke Howard.

ticket: 8898 (new)
tags: pullup
target_version: 1.18-next

5 years agoPass gss_localname() through SPNEGO 1064/head
Greg Hudson [Sun, 26 Apr 2020 23:55:54 +0000 (19:55 -0400)] 
Pass gss_localname() through SPNEGO

ticket: 8897 (new)

5 years agomake regen
Greg Hudson [Fri, 17 Apr 2020 20:32:11 +0000 (16:32 -0400)] 
make regen

5 years agoFix typo in SPAKE modprinc example 1062/head
Daniel Albers [Thu, 9 Apr 2020 09:25:34 +0000 (11:25 +0200)] 
Fix typo in SPAKE modprinc example

ticket: 8896 (new)
tags: pullup
target_version: 1.18-next

5 years agoMake ksu honor KRB5CCNAME again 1061/head
Greg Hudson [Tue, 7 Apr 2020 00:45:10 +0000 (20:45 -0400)] 
Make ksu honor KRB5CCNAME again

Commit d439e370b70f7af4ed2da9c692a3be7dcf7b4ac6 (ticket 8800) caused
ksu to ignore KRB5CCNAME from the environment.  ksu uses euid
switching to access the source cache, and should honor KRB5CCNAME to
find the ccache to potentially authorize the su operation.

Add a helper function init_ksu_context() to create the ksu context,
with explicit code to honor KRB5CCNAME using
krb5_cc_set_default_name().

ticket: 8895
tags: pullup
target_version: 1.18-next

5 years agoCorrect formatting of trace log microseconds 1059/head
Greg Hudson [Fri, 3 Apr 2020 05:04:06 +0000 (01:04 -0400)] 
Correct formatting of trace log microseconds

Always use six digits with leading 0s to format the microseconds in
trace log timestamps; otherwise a small value appears as too large of
a fraction of a second.

ticket: 8894 (new)
tags: pullup
target_version: 1.18-next
target_version: 1.17-next

5 years agoFix typos in comments 1058/head
Greg Hudson [Thu, 2 Apr 2020 17:56:58 +0000 (13:56 -0400)] 
Fix typos in comments

Correct comment spelling errors detected using codespell.
Reported by Jens Schleusener.

5 years agoFix typos in documentation
Greg Hudson [Thu, 2 Apr 2020 17:22:45 +0000 (13:22 -0400)] 
Fix typos in documentation

Correct documentation spelling errors detected using codespell.
Reported by Jens Schleusener.

ticket: 8891
tags: pullup
target_version: 1.18-next

5 years agoDo expiration warnings for all init_creds APIs 1056/head
Sumit Bose [Fri, 28 Feb 2020 09:11:49 +0000 (10:11 +0100)] 
Do expiration warnings for all init_creds APIs

Move the password expiration warning code from gic_pwd.c to
get_in_tkt.c.  Call it from init_creds_step_reply() on successful
completion.

[ghudson@mit.edu: added test case; simplified doc comment; moved call
site to init_creds_step_reply(); rewrote commit message]

ticket: 8893 (new)

5 years agoCorrectly import "service@" GSS host-based name 1057/head
Greg Hudson [Mon, 30 Mar 2020 19:26:02 +0000 (15:26 -0400)] 
Correctly import "service@" GSS host-based name

The intended way to specify only a service in a GSS host-based name is
to omit the "@" separator.  Some applications include the separator
but no hostname, and this happened to yield wildcard hostname behavior
prior to commit 996353767fe8afa7f67a3b5b465e4d70e18bad7c when
shortname qualification was added.  To restore this behavior, check in
parse_hostbased() that at least one character is present after the "@"
separator before copying the hostname.  Add a test case to t_gssapi.py.

ticket: 8892
tags: pullup
target_version: 1.18-next

5 years agoMake fiat 128-bit typedefs work with older gcc 1055/head
Greg Hudson [Tue, 24 Mar 2020 06:00:25 +0000 (02:00 -0400)] 
Make fiat 128-bit typedefs work with older gcc

Use the int128_t and uint128_t types defined by edwards25519.c, rather
than [un]signed __int128 which does not compile with gcc 4.4.
Reported by Norm Green.

ticket: 8888
tags: pullup
target_version: 1.18-next
target_version: 1.17-next

5 years agoEliminate redundant PKINIT responder invocation 1054/head
Greg Hudson [Mon, 23 Mar 2020 23:10:03 +0000 (19:10 -0400)] 
Eliminate redundant PKINIT responder invocation

In pkinit_client_prep_questions(), only act if the input padata type
is KRB5_PADATA_PK_AS_REQ.  Otherwise we will ask questions again when
the KDC issues a ticket.

Commit 7621d2f9a87214327ca3b2594e34dc7cea84596b (ticket 8242)
unintentionally changed the behavior of pkinit_load_fs_cert_and_key(),
causing pkinit_client_prep_questions() to do nothing on its first
call.  Restore the original behavior of returning 0 when prompting is
deferred.

Modify the existing "FILE identity, password on key (responder)"
PKINIT test to check that the responder is only invoked once.

ticket: 8885

5 years agomake regen
Greg Hudson [Thu, 26 Mar 2020 05:01:32 +0000 (01:01 -0400)] 
make regen

5 years agoAdd "make regen" 1052/head
Greg Hudson [Fri, 20 Mar 2020 16:29:08 +0000 (12:29 -0400)] 
Add "make regen"

Add a top-level Makefile.in target to update checked-in generated
files, to simplify release engineering and repository maintenance.

5 years agoAdd finalization safety check to com_err 1048/head
Jiri Sasek [Fri, 13 Mar 2020 18:02:58 +0000 (19:02 +0100)] 
Add finalization safety check to com_err

If the linker erroneously runs the libkrb5 finalizer after the
libcom_err finalizer, the consequent remove_error_table() calls could
crash due to accessing a destroyed mutex or an invalid et_list
pointer.  Add an unsynchronized check on finalized in
remove_error_table(), and set et_list to null in com_err_terminate()
after destroying the list.

[ghudson@mit.edu: minimized code hanges; rewrote comment and commit
message]

ticket: 8890 (new)

5 years agoRemove unused util/ss files 1051/head
Greg Hudson [Thu, 19 Mar 2020 23:37:39 +0000 (19:37 -0400)] 
Remove unused util/ss files

Delete the old C/yacc/lex sources for mk_cmds.

5 years agoUpdate DES section in README
Greg Hudson [Wed, 18 Mar 2020 23:21:56 +0000 (19:21 -0400)] 
Update DES section in README

5 years agoDocument client keytab usage 1050/head
Greg Hudson [Mon, 16 Mar 2020 22:14:30 +0000 (18:14 -0400)] 
Document client keytab usage

ticket: 8886 (new)
tags: pullup
target_version: 1.18-next

5 years agoRemove Perl workaround in Github Actions config 1049/head
Greg Hudson [Thu, 12 Mar 2020 14:49:07 +0000 (10:49 -0400)] 
Remove Perl workaround in Github Actions config

The Github Actions runners for Windows now place Strawberry Perl
earlier in the path than git-bash.

5 years agoFix typo in musl build fix
Greg Hudson [Thu, 12 Mar 2020 04:44:10 +0000 (00:44 -0400)] 
Fix typo in musl build fix

Commit cbdbc8d00d31344fafe00e0fdf984e04e631f7c4 checked for
__GLIBC__PREREQ instead of __GLIBC_PREREQ, thus accidentally reverting
the workaround introduced in commit
bf5953c549a6d279977df69ffe89b2ba51460eaf.  Fix the typo.

ticket: 8880

5 years agoUpdate copyright years to 2020
Greg Hudson [Mon, 9 Mar 2020 20:21:17 +0000 (16:21 -0400)] 
Update copyright years to 2020

5 years agoChange KDC constrained-delegation precedence order 1032/head
Isaac Boukris [Wed, 29 Jan 2020 21:35:50 +0000 (22:35 +0100)] 
Change KDC constrained-delegation precedence order

MS-SFU errata from 2019/12/09 indicates that legacy constrained
delegation should be prefered over resource-based constrained
delegation, which results slight diferences.

Also clarify that in the get_authdata_info KDB method, the PAC must be
verified and checked for user sensitivity for S4U2Proxy.  Document
that the client name should only be provided in the cross-realm
S4U2Proxy case.

[ghudson@mit.edu: clarified comments and commit message]

ticket: 8884 (new)
tags: pullup
target_version: 1.18-next

5 years agoFix null dereference qualifying short hostnames 1045/head
Greg Hudson [Tue, 3 Mar 2020 17:27:02 +0000 (12:27 -0500)] 
Fix null dereference qualifying short hostnames

Fix the dnsglue.c PRIMARY_DOMAIN macro not to call strdup() with a
null pointer if no DNS search path is configured.

ticket: 8881
tags: pullup
target_version: 1.18-next

5 years agoUse two queues for concurrent t_otp.py daemons 1046/head
Greg Hudson [Wed, 4 Mar 2020 22:18:51 +0000 (17:18 -0500)] 
Use two queues for concurrent t_otp.py daemons

t_otp.py occasionally fails during the #8708 regression test, reading
a true answer instead of the expected false answer during the first
verify() call.  Most likely the daemons are writing their answers to
the shared queue out of order.  Use a separate queue for the second
daemon to ensure correct correlation of results.

5 years agoRefresh manually acquired creds from client keytab 1044/head
Robbie Harwood [Wed, 26 Feb 2020 23:27:17 +0000 (18:27 -0500)] 
Refresh manually acquired creds from client keytab

If a client keytab is present but credentials are acquired manually,
the credentials would not be refreshed because no refresh_time config
var is set in the cache.  Change kg_cred_time_to_refresh() to attempt
a refresh from the client keytab on any credentials which will expire
in the next 30 seconds.

[ghudson@mit.edu: adjused code and added test case]

ticket: 7976

5 years agoFix Linux build error with musl libc 1042/head
TBK [Wed, 26 Feb 2020 20:12:45 +0000 (21:12 +0100)] 
Fix Linux build error with musl libc

Commit bf5953c549a6d279977df69ffe89b2ba51460eaf caused a build failure
on non-glibc Linux build environments.  Change the conditionalization
so that __GLIBC_PREREQ will only be used if it is defined.

[ghudson@mit.edu: simplified conditionals; rewrote commit message]

ticket: 8880 (new)
tags: pullup
target_version: 1.18-next

5 years agoAllow deletion of require_auth with LDAP KDB 1043/head
Greg Hudson [Tue, 25 Feb 2020 16:32:09 +0000 (11:32 -0500)] 
Allow deletion of require_auth with LDAP KDB

In update_ldap_mod_auth_ind(), if there is no string attribute value
for require_auth, check for krbPrincipalAuthInd attributes that might
need to be removed.  (This will only work if the entry is loaded and
then modified, but that is the normal case for an existing entry.)

Move the update_ldap_mod_auth_ind() call inside the tl-data
conditional (which should perhaps be a check for KADM5_TL_DATA in the
mask instead).  A modification which did not intend to update tl-data
should not remove the krbPrincipalAuthInd attributes.

Change get_int_from_tl_data() to to zero its output so that it can't
leave a garbage value behind if it returns 0 (as it does if no
KDB_TL_USER_INFO tl-data is present).

Based on a patch by Glenn Machin.

ticket: 8877
tags: pullup
target_version: 1.18-next
target_version: 1.17-next

5 years agoAllow certauth modules to set hw-authent flag
Greg Hudson [Mon, 24 Feb 2020 20:58:59 +0000 (15:58 -0500)] 
Allow certauth modules to set hw-authent flag

In PKINIT, if a certauth module returns KRB5_CERTAUTH_HWAUTH from its
authorize method, set the hw-authent flag in the ticket.

ticket: 8879 (new)

5 years agoFix AS-REQ checking of KDB-modified indicators 1040/head
Greg Hudson [Wed, 19 Feb 2020 20:36:38 +0000 (15:36 -0500)] 
Fix AS-REQ checking of KDB-modified indicators

Commit 7196c03f18f14695abeb5ae4923004469b172f0f (ticket 8823) gave the
KDB the ability to modify auth indicators, but it happens after the
asserted indicators are checked against the server principal
requirements.  In finish_process_as_req(), move the call to
check_indicators() after the call to handle_authdata() so that the
final indicator list is checked.

For the test case, add string attribute functionality to the test KDB
module, and fix a bug where test_get_principal() would return failure
if a principal has no keys.  Also add a test case for AS-REQ
enforcement of normally asserted auth indicators.

ticket: 8876 (new)
tags: pullup
target_version: 1.18-next

5 years agoReplace gssrpc tests with a Python script 1039/head
Greg Hudson [Sun, 16 Feb 2020 01:34:23 +0000 (20:34 -0500)] 
Replace gssrpc tests with a Python script

Replace the dejagnu RPC test framework with a short Python script to
do the same tests as fullrun.exp and gsserr.exp.  Modify the server
test program to facilitate use by k5test.py.

expire.exp, together with a comment in the client test program, was
designed to test a libdb2 btree bug via the gssrpc server-side
authentication code.  That code was subsequently changed not to use
libdb2, before it was merged into the main krb5 tree (in revision 1.23
of svc_auth_gssapi.c, according to the changelog removed in commit
2a43d772be1e45faa8e488d436b6e867371563fb).  Remove the comment and do
not replace that test sequence.

5 years agoRun CI builds on pull requests
Greg Hudson [Tue, 18 Feb 2020 00:09:17 +0000 (19:09 -0500)] 
Run CI builds on pull requests

5 years agoUse GitHub Actions for CI 1038/head
Michael Mattioli [Tue, 26 Nov 2019 02:28:57 +0000 (21:28 -0500)] 
Use GitHub Actions for CI

Use Github Actions instead of Travis and AppVeyor.

In the Windows installer config, add support for Visual Studio 2019
(aka 16.0).

[ghudson@mit.edu: switched to Ubuntu 18.04 for Linux builds; removed
macOS build job for now; added more packages to avoid skipping tests;
made it easier to see skipped tests and to see files not cleaned;
added make install command; adjusted Windows build path]

5 years agoAlways use S4U2Proxy second ticket parsed authdata
Isaac Boukris [Thu, 30 Jan 2020 18:38:44 +0000 (19:38 +0100)] 
Always use S4U2Proxy second ticket parsed authdata

When the KDC handles an S4U2Proxy request, if the KDB module returned
parsed authdata for the header ticket and not for the second ticket,
we could erroneously pass the header ticket's parsed authdata to
handle_authdata().  Make sure we always pass the parsed authdata for
the second ticket.

[ghudson@mit.edu: added comment; rewrote commit message]

ticket: 8874 (new)
tags: pullup
target_version: 1.18

5 years agoDon't assume OpenSSL failures are memory errors 1035/head
Robbie Harwood [Wed, 5 Feb 2020 17:56:00 +0000 (12:56 -0500)] 
Don't assume OpenSSL failures are memory errors

More recent versions of OpenSSL can fail for other reasons.  Indicate
a crypto-related error occurred rather than a memory error to aid
debugging.

ticket: 8873 (new)
tags: pullup
target_version: 1.18
target_version: 1.17-next

5 years agoRefactor KDC authdata list management helpers 1036/head
Greg Hudson [Wed, 5 Feb 2020 23:46:11 +0000 (18:46 -0500)] 
Refactor KDC authdata list management helpers

Remove the unused concat_authorization_data().  Split merge_authdata()
into two helpers, one to destructively merge without filtering and one
to add copied elements while filtering out KDC-only authdata types.
Remove context parameters where they aren't needed (taking advantage
of knowledge that some libkrb5 functions don't use their context
parameters).

5 years agoTest that PAC is the first authdata element 1033/head
Isaac Boukris [Sat, 1 Feb 2020 12:21:39 +0000 (13:21 +0100)] 
Test that PAC is the first authdata element

In the test KDB module, set the PAC as the first authdata element.  In
adata.c, add PAC service verification and verify that a PAC does not
appear in authdata elements after the first.

[ghudson@mit.edu: minor style changes; edited commit message]

ticket: 8872

5 years agoPut KDB authdata first
Isaac Boukris [Sat, 1 Feb 2020 15:13:30 +0000 (16:13 +0100)] 
Put KDB authdata first

Windows services, as well as some versions of Samba, may refuse
tickets if the PAC is not in the first AD-IF-RELEVANT container.  In
fetch_kdb_authdata(), change the merge order so that authdata from the
KDB module appears first.

[ghudson@mit.edu: added comment and clarified commit message]

ticket: 8872 (new)
tags: pullup
target_version: 1.18
target_version: 1.17-next

5 years agoRemove private mutators for context enctypes 1028/head
Robbie Harwood [Thu, 23 Jan 2020 18:09:00 +0000 (13:09 -0500)] 
Remove private mutators for context enctypes

krb5_set_default_in_tkt_ktypes() and krb5_set_default_tgs_ktypes() are
not part of the API and are only used in test programs, so remove
them.  Also remove the now-unused in_tkt_etypes field from
krb5_context.  Update test suite consumers.

Fix a minor bug wherein the etinfo executable would not correctly
print its usage text.

[ghudson@mit.edu: adapted some tests rather than remove them]

5 years agoZero length fields when freeing object contents 1031/head
Isaac Boukris [Sun, 26 Jan 2020 20:49:47 +0000 (21:49 +0100)] 
Zero length fields when freeing object contents

In krb5_free_data_contents() and krb5_free_checksum_contents(), zero
the length as well as the data pointer to leave the object in a valid
state.  Add asserts to existing test harnesses to verify the new
behavior.

In the krb5 GSS mech's kg_checksum_channel_bindings(), remove the code
to reallocate the checksum with xmalloc(), as it relied on
krb5_free_checksum_contents() leaving the object in an invalid state.
This code was added in commit a30fb4c4400f13a2690df7ef910b7ac0ccbcf194
to match an xfree() call, but commit
29337e7c7b796685fb6a03466d32147e17aa2d16 replaced that xfree() with a
krb5_free_checksum_contents().  (In addition, the xmalloc and xfree
wrappers never evolved to do anything beyond malloc and free.)

In kpropd's recv_database(), don't free outbuf until we are done using
its length.

[ghudson@mit.edu: rewrote commit message; edited doxygen comment
changes to mention version]

ticket: 8871 (new)

5 years agoHonor transited-policy-checked flag in servers 1030/head
Greg Hudson [Fri, 24 Jan 2020 15:25:18 +0000 (10:25 -0500)] 
Honor transited-policy-checked flag in servers

For consistency with Heimdal and simplicity of server configuration,
do not check the transited field in krb5_rd_req() if the
transited-policy-checked flag is set in the ticket.

Add a cross-realm test using the gcred and rdreq harnesses to test
server transited processing.  Also fix the KDC capaths case so that
the client actually doesn't know the path to the server realm.  In
k5test.py, adjust _cfg_merge() to remove keys mapped to None in the
second dictionary (instead of mapping them to None in the result), so
that deleting whole sections works.  Remove the corresponding check
for None in _write_cfg_section() as it is no longer needed.

ticket: 8870 (new)
tags: pullup
target_version: 1.18

5 years agoFurther simplify test KDB module authdata code 1029/head
Greg Hudson [Thu, 23 Jan 2020 19:49:24 +0000 (14:49 -0500)] 
Further simplify test KDB module authdata code

Commit 94f7c9705879500b1dc8dda8592490efce05688f simplified the
generation of authdata elements, but left behind some unnecessary
conditionalization when assembling the elements into a list, causing a
Coverity defect.  Further simplify the code.

ticket: 8868

5 years agoApply permitted_enctypes to KDC request enctypes 1025/head
Robbie Harwood [Tue, 14 Jan 2020 19:23:00 +0000 (14:23 -0500)] 
Apply permitted_enctypes to KDC request enctypes

permitted_enctypes was initially intended only to restrict the
processing of AP requests (and was later applied to KDB key data
searches so that the KDC wouldn't issue a ticket it would refuse to
accept).  Because the documentation was never clear about its scope,
many configurations assume that permitted_enctypes also applies to
clients.

In light of the existing configurations, take the simple way out and
use permitted_enctypes as the default for default_tkt_enctypes and
default_tgs_enctypes.  Update the documentation, add a test to
explicitly check the new behavior, and remove now-unnecessary
configuration from the test suite.

[ghudson@mit.edu: unrolled helper function; edited documentation and
commit message; simplified test case]

ticket: 8869 (new)
tags: pullup
target_version: 1.18

5 years agoAdd tests for cross-realm RBCD request authdata 1027/head
Isaac Boukris [Sat, 18 Jan 2020 01:54:32 +0000 (02:54 +0100)] 
Add tests for cross-realm RBCD request authdata

ticket: 8866

5 years agoAllow cross-realm RBCD with PAC and other authdata
Isaac Boukris [Wed, 15 Jan 2020 10:14:00 +0000 (11:14 +0100)] 
Allow cross-realm RBCD with PAC and other authdata

For cross-realm S4U2Proxy requests, require a PAC to be present to
bypass signedpath verification, but do not require it to be the only
authdata element.  For within-realm requests, add and verify
signedpath authdata regardless of the presence of a PAC.

Simplify the test KDB authdata module and the existing RBCD tests as
we no longer need a way to suppress the test module's KDB authdata.

[ghudson@mit.edu: rewrote commit message; reordered a condition for
efficiency]

ticket: 8868 (new)
tags: pullup
target_version: 1.18

5 years agoFix KDC crash in handle_signticket
Isaac Boukris [Wed, 15 Jan 2020 12:54:44 +0000 (13:54 +0100)] 
Fix KDC crash in handle_signticket

Commit d47f7dba3779c9e36e1dedaac830dac1dd248fb3 changed the parameters
passed to sign_authdata() for S4U2Proxy requests so that client is the
entry for the impersonated client (not the impersonator), and added a
new parameter for the impersonator entry.  It should have changed the
call to handle_signticket() to use the impersonator entry.  Fix the
handle_signticket() call, and change some parameter names to more
clearly indicate the flow of subject_server from process_tgs_req() to
handle_authdata() to its helpers.

[ghudson@mit.edu: edited commit message]

ticket: 8867 (new)
tags: pullup
target_version: 1.18

5 years agoAdd tests for S4U request-authdata handling 1013/head
Isaac Boukris [Thu, 12 Dec 2019 02:20:44 +0000 (03:20 +0100)] 
Add tests for S4U request-authdata handling

In adata.c, look up the server in the keytab by ticket->server (which
has the canonicalized realm), to allow testing of cross-realm RBCD
(although unused for now).

In s4u2proxy.c, set KRB5_GC_CANONICALIZE to support RBCD, and add an
authdata request option.  Add an s4u2self test harness with authdata
request option.

[ghudson@mit.edu: minor code simplifications; edited commit message]

ticket: 8866

5 years agoFix S4U client authdata handling
Isaac Boukris [Thu, 12 Dec 2019 02:40:04 +0000 (03:40 +0100)] 
Fix S4U client authdata handling

Only send client authdata in the initial request, and note
request authdata in out_creds.

ticket: 8866 (new)
tags: pullup
target_version: 1.18

5 years agoFix error handling in gssint_mechglue_init() 1023/head
Greg Hudson [Sat, 11 Jan 2020 04:47:34 +0000 (23:47 -0500)] 
Fix error handling in gssint_mechglue_init()

In the unlikely event that one of the functions called by
gssint_mechglue_init() returns an error, return that error to the
caller rather than continuing on and discarding the error status.
Returning success when some of the operations failed could fool the
library finalizer into thinking that initialization completed.
Reported by Spencer Malone.

ticket: 8864 (new)
tags: pullup
target_version: 1.18
target_version: 1.17-next