]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
8 years agoApply TCP timeouts to HTTPS (KKDCP) transport
Greg Hudson [Thu, 20 Apr 2017 19:33:10 +0000 (15:33 -0400)] 
Apply TCP timeouts to HTTPS (KKDCP) transport

We apply (as of ticket #7604) a ten-second minimum delay after a TCP
connection is accepted before creating new connections or sending UDP
packets.  Apply this timeout to HTTPS connections as well, by removing
the transport check in get_endtime().  As the endtime field is only
set by service_tcp_connect(), it will always have the value 0 for UDP
connection state objects, so there is no need to check the transport
type.

(cherry picked from commit aace82e17ed0185faa3e9cda5437a3c6a7a40b10)

ticket: 8580
version_fixed: 1.15.2

8 years agoMake RC4 string-to-key more robust
Greg Hudson [Sat, 15 Apr 2017 01:41:20 +0000 (21:41 -0400)] 
Make RC4 string-to-key more robust

krb5int_utf8cs_to_ucs2les() can read slightly beyond the end of the
input buffer if the buffer ends with an invalid UTF-8 sequence.  When
computing the RC4 string-to-key result, make a zero-terminated copy of
the input string and use krb5int_utf8s_to_ucs2les() instead.

(cherry picked from commit b8814745049b5f401e3ae39a81dc1e14598ae48c)

ticket: 8576
version_fixed: 1.15.2

8 years agoCheck for FAST in encrypted challenge client
Greg Hudson [Tue, 11 Apr 2017 21:00:01 +0000 (17:00 -0400)] 
Check for FAST in encrypted challenge client

If we reach the encrypted challenge clpreauth process method without
an armor key, error out instead of crashing.  This can happen if (a)
the KDC offers encrypted challenge even though the request doesn't use
FAST (the Heimdal KDC apparently does this), and (b) we fall back to
that preauth method before generating a preauthenticated request,
typically because of a prompter failure in encrypted timestamp.
Reported by Nico Williams.

(cherry picked from commit ff6aac3e018e80fa32df2e14446c6ed9595dfc3c)

ticket: 8573
version_fixed: 1.15.2

8 years agoFix uninitialized flags in MSLSA ccache type
Alexander Karaivanov [Mon, 24 Apr 2017 07:01:12 +0000 (09:01 +0200)] 
Fix uninitialized flags in MSLSA ccache type

The flags field in krb5_lcc_data is not initialized in
krb5_lcc_resolve(), so krb5_lcc_next_cred() can sometimes fail to
include a ticket when retrieving a ccache entry.  This results in a
"Request did not supply a ticket" error from k5_make_tgs_req() when
trying to use the credential.

[ghudson@mit.edu: condensed commit message]

(cherry picked from commit e5a78d4c90d9d6968c94b0c07f2cd3835f02aa5d)

ticket: 8567
version_fixed: 1.15.2

8 years agoFix krb5int_open_plugin_dirs() error handling
Martin Kittel [Wed, 15 Mar 2017 16:21:28 +0000 (17:21 +0100)] 
Fix krb5int_open_plugin_dirs() error handling

In krb5int_open_plugin_dirs(), if constructing filepath fails,
filepath is set to null but accessed a few lines later.  Add an error
check before calling krb5int_open_plugin().

(cherry picked from commit ec56309e95e37cb3c91bad2a696b9bd094620876)

ticket: 8565
version_fixed: 1.15.2

8 years agoIgnore dotfiles in profile includedir
Greg Hudson [Fri, 24 Mar 2017 15:07:21 +0000 (11:07 -0400)] 
Ignore dotfiles in profile includedir

Editors and filesystems may create artifacts related to .conf files
which don't change the file suffix; these artifacts generally begin
with "." so that they don't appear in normal directory listings
(e.g. ".#filename" for emacs interlock files).  Make sure to ignore
any such artifacts when processing a profile includedir directive.

(cherry picked from commit e8e1d841f8e43e4f441b451d91333a01e43c1b6f)

ticket: 8563
version_fixed: 1.15.2

8 years agoForce autoconf rebuild in maintainer rules
Greg Hudson [Tue, 14 Mar 2017 23:39:38 +0000 (19:39 -0400)] 
Force autoconf rebuild in maintainer rules

autoconf normally avoids recreating files that it does not consider
obsolete.  Since it knows nothing about patchlevel.h (which we read at
autoconf time using m4's esyscmd()), changes to patchlevel.h won't be
reflected in configure unless another input to configure has changed,
and the maintainer rule will re-run autoconf over and over again.  Fix
this issue by passing the force flag to autoconf when we invoke it
from the maintainer rule.

(cherry picked from commit 7027788ae6adbd06d5a16de6ee62e489a4dca68b)

ticket: 8560
version_fixed: 1.15.2

8 years agoFix leaks in gss_inquire_cred_by_oid()
Greg Hudson [Sun, 12 Mar 2017 16:30:59 +0000 (12:30 -0400)] 
Fix leaks in gss_inquire_cred_by_oid()

In the mechglue gss_inquire_cred_by_oid(), remove an unnecessary
allocation of ret_set which is overwritten by the first mechanism's
result.

(cherry picked from commit 0d39d46852587d36fcc5024d5766586faba9044a)

ticket: 8559
version_fixed: 1.15.2

8 years agoAllow null outputs to gss_get_name_attribute()
Isaac Boukris [Sat, 4 Mar 2017 19:23:32 +0000 (21:23 +0200)] 
Allow null outputs to gss_get_name_attribute()

In krb5_gss_get_name_attribute(), always ask for kvalue and
kdisplay_value when calling krb5_authdata_get_attribute(), as it
currently expect non-null arguments.  This change allows applications
to pass GSS_C_NO_BUFFER for the value and display_value output
parameters.  (Passing NULL for the authenticated and complete output
parameters already works.)

[ghudson@mit.edu: initialized kvalue and kdisplay_value for safety]

(cherry picked from commit 0cff20bd02c7e9b0bc88c425b58fa2d379da51b3)

ticket: 8557
version_fixed: 1.15.2

8 years agoUpdate for krb5-1.15.1-postrelease
Greg Hudson [Fri, 3 Mar 2017 17:30:58 +0000 (12:30 -0500)] 
Update for krb5-1.15.1-postrelease

8 years agoUpdate for krb5-1.15.1 krb5-1.15.1-final
Greg Hudson [Tue, 28 Feb 2017 19:51:29 +0000 (14:51 -0500)] 
Update for krb5-1.15.1

8 years agomake update-po
Greg Hudson [Thu, 2 Mar 2017 16:34:01 +0000 (11:34 -0500)] 
make update-po

8 years agoUpdate man pages
Greg Hudson [Thu, 2 Mar 2017 16:33:29 +0000 (11:33 -0500)] 
Update man pages

8 years agoUpdate copyright years to 2017
Michael Mattioli [Tue, 27 Dec 2016 22:02:04 +0000 (17:02 -0500)] 
Update copyright years to 2017

(cherry picked from commit 35cd8db0f6627324b3b3a31f29b34774f649263b)

8 years agoFix udp_preference_limit with SRV records
Greg Hudson [Tue, 28 Feb 2017 03:35:07 +0000 (22:35 -0500)] 
Fix udp_preference_limit with SRV records

In sendto_kdc:resolve_server() when resolving a server entry with a
specified transport, defer the resulting addresses if the strategy
dictates that the specified transport is not preferred.  Reported by
Jochen Hein.

(cherry picked from commit bc7594058011c2f9711f24af4fa15a421a8d5b62)

ticket: 8554
version_fixed: 1.15.1

8 years agoFix PKINIT two-component matching rule parsing
Greg Hudson [Fri, 24 Feb 2017 18:41:53 +0000 (13:41 -0500)] 
Fix PKINIT two-component matching rule parsing

In pkinit_matching.c:parse_rule_set(), apply the default relation when
parsing the second component of a rule, not the third.  Otherwise we
apply no default relation to two-component matching rules, effectively
reducing such rules to their second components.  Reported by Sumit
Bose.

(cherry picked from commit 67ae7bbe1ea7032d1cb79682be3a14e7e13ec64f)

ticket: 8553
version_fixed: 1.15.1

8 years agoDocument multi-component PKINIT client certs
Greg Hudson [Mon, 30 Jan 2017 17:30:51 +0000 (12:30 -0500)] 
Document multi-component PKINIT client certs

In pkinit.rst, note that the extensions.client file only works for
single-component client principals, and describe how to modify it for
multi-component principals.

(cherry picked from commit 8abbb9b805e457849e9e414bd2ef610ad9fc4f06)

ticket: 7940
version_fixed: 1.15.1

8 years agoAdd free_principal_e_data KDB method
Andreas Schneider [Wed, 18 Jan 2017 10:52:48 +0000 (11:52 +0100)] 
Add free_principal_e_data KDB method

Add an optional method to kdb_vftabl to free e_data pointer in a
principal entry, in case it was populated by a module using a more
complex structure than a single memory region.

[ghudson@mit.edu: handled minor version bump; simplified code; rewrote
commit message]

(cherry picked from commit 87d8d1c6da227ff9410413de39ee64e4566429e5)

ticket: 8538
version_fixed: 1.15.1

8 years agoExplicitly copy KDB vtable fields
Greg Hudson [Wed, 18 Jan 2017 16:40:49 +0000 (11:40 -0500)] 
Explicitly copy KDB vtable fields

In preparation for bumping the kdb_vftabl minor version, use explicit
field assignments when copying the module vtable to the internal copy,
so that we can conditionalize assignments for minor versions greater
than 0.

(cherry picked from commit 50605efa5058583667227223a75ca44a512f4796)

ticket: 8538
version_fixed: 1.15.1

8 years agoDocument default realm and login authorization
Greg Hudson [Wed, 25 Jan 2017 18:07:42 +0000 (13:07 -0500)] 
Document default realm and login authorization

Add documentation to host_config.rst describing what the default realm
does.  Also add documentation discussing login authorization
configuration, and give an example showing how to give login access to
principals from a realm other than the default realm.

(cherry picked from commit 16550e85a2c317c5404fa336c084381d83b90740)

ticket: 8540
version_fixed: 1.15.1

8 years agoAdd GSSAPI S4U documentation
Greg Hudson [Fri, 17 Feb 2017 18:38:19 +0000 (13:38 -0500)] 
Add GSSAPI S4U documentation

Describe how a GSS application can perform S4U2Self and S4U2Proxy
requests using the MIT krb5 GSS library.  Also add a reference to RFC
7546 at the top, and fix a reference to gssapi_krb5.h.

(cherry picked from commit 31fcadd6bef5e3fbcc986220b860a1af8c7030a1)

ticket: 8552
version_fixed: 1.15.1

8 years agoFix GSSAPI authind attribute name in docs
Matt Rogers [Tue, 3 Jan 2017 16:54:39 +0000 (11:54 -0500)] 
Fix GSSAPI authind attribute name in docs

The correct attribute name is "auth-indicators".

(cherry picked from commit e3f666fe61e94e96d3c4d449e2fa8bd69cd2ecec)

ticket: 8532
version_fixed: 1.15.1

8 years agoUse pktinfo for explicit UDP wildcard listeners
Greg Hudson [Mon, 26 Dec 2016 20:18:05 +0000 (15:18 -0500)] 
Use pktinfo for explicit UDP wildcard listeners

In net-server.c, use pktinfo on UDP server sockets if they are bound
to wildcard addresses, whether that is explicit or implicit in the
address specification.

(cherry picked from commit d005beaa72c70bc28b2b0b49b9d83eff160ca8f1)

ticket: 8530
version_fixed: 1.15.1

8 years agoFix KDC/kadmind startup on some IPv4-only systems
Greg Hudson [Mon, 26 Dec 2016 20:09:24 +0000 (15:09 -0500)] 
Fix KDC/kadmind startup on some IPv4-only systems

getaddrinfo(NULL, ...) may yield an IPv6 wildcard address on IPv4-only
systems, and creating a socket for that address may result in an
EAFNOSUPPORT error.  Tolerate that error as long as we can bind at
least one socket for the address.

(cherry picked from commit 04c2bb56f5203b296b24314810eca02f5dc7e491)

ticket: 8531
version_fixed: 1.15.1

8 years agoFix error handling in PKINIT decode_data()
Greg Hudson [Wed, 14 Dec 2016 16:25:41 +0000 (11:25 -0500)] 
Fix error handling in PKINIT decode_data()

decode_data() mixes errno values with OpenSSL return codes.  Change
its return type to int, and return 1 on success or 0 on failure.

(cherry picked from commit cc9035a7d25008bdcd9c7beb01670aa57b51d829)

ticket: 8525
version_fixed: 1.15.1

8 years agoAdd caveats to krbtgt change documentation
Greg Hudson [Sun, 4 Dec 2016 23:34:41 +0000 (18:34 -0500)] 
Add caveats to krbtgt change documentation

In database.rst, describe a couple of krbtgt rollover issues and how
to avoid them.

(cherry picked from commit 56d05e87858b672591c1e6b7869cb08e8b1e0d59)

ticket: 8524
version_fixed: 1.15.1

8 years agoAdd krbPwdPolicy attributes to kerberos.ldif
Tomas Kuthan [Fri, 2 Dec 2016 14:22:54 +0000 (15:22 +0100)] 
Add krbPwdPolicy attributes to kerberos.ldif

When LDAP backend support for policy extensions was added by
5edafa0532 (ticket 7223), the kerberos.ldif change neglected to add
the new attributes to krbPwdPolicy.

(cherry picked from commit 823e3088d835661fd718a941f602bb2972db96c8)

ticket: 8523
version_fixed: 1.15.1

8 years agoAdd some omitted things to README
Tom Yu [Fri, 6 Jan 2017 20:25:14 +0000 (15:25 -0500)] 
Add some omitted things to README

[ci skip]

8 years agoUpdate for krb5-1.15-postrelease
Tom Yu [Fri, 2 Dec 2016 23:51:25 +0000 (18:51 -0500)] 
Update for krb5-1.15-postrelease

8 years agoUpdates for krb5-1.15 krb5-1.15-final
Tom Yu [Wed, 30 Nov 2016 23:39:32 +0000 (18:39 -0500)] 
Updates for krb5-1.15

8 years agoRelicense ccapi/common/win/OldCC/autolock.hxx
Greg Hudson [Tue, 29 Nov 2016 06:46:21 +0000 (01:46 -0500)] 
Relicense ccapi/common/win/OldCC/autolock.hxx

With permission from Danilo Almeida, change the license on
autolock.hxx to the 2-clause BSD license used by MIT krb5.

(cherry picked from commit 90bfe396781c3b2a427c95dd2e58a234027ff269)

ticket: 8520
version_fixed: 1.15

8 years agoAllow slapd path configuration in t_kdb.py
Greg Hudson [Sun, 27 Nov 2016 23:37:12 +0000 (18:37 -0500)] 
Allow slapd path configuration in t_kdb.py

The upstream OpenLDAP installs slapd in libexec, which is not
typically in the path.  Also, copying the binary can sometimes cause
it to fail; for instance, in the OpenCSW package,
/opt/csw/libexec/slapd is a script which chooses a binary based on the
system architecture and the path to the script.  Allow the test runner
to set the SLAPD environment variable to specify the slapd location
and avoid the copy.

(cherry picked from commit 9290e52b7f206dcbfd9dd5d873cf9379cb9de760)

ticket: 8521 (new)
tags: pullup
target_version: 1.15-next
target_version: 1.14-next
version_fixed: 1.15

8 years agoUpdate for krb5-1.15-beta2-postrelease
Tom Yu [Wed, 16 Nov 2016 18:44:56 +0000 (13:44 -0500)] 
Update for krb5-1.15-beta2-postrelease

8 years agoUpdate for krb5-1.15-beta2 krb5-1.15-beta2
Tom Yu [Tue, 15 Nov 2016 03:10:38 +0000 (22:10 -0500)] 
Update for krb5-1.15-beta2

8 years agomake update-po
Tom Yu [Mon, 14 Nov 2016 22:27:17 +0000 (17:27 -0500)] 
make update-po

8 years agoFix declaration without type in t_shs3.c
Robbie Harwood [Thu, 10 Nov 2016 17:57:19 +0000 (12:57 -0500)] 
Fix declaration without type in t_shs3.c

(cherry picked from commit 02f15f278112f7c03fb24044de169c071a786d71)

ticket: 8516
version_fixed: 1.15

8 years agoUse zap() more consistently
Greg Hudson [Mon, 31 Oct 2016 16:10:48 +0000 (12:10 -0400)] 
Use zap() more consistently

Use zap() or zapfree() in places where we previously used memset() to
scrub memory.  Reported by Zhaomo Yang and Brian Johannesmeyer.

(cherry picked from commit d58cfa06bab766cf1354bc593deea300388072c0)

ticket: 8514
version_fixed: 1.15

8 years agoMake zap() more reliable
Greg Hudson [Mon, 31 Oct 2016 15:48:54 +0000 (11:48 -0400)] 
Make zap() more reliable

The gcc assembly version of zap() could still be optimized out under
gcc 5.1 or later, and the krb5int_zap() function could be optimized
out with link-time optimization.  Based on work by Zhaomo Yang and
Brian Johannesmeyer, use the C11 memset_s() when available, then fall
back to a memory barrier with gcc or clang, and finally fall back to
using krb5int_zap().  Modify krb5int_zap() to use a volatile pointer
in case link-time optimization is used.

(cherry picked from commit c163275f899b201dc2807b3ff2949d5e2ee7d838)

ticket: 8514
version_fixed: 1.15

8 years agoFix detection of libaceclnt for securid_sam2
Greg Hudson [Fri, 28 Oct 2016 14:13:13 +0000 (10:13 -0400)] 
Fix detection of libaceclnt for securid_sam2

The symbol we need is SD_Init(), not sd_init().

(cherry picked from commit 081ee2f7d98b939bf7b4866845d4243b5ca3992c)

ticket: 8512
version_fixed: 1.15

8 years agoAdd doxygen comments for RFC 8009, RFC 4757
Greg Hudson [Fri, 28 Oct 2016 14:26:04 +0000 (10:26 -0400)] 
Add doxygen comments for RFC 8009, RFC 4757

The aes-sha2 specification has been published as RFC 8009.  Add
Doxygen comments to the #defines for its enctype and checksum type
comments.  Also add comments for the RC4 enctype and checksum type
constants referring to RFC 4757.

(cherry picked from commit bd895523179e7f639c40527ccd0af6d22cbbf364)

ticket: 8513
version_fixed: 1.15

8 years agoClarify krb5_kt_resolve() API documentation
Greg Hudson [Fri, 7 Oct 2016 15:23:02 +0000 (11:23 -0400)] 
Clarify krb5_kt_resolve() API documentation

Explicitly say to use krb5_kt_close() like we do for most other
allocating API calls.  Note the default type.  Instead of saying "The
key table is not opened," say that the keytab file for FILE keytabs is
not opened by this call.

(cherry picked from commit 5ab2dc42b3ae8e07f5cf7eb91b43e4f2ad338728)

ticket: 8508
version_fixed: 1.15

8 years agoSuggest unlocked iteration for mkey rollover
Greg Hudson [Thu, 6 Oct 2016 15:28:33 +0000 (11:28 -0400)] 
Suggest unlocked iteration for mkey rollover

In database.rst when discussing the procedure for master key rollover,
suggest using unlocked iteration for large databases.  Also make it
clear that unavailability due to locking during iteration is specific
to DB2.

(cherry picked from commit e71f4dcb5e4cc0e100caa75a8d2835dac2a6a32d)

ticket: 8507
version_fixed: 1.15

8 years agoUpdate features list for 1.15
Tom Yu [Mon, 24 Oct 2016 18:05:41 +0000 (14:05 -0400)] 
Update features list for 1.15

(cherry picked from commit 6872044bb52fdbbcbb965fe5dcb3e1da2755ae82)

ticket: 8510
version_fixed: 1.15

8 years agoFix rare leak in krb5_cccol_have_content()
Greg Hudson [Fri, 21 Oct 2016 06:06:18 +0000 (02:06 -0400)] 
Fix rare leak in krb5_cccol_have_content()

If krb5_cc_start_seq_get() fails inside the loop, close the current
credential cache before continuing to the next one.  Reported by Todd
Lipcon.

(cherry picked from commit 1735f2e74767e56ac3bd75de61d41b8363ec6ce4)

ticket: 8509
version_fixed: 1.15

8 years agoUpdate for krb5-1.15-beta1-postrelease
Tom Yu [Thu, 20 Oct 2016 19:49:26 +0000 (15:49 -0400)] 
Update for krb5-1.15-beta1-postrelease

8 years agoUpdates for krb5-1.15-beta1 krb5-1.15-beta1
Tom Yu [Wed, 19 Oct 2016 21:00:49 +0000 (17:00 -0400)] 
Updates for krb5-1.15-beta1

8 years agomake update-po
Tom Yu [Wed, 19 Oct 2016 20:53:05 +0000 (16:53 -0400)] 
make update-po

8 years agoUpdate man pages
Tom Yu [Wed, 19 Oct 2016 20:52:35 +0000 (16:52 -0400)] 
Update man pages

8 years agomake depend
Tom Yu [Wed, 19 Oct 2016 20:51:53 +0000 (16:51 -0400)] 
make depend

8 years agoUpdate README for krb5-1.15 556/head
Tom Yu [Mon, 17 Oct 2016 21:01:01 +0000 (17:01 -0400)] 
Update README for krb5-1.15

[ci skip]

8 years agoFix kadmind debug printf to show kprop port
Robbie Harwood [Thu, 6 Oct 2016 18:40:14 +0000 (14:40 -0400)] 
Fix kadmind debug printf to show kprop port

Previously, if kprop_port was set, the flags logged would not match the
actual invocation of kprop.

ticket: 8456

8 years agoError on discarded qualifiers in gcc 549/head
Greg Hudson [Tue, 4 Oct 2016 16:36:30 +0000 (12:36 -0400)] 
Error on discarded qualifiers in gcc

If a function call passes a const pointer to a function accepting the
same pointer type without the const qualifier, that should be treated
as an erorr if possible.  In sufficiently recent gcc, pass
-Werror=discarded-qualifiers.  (In clang, this is already covered by
-Werror=incompatible-pointer-types which we recently added.)

8 years agoImprove builtin PBKDF2 code hygiene 548/head
Greg Hudson [Tue, 4 Oct 2016 15:35:29 +0000 (11:35 -0400)] 
Improve builtin PBKDF2 code hygiene

In F() in the builtin implementation of PBKDF2, use make_data() to
fully initialize sdata and out; otherwise we (harmlessly) copy an
uninitialized magic field in hmac().  Also simplify out the local
variable tlen.

8 years agoSet alg param correctly for PKCS1 550/head
Tom Yu [Tue, 4 Oct 2016 22:14:51 +0000 (18:14 -0400)] 
Set alg param correctly for PKCS1

When using a smart card and constructing a DigestInfo to pass to the
CKM_RSA_PKCS mechanism, make sure to set the AlgorithmIdentifier
parameters correctly.  This is typically an ASN.1 NULL value.

Reported to Ubuntu in Launchpad #1629370.

ticket: 8506
target_version: 1.14-next
target_version: 1.13-next
tags: pullup

8 years agoDocument aes-sha2 enctypes
Greg Hudson [Thu, 10 Dec 2015 18:17:31 +0000 (13:17 -0500)] 
Document aes-sha2 enctypes

Add minimal documentation for the new aes-sha2 enctypes.

ticket: 8490

8 years agoAdd aes-sha2 to permitted_enctypes and aes family
Greg Hudson [Tue, 8 Dec 2015 18:50:06 +0000 (13:50 -0500)] 
Add aes-sha2 to permitted_enctypes and aes family

Add the new aes-sha2 enctypes to the default value of
permitted_enctype, and to the enctypes implied by the "aes" family
when parsing enctype lists.

ticket: 8490

8 years agoAdd aes-sha2 test cases
Greg Hudson [Tue, 8 Dec 2015 04:32:18 +0000 (23:32 -0500)] 
Add aes-sha2 test cases

Add test cases for all of the test vectors in the aes-sha2 draft.  In
t_cksums.c and t_decrypt.c, modify the test structure to allow for
binary plaintexts.  In t_str2key.c, modify the test structure to allow
for binary salts.  In t_derive.c, allow tests to have outputs which
don't match the key size, using krb5int_derive_random() instead of
krb5int_derive_key().

Add test cases for KRB-FX-CF2 and for gss_pseudo_random() using test
vectors generated ourselves.

Add k5test and dejagnu test passes for aes-sha2 enctypes.

ticket: 8490

8 years agoRewrite t_prf crypto test program
Greg Hudson [Tue, 8 Dec 2015 03:16:24 +0000 (22:16 -0500)] 
Rewrite t_prf crypto test program

Rewrite the pseudo-random test program to use hardcoded test cases
instead of input and expected output files.  The test cases are the
same, using hardcoded keys instead of running string-to-key over
"key1" or "key2".

8 years agoAdd aes128-sha1, aes256-sha1 enctype aliases
Greg Hudson [Fri, 23 Sep 2016 19:11:43 +0000 (15:11 -0400)] 
Add aes128-sha1, aes256-sha1 enctype aliases

For parallelism with aes128-sha2 and aes256-sha2, add enctype aliases
aes128-sha1 and aes256-sha1 for the older AES enctypes.

ticket: 8490

8 years agoAdd aes-sha2 enctype support
Greg Hudson [Sun, 6 Dec 2015 00:36:57 +0000 (19:36 -0500)] 
Add aes-sha2 enctype support

Add support to libk5crypto for the aes128-cts-hmac-sha256-128 and
aes256-cts-hmac-sha384-192 encryption types, and the
hmac-sha256-128-aes128 and hmac-sha384-192-aes256 checksum types.

Key derivation for the new encryption types uses a hash, so we need to
add a hash parameter to the krb5int_derive_ functions, which can be
null except when DERIVE_SP800_108_HMAC is given.  Rename the helper
function derive_random_sp800_108_cmac() to
derive_random_sp800_108_feedback_cmac() to make it clear that feedback
mode is used, since the new enctype uses counter mode.

ticket: 8490

8 years agoEnable PBKDF2 with SHA-256 and SHA-384
Greg Hudson [Mon, 7 Dec 2015 16:16:06 +0000 (11:16 -0500)] 
Enable PBKDF2 with SHA-256 and SHA-384

Rename krb5int_pbkdf2_hmac_sha1() to krb5int_pbkdf2_hmac() and add a
hash parameter.  In the OpenSSL implementation, look up the
corresponding PBKDF2 parameter based on the hash pointer.  In
pbkdf2_string_to_key(), pass the hash function for the key type if one
is present, and use SHA-1 if it does not (as for the Camellia
enctypes).

In the builtin implementation, use the hash provider instead of
assuming SHA-1.  Remove the functional parameterization of the PRF and
turn it into an hmac() helper function.  Use krb5int_hmac_keyblock()
to remove the need for a krb5_key object containing the password.
Rename the internal function from krb5int_pbkdf2() to pbkdf2().

ticket: 8490

8 years agoAdd libk5crypto SHA-256 and SHA-384 hash providers
Greg Hudson [Sun, 6 Dec 2015 00:36:41 +0000 (19:36 -0500)] 
Add libk5crypto SHA-256 and SHA-384 hash providers

Add SHA-256 and SHA-384 hash providers to each of the libk5crypto back
ends, in preparation for AES-SHA2 support.  For the builtin back end,
adapt SHA-512 code from Heimdal (SHA-384 is just truncated SHA-512
with different initial values).  Replace builtin/sha2/t_sha256.c with
a program under crypto_tests which tests SHA-256 and SHA-384 in all
back ends.

ticket: 8490

8 years agoConsolidate libk5crypto OpenSSL hash providers
Greg Hudson [Sat, 5 Dec 2015 22:20:26 +0000 (17:20 -0500)] 
Consolidate libk5crypto OpenSSL hash providers

In the libk5crypto OpenSSL back end, combine all of the hash providers
which use the OpenSSL EVP interface into a single file to reduce code
duplication.

8 years agoProperly handle EOF condition on libkrad sockets 547/head
Nathaniel McCallum [Fri, 30 Sep 2016 14:03:33 +0000 (10:03 -0400)] 
Properly handle EOF condition on libkrad sockets

In the previous code, when the remote peer performed an orderly shutdown
on the socket, libkrad would enter a state in which all future requests
timed out.  Instead, if the peer shuts down its socket, we need to
attempt to reopen it.

ticket: 8504 (new)
target_version: 1.14-next
tags: pullup

8 years agoFix use_dns_uri() type safety 546/head
Greg Hudson [Thu, 29 Sep 2016 19:41:04 +0000 (15:41 -0400)] 
Fix use_dns_uri() type safety

profile_get_boolean() outputs an int, not a krb5_boolean.  Adjust the
local variable "use" to match, or we get a warning.  Reported by Will
Fiveash.

ticket: 8502

8 years agoClarify kinit principal selection 544/head
Tom Yu [Wed, 28 Sep 2016 16:33:52 +0000 (12:33 -0400)] 
Clarify kinit principal selection

Describe the principal selection behavior of kinit when the principal
argument is absent.

ticket: 8403
target_version: 1.14-next
tags: pullup

8 years agoFix typo in install_kdc.rst
Greg Hudson [Mon, 26 Sep 2016 22:01:12 +0000 (18:01 -0400)] 
Fix typo in install_kdc.rst

ticket: 8500

8 years agoImprove keytab documentation
Ben Kaduk [Mon, 26 Jan 2015 16:15:42 +0000 (11:15 -0500)] 
Improve keytab documentation

In the k5srvutil man page, do not give the impression that arbitrary
new keys can be added to the keytab (requested by Dan Gillmor), since
only the new keys randomly generated by the KDC via 'k5srvutil change'
can be added to the keytab.  Reiterate the importance of running
k5srvutil delold after running k5srvutil change in the description of
k5srvutil change, as well as in the description of k5srvutil delold
itself.

In install_kdc.rst, mention using a separate keytab file when
generating a keytab on a KDC for use on another host.

[ghudson@mit.edu: squashed two commits, condensed commit message]

ticket: 8500

8 years agoDocument krb5_kt_next_entry() requirement
Ben Kaduk [Wed, 11 Jun 2014 20:38:57 +0000 (16:38 -0400)] 
Document krb5_kt_next_entry() requirement

Successful calls to krb5_kt_next_entry() return a krb5_keytab_entry
that the caller is responsible for freeing.  Note this, and the
proper function to do so, in the doxygen comments.

ticket: 8500 (new)
target_version: 1.14-next
tags: pullup

8 years agoFix unlikely leak in KDC AS-REQ error path 542/head
Greg Hudson [Thu, 22 Sep 2016 06:21:39 +0000 (02:21 -0400)] 
Fix unlikely leak in KDC AS-REQ error path

In prepare_error_as(), if krb5_us_timeofday() fails and error pa-data
was supplied, the FAST cookie and a shallow copy of the error padata
can be leaked.  Reported by Will Fiveash.

ticket: 8498
target_version: 1.14-next
tags: pullup

8 years agoAdd the kdc_tcp_listen_backlog KDC option
Matt Rogers [Wed, 14 Sep 2016 18:01:10 +0000 (14:01 -0400)] 
Add the kdc_tcp_listen_backlog KDC option

Allow setting the listen() queue for TCP connections to krb5kdc.

8 years agoFix typo in prng.c comment
Greg Hudson [Fri, 23 Sep 2016 03:11:34 +0000 (23:11 -0400)] 
Fix typo in prng.c comment

(The typo was mine, introduced during a final editing pass.)

8 years agoAdd PKINIT support for OpenSSL 1.1.0 447/head
Greg Hudson [Tue, 3 May 2016 17:22:46 +0000 (13:22 -0400)] 
Add PKINIT support for OpenSSL 1.1.0

OpenSSL 1.1 makes the DH, EVP_MD_CTX, X509, and X509_STORE_CTX types
opaque, removes asn1_mac.h, removes the M_ASN1_* macros, and removes
CRYPTO_malloc_init().  Change the PKINIT code to work with OpenSSL 1.1
while retaining compatibility with OpenSSL 1.0.  The new code uses
X509_STORE_set_verify_cb(), which is not present in OpenSSL 0.9, so
require OpenSSL 1.0 for PKINIT support.

ticket: 8398

8 years agoAdd k5tls support for OpenSSL 1.1.0
Greg Hudson [Tue, 3 May 2016 17:14:48 +0000 (13:14 -0400)] 
Add k5tls support for OpenSSL 1.1.0

OpenSSL 1.1 makes the X509 type opaque and removes the M_ASN1_*
macros.  Adjust the k5tls OpenSSL implementation accordingly.

ticket: 8398

8 years agoAdd libk5crypto support for OpenSSL 1.1.0
Greg Hudson [Fri, 17 Jun 2016 16:00:21 +0000 (12:00 -0400)] 
Add libk5crypto support for OpenSSL 1.1.0

OpenSSL 1.1.0 makes the EVP_MD_CTX, EVP_CIPH_CTX, and EVP_HMAC_CTX
types opaque.  Change the libk5crypto OpenSSL code to work with
OpenSSL 1.1 while retaining compatibility with previous versions.

ticket: 8398 (new)

8 years agoAdd OS prng intended for use with getrandom()
Robbie Harwood [Wed, 14 Sep 2016 20:12:57 +0000 (16:12 -0400)] 
Add OS prng intended for use with getrandom()

Add the prng_os.c module, using the name previously occupied by what
is now prng_device.c.  Unlike prng_device.c, this PRNG module
maintains no file descriptor and just uses k5_os_random(), which is
most efficient on platforms which have a getrandom() system call.

[ghudson@mit.edu: expanded on commit message]

ticket: 8499

8 years agoAdd getrandom to k5_get_os_entropy() using syscall
Robbie Harwood [Wed, 14 Sep 2016 20:10:34 +0000 (16:10 -0400)] 
Add getrandom to k5_get_os_entropy() using syscall

ticket: 8499

8 years agoRename prng_os.c to prng_device.c
Robbie Harwood [Wed, 14 Sep 2016 16:53:10 +0000 (12:53 -0400)] 
Rename prng_os.c to prng_device.c

ticket: 8499

8 years agoDon't feed OS RNG output into the OS RNG
Robbie Harwood [Mon, 12 Sep 2016 16:25:05 +0000 (12:25 -0400)] 
Don't feed OS RNG output into the OS RNG

krb5_c_random_os_entropy() now must be provided by PRNG modules.

ticket: 8499

8 years agoAdd KDC lookaside cache tests
Sarah Day [Fri, 19 Aug 2016 17:50:54 +0000 (13:50 -0400)] 
Add KDC lookaside cache tests

Add cmocka unit tests for the KDC lookaside cache.

8 years agoFix KDC lookaside cache entry count tracking
Sarah Day [Fri, 19 Aug 2016 17:47:22 +0000 (13:47 -0400)] 
Fix KDC lookaside cache entry count tracking

The KDC lookaside cache was incrementing num_entries when an entry was
added, but it did not decrement num_entries when an entry was removed.
Decrement num_entries in discard_entry().  Also fix some function
comments to correctly explain what the function is doing, and refactor
kdc_insert_lookaside by moving the code that inserts an entry into a
new static function called insert_entry().

8 years agoSilence warnings in lib/rpc 541/head
Tom Yu [Tue, 20 Sep 2016 19:58:50 +0000 (15:58 -0400)] 
Silence warnings in lib/rpc

Cast through (void *) in xdr.c to silence pointer target width
warnings.  In xdr_sizeof.c, use x_private and x_base as proper
pointers as in xdr_mem.c instead of trying to store an integer in a
pointer.

8 years agoAdd URI lookup testing with resolv_wrapper
Matt Rogers [Mon, 22 Aug 2016 19:34:52 +0000 (15:34 -0400)] 
Add URI lookup testing with resolv_wrapper

Run t_discover_uri.py during make check when resolv_wrapper is
available.  Remove tabs from the t_locate_kdc output for simpler line
matching.

ticket: 8496

8 years agoAdd documentation for DNS URI lookups
Matt Rogers [Wed, 24 Aug 2016 00:03:22 +0000 (20:03 -0400)] 
Add documentation for DNS URI lookups

ticket: 8496

8 years agoAdd configuration option for URI lookups
Matt Rogers [Wed, 24 Aug 2016 04:42:16 +0000 (00:42 -0400)] 
Add configuration option for URI lookups

Add the boolean option 'dns_uri_lookup' to krb5.conf's libdefaults
section, to allow disabling URI lookups seperately from SRV lookups.
The default value is 'true'.

ticket: 8496

8 years agoStyle fixes for locate_kdc.c and dnssrv.c
Matt Rogers [Fri, 12 Aug 2016 21:13:01 +0000 (17:13 -0400)] 
Style fixes for locate_kdc.c and dnssrv.c

8 years agoConstify function parameters in locate_kdc.c
Matt Rogers [Fri, 12 Aug 2016 19:40:23 +0000 (15:40 -0400)] 
Constify function parameters in locate_kdc.c

Constify parse_uri_if_https() and add_host_to_list() char parameters
as well as the variables passed by their callers.

8 years agoEnable KDC discovery through DNS URI records
Matt Rogers [Mon, 18 Jul 2016 16:13:55 +0000 (12:13 -0400)] 
Enable KDC discovery through DNS URI records

Add the dns_locate_server_uri(), locate_uri(), and parse_uri_fields()
functions to find and process KDC service information from specially
formatted URI records detailed at
http://k5wiki.kerberos.org/wiki/Projects/KDC_Discovery

Search for URI records before searching for SRV records.  Rename
dns_locate_server() to dns_locate_server_srv() for consistency.  Add
URI-specific information to the t_locate_kdc host entry output.

ticket: 8496

8 years agoAdd DNS URI query function
Matt Rogers [Mon, 18 Jul 2016 14:18:45 +0000 (10:18 -0400)] 
Add DNS URI query function

Add the k5_make_uri_query() function for finding URI records of a
given realm and service tag.  Turn some common code shared with
krb5int_make_srv_query_realm() into helper functions.

ticket: 8496

8 years agoAdd a master flag to struct server_entry
Matt Rogers [Wed, 13 Jul 2016 20:27:57 +0000 (16:27 -0400)] 
Add a master flag to struct server_entry

URI lookups will contain a flag to indicate if the KDC is a master or
normal KDC, so add a master variable to server_entry.  The default
value is -1 and means that the status has not been determined by the
information source.  If the flag is set, use it to avoid a seperate
lookup in k5_kdc_is_master().

Also add a "master" argument to add_host_to_list().  Adjust the
existing calls of add_host_to_list() for the new argument (set to -1
as they are from non-URI lookups).

ticket: 8496

8 years agoRemove more non-DFSG documentation 540/head
Tom Yu [Fri, 16 Sep 2016 23:02:45 +0000 (19:02 -0400)] 
Remove more non-DFSG documentation

Delete an Internet-Draft that we missed on an earlier pass.  Also
remove ISOC/BCP 78 copyright language because the remaining extracts
from RFCs are small enough to be fair use.

ticket: 8497 (new)

8 years agoStop generating doc/CHANGES 530/head
Tom Yu [Wed, 31 Aug 2016 17:40:22 +0000 (13:40 -0400)] 
Stop generating doc/CHANGES

Shipping a 10MB+ doc/CHANGES file in the release tarball doesn't make
much sense in a modern context where historical information is readily
available in a distributed version control system.

ticket: 8488 (new)

8 years agoUpdate config.guess, config.sub 531/head
Tom Yu [Wed, 31 Aug 2016 22:58:09 +0000 (18:58 -0400)] 
Update config.guess, config.sub

ticket: 8489 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup

8 years agoClean up libdb2 warnings 526/head
Tom Yu [Wed, 24 Aug 2016 23:49:11 +0000 (19:49 -0400)] 
Clean up libdb2 warnings

Clean up many pointer alignment warnings by casting through (void *).

Clean up many signed-unsigned comparison warnings by casting to
unsigned types or redeclaring variables as unsigned types as
appropriate.

8 years agoTest bt_split.c unaligned access 537/head
Tom Yu [Wed, 7 Sep 2016 22:20:56 +0000 (18:20 -0400)] 
Test bt_split.c unaligned access

ticket: 8493

8 years agoFix unaligned accesses in bt_split.c
Tom Yu [Wed, 7 Sep 2016 21:28:34 +0000 (17:28 -0400)] 
Fix unaligned accesses in bt_split.c

In the libdb2 btree back end, splitting a page at an overflow key
could result in an unaligned access, causing a crash (and data
corruption) on platforms with strict alignment.  This probably occurs
only rarely in practice.

ticket: 8493 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup

8 years agoFix bt_debug.c unaligned accesses and formats
Tom Yu [Wed, 7 Sep 2016 21:21:55 +0000 (17:21 -0400)] 
Fix bt_debug.c unaligned accesses and formats

Use memcpy to fix some unaligned accesses in bt_debug.c.  Also fix
some argument width issues with fprintf.  Clean up warnings.

ticket: 8478

8 years agoUse krb5_db_register_keytab() in kinit, kadmind
Andreas Schneider [Wed, 7 Sep 2016 16:40:58 +0000 (18:40 +0200)] 
Use krb5_db_register_keytab() in kinit, kadmind

8 years agoAdd krb5_db_register_keytab()
Andreas Schneider [Wed, 7 Sep 2016 16:33:43 +0000 (18:33 +0200)] 
Add krb5_db_register_keytab()

Add a public libkdb5 function to register the KDB keytab type.  This
functionality is needed for out-of-tree KDC servers such as the Samba
kpasswd service.

[ghudson@mit.edu: edited comments, whitespace, commit message]

ticket: 8494 (new)

8 years agoFix build with -O3 on ppc64el 511/head
Ben Kaduk [Thu, 11 Aug 2016 04:25:47 +0000 (23:25 -0500)] 
Fix build with -O3 on ppc64el

Ubuntu runs ppc64el builds with -O3, which elicited a few warnings
from gcc that were not generated elsewhere, as documented at
https://bugs.launchpad.net/ubuntu/+source/krb5/+bug/1592841 .

Initialize the output variable at the top of a couple of helper functions
to silence the uninitialized-variable warnings.

ticket: 8475 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup