commit f366db0fcb5e66d6710d5582d6670c438961414d
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Sun Mar 28 22:47:01 2010 +0000
README and patchlevel for krb5-1.8.1-beta1
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23839 dc483132-0cff-0310-8789-dd5450dbe970
README | 30 ++++++++++++++++++++++++++++++
src/patchlevel.h | 6 +++---
2 files changed, 33 insertions(+), 3 deletions(-)
---
diff --git a/README b/README
index 8063109..95cc02b 100644
--- a/README
+++ b/README
@@ -82,6 +82,36 @@ additional measures include:
crypto
* easier kadmin history key changes
+Major changes in 1.8.1
+----------------------
+
+This is primarily a bugfix release.
+
+* MITKRB5-SA-2010-002 CVE-2010-0628 denial of service in SPNEGO
+
+* Support IPv6 in kpasswd client.
+
+* Fix an authorization data type number assignment that conflicted
+ with an undocumented Microsoft usage.
+
+krb5-1.8.1 changes by ticket ID
+-------------------------------
+
+6661 [RFE] properly support IPv6 in kpasswd
+6668 Two problems in kadm5_get_principal mask handling
+6674 memory leak in SPNEGO
+6676 Ignore improperly encoded signedpath AD elements
+6678 use of freed memory in gss_import_sec_context error path
+6680 the "ticket_lifetime" setting isn't documented
+6681 krb5_get_init_creds_password() can crash with NULL options and
+ expired keys
+6683 kpasswd doesn't guess the client principal name correctly
+ without a ccache
+6685 handle NT_SRV_INST in service principal referrals
+6687 Change KRB5_AUTHDATA_SIGNTICKET from 142 to 512
+6689 krb5_typed_data not castable to krb5_pa_data on 64-bit MacOSX
+6690 MITKRB5-SA-2010-002 CVE-2010-0628 denial of service in SPNEGO
+
Major changes in 1.8
--------------------
diff --git a/src/patchlevel.h b/src/patchlevel.h
index aadebb9..99f2abe 100644
--- a/src/patchlevel.h
+++ b/src/patchlevel.h
@@ -52,7 +52,7 @@
*/
#define KRB5_MAJOR_RELEASE 1
#define KRB5_MINOR_RELEASE 8
-#define KRB5_PATCHLEVEL 0
-#define KRB5_RELTAIL "postrelease"
+#define KRB5_PATCHLEVEL 1
+#define KRB5_RELTAIL "beta1"
/* #undef KRB5_RELDATE */
-#define KRB5_RELTAG "branches/krb5-1-8"
+#define KRB5_RELTAG "tags/krb5-1-8-1-beta1"
commit 62ec2dfcd29db5b1180bce0cbbaa71e23d0bcbb0
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Tue Mar 23 07:21:04 2010 +0000
ticket: 6689
version_fixed: 1.8.1
status: resolved
pull up r23829 from trunk
------------------------------------------------------------------------
r23829 | tlyu | 2010-03-22 23:09:02 -0700 (Mon, 22 Mar 2010) | 10 lines
ticket: 6689
target_version: 1.8.1
tags: pullup
subject: krb5_typed_data not castable to krb5_pa_data on 64-bit MacOSX
Move krb5_typed_data to krb5.hin from k5-int-pkinit.h because
krb5int_fast_process_error was assuming that it was safe to cast it to
krb5_pa_data. It's not safe to do the cast on 64-bit MacOSX because
krb5.hin uses #pragma pack on that platform.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23830 dc483132-0cff-0310-8789-dd5450dbe970
src/include/k5-int-pkinit.h | 11 -----------
src/include/krb5/krb5.hin | 13 +++++++++++++
2 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/src/include/k5-int-pkinit.h b/src/include/k5-int-pkinit.h
index 8dcbd5d..0c5ab0e 100644
--- a/src/include/k5-int-pkinit.h
+++ b/src/include/k5-int-pkinit.h
@@ -101,17 +101,6 @@ typedef struct _krb5_trusted_ca {
} u;
} krb5_trusted_ca;
-/* typed data */
-/* The FAST error handling logic currently assumes that this structure and krb5_pa_data * can be safely cast to each other
- * if this structure changes, that code needs to be updated to copy.
- */
-typedef struct _krb5_typed_data {
- krb5_magic magic;
- krb5_int32 type;
- unsigned int length;
- krb5_octet *data;
-} krb5_typed_data;
-
/* PA-PK-AS-REQ (Draft 9 -- PA TYPE 14) */
typedef struct _krb5_pa_pk_as_req_draft9 {
krb5_octet_data signedAuthPack;
diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin
index 875d14a..d9f3ba8 100644
--- a/src/include/krb5/krb5.hin
+++ b/src/include/krb5/krb5.hin
@@ -1184,6 +1184,19 @@ typedef struct _krb5_pa_data {
krb5_octet *contents;
} krb5_pa_data;
+/* typed data */
+/*
+ * The FAST error handling logic currently assumes that this structure and
+ * krb5_pa_data * can be safely cast to each other if this structure changes,
+ * that code needs to be updated to copy.
+ */
+typedef struct _krb5_typed_data {
+ krb5_magic magic;
+ krb5_int32 type;
+ unsigned int length;
+ krb5_octet *data;
+} krb5_typed_data;
+
typedef struct _krb5_kdc_req {
krb5_magic magic;
krb5_msgtype msg_type; /* AS_REQ or TGS_REQ? */
commit 1ac3f3b36515b7f0ea50585cb5d661f76cea2e15
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Tue Mar 23 01:58:29 2010 +0000
ticket: 6687
version_fixed: 1.8.1
pull up r23821 from trunk
------------------------------------------------------------------------
r23821 | ghudson | 2010-03-19 20:50:06 -0700 (Fri, 19 Mar 2010) | 17 lines
ticket: 6687
subject: Change KRB5_AUTHDATA_SIGNTICKET from 142 to 512
target_version: 1.8.1
tags: pullup
KRB5_AUTHDATA_SIGNTICKET, originally a Heimdal authorization data
type, was used to implement PAC-less constrained delegation in krb5
1.8. Unfortunately, it was found that Microsoft was using 142 for
other purposes, which could result in a ticket issued by an MIT or
Heimdal KDC being rejected by a Windows Server 2008 R2 application
server. Because KRB5_AUTHDATA_SIGNTICKET is only used to communicate
among a realm's KDCs, it is relatively easy to change the number, so
MIT and Heimdal are both migrating to a new number. This change will
cause a transitional interoperability issue when a realm mixes MIT
krb5 1.8 (or Heimdal 1.3.1) KDCs with MIT krb5 1.8.1 (or Heimdal
1.3.2) KDCs, but only for constrained delegation evidence tickets.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23828 dc483132-0cff-0310-8789-dd5450dbe970
src/include/krb5/krb5.hin | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin
index 63b6971..875d14a 100644
--- a/src/include/krb5/krb5.hin
+++ b/src/include/krb5/krb5.hin
@@ -1066,7 +1066,7 @@ krb5_verify_checksum(krb5_context context, krb5_cksumtype ctype,
#define KRB5_AUTHDATA_SESAME 65
#define KRB5_AUTHDATA_WIN2K_PAC 128
#define KRB5_AUTHDATA_ETYPE_NEGOTIATION 129 /* RFC 4537 */
-#define KRB5_AUTHDATA_SIGNTICKET 142
+#define KRB5_AUTHDATA_SIGNTICKET 512 /* formerly 142 in krb5 1.8 */
#define KRB5_AUTHDATA_FX_ARMOR 71
/* password change constants */
commit a7c94a2d49da51e0325089219c9d72366e113b12
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Tue Mar 23 01:58:22 2010 +0000
ticket: 6680
version_fixed: 1.8.1
status: resolved
pull up r23820 from trunk
------------------------------------------------------------------------
r23820 | ghudson | 2010-03-19 09:17:05 -0700 (Fri, 19 Mar 2010) | 7 lines
ticket: 6680
target_version: 1.8.1
tags: pullup
Document the ticket_lifetime libdefaults setting (which was added in
r16656, #2656). Based on a patch from nalin(a)redhat.com.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23827 dc483132-0cff-0310-8789-dd5450dbe970
doc/admin.texinfo | 12 +++++-------
src/config-files/krb5.conf.M | 4 ++++
2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/doc/admin.texinfo b/doc/admin.texinfo
index 5e80af3..1ec4685 100644
--- a/doc/admin.texinfo
+++ b/doc/admin.texinfo
@@ -516,13 +516,6 @@ DCE do not support the default cache as created by this version of
Kerberos. Use a value of 1 on DCE 1.0.3a systems, and a value of 2 on
DCE 1.1 systems. The default value is @value{DefaultCcacheType}.
-@ignore
-@itemx tkt_lifetime
-The default lifetime of a ticket. The default is
-@value{DefaultTktLifetime}. This is currently not supported by the
-code.
-@end ignore
-
@itemx dns_lookup_kdc
Indicate whether DNS SRV records should be used to locate the KDCs and
other servers for a realm, if they are not listed in the information for
@@ -583,6 +576,11 @@ If this flag is set, then an attempt to get initial credentials will
fail if the client machine does not have a keytab. The default for the
flag is @value{DefaultVerifyApReqNofail}.
+@itemx ticket_lifetime
+The value of this tag is the default lifetime for
+initial tickets. The default value for the tag is
+@value{DefaultTktLifetime}.
+
@itemx renew_lifetime
The value of this tag is the default renewable lifetime for
initial tickets. The default value for the tag is
diff --git a/src/config-files/krb5.conf.M b/src/config-files/krb5.conf.M
index 9778e81..412156b 100644
--- a/src/config-files/krb5.conf.M
+++ b/src/config-files/krb5.conf.M
@@ -220,6 +220,10 @@ If this flag is set, then an attempt to get initial credentials will
fail if the client machine does not have a keytab. The default for the
flag is false.
+.IP ticket_lifetime
+The value of this tag is the default lifetime for initial tickets. The
+default value for the tag is 1 day (1d).
+
.IP renew_lifetime
The value of this tag is the default renewable lifetime for initial
tickets. The default value for the tag is 0.
commit 26ef9e92afc87efffb643024a39ecfcbd20bd28e
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Tue Mar 23 01:58:07 2010 +0000
ticket: 6681
version_fixed: 1.8.1
status: resolved
pull up r23815 from trunk
------------------------------------------------------------------------
r23815 | ghudson | 2010-03-17 14:10:10 -0700 (Wed, 17 Mar 2010) | 7 lines
ticket: 6681
target_version: 1.8.1
tags: pullup
When checking for KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT, don't
dereference options if it's NULL.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23825 dc483132-0cff-0310-8789-dd5450dbe970
src/lib/krb5/krb/gic_pwd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/lib/krb5/krb/gic_pwd.c b/src/lib/krb5/krb/gic_pwd.c
index cadd7ad..7b43727 100644
--- a/src/lib/krb5/krb/gic_pwd.c
+++ b/src/lib/krb5/krb/gic_pwd.c
@@ -218,7 +218,7 @@ krb5_get_init_creds_password(krb5_context context,
* to prompt. Prompting is only disabled if the option has been set
* and the value has been set to false.
*/
- if (!(options->flags & KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT))
+ if (options && !(options->flags & KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT))
goto cleanup;
/* ok, we have an expired password. Give the user a few chances
commit a602ced730c88d6b4c0459c9712302fce2a4990c
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Mon Mar 15 23:50:52 2010 +0000
ticket: 6676
version_fixed: 1.8.1
status: resolved
pull up r23766 from trunk
------------------------------------------------------------------------
r23766 | ghudson | 2010-03-05 12:45:46 -0500 (Fri, 05 Mar 2010) | 10 lines
ticket: 6676
subject: Ignore improperly encoded signedpath AD elements
target_version: 1.8.1
tags: pullup
We have some reason to believe Microsoft and Heimdal are both using
the authdata value 142 for different purposes, leading to failures in
verify_ad_signedpath(). For better interoperability, treat such
tickets as unsigned, rather than invalid.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23809 dc483132-0cff-0310-8789-dd5450dbe970
src/kdc/kdc_authdata.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/kdc/kdc_authdata.c b/src/kdc/kdc_authdata.c
index 5097558..b5de64d 100644
--- a/src/kdc/kdc_authdata.c
+++ b/src/kdc/kdc_authdata.c
@@ -934,8 +934,12 @@ verify_ad_signedpath(krb5_context context,
enc_sp.length = sp_authdata[0]->length;
code = decode_krb5_ad_signedpath(&enc_sp, &sp);
- if (code != 0)
+ if (code != 0) {
+ /* Treat an invalid signedpath authdata element as a missing one, since
+ * we believe MS is using the same number for something else. */
+ code = 0;
goto cleanup;
+ }
code = verify_ad_signedpath_checksum(context,
krbtgt,
commit 0c1ad197fd4a5e4ea06d4d57ddce7dca9e0a84f7
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Tue Mar 2 18:13:43 2010 +0000
README and patchlevel.h for krb5-1.8 final
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23760 dc483132-0cff-0310-8789-dd5450dbe970
README | 8 +++++++-
src/patchlevel.h | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/README b/README
index 1135b8f..8063109 100644
--- a/README
+++ b/README
@@ -74,7 +74,13 @@ krb5-1.7 release contains measures to encourage sites to migrate away
from using single-DES cryptosystems. Among these is a configuration
variable that enables "weak" enctypes, which now defaults to "false"
beginning with krb5-1.8. The krb5-1.8 release includes additional
-measures to ease the transition away from single-DES.
+measures to ease the transition away from single-DES. These
+additional measures include:
+
+* enctype config enhancements (so you can do "DEFAULT +des", etc.)
+* new API to allow applications (e.g. AFS) to explicitly reenable weak
+ crypto
+* easier kadmin history key changes
Major changes in 1.8
--------------------
diff --git a/src/patchlevel.h b/src/patchlevel.h
index c151756..2a5126f 100644
--- a/src/patchlevel.h
+++ b/src/patchlevel.h
@@ -53,6 +53,6 @@
#define KRB5_MAJOR_RELEASE 1
#define KRB5_MINOR_RELEASE 8
#define KRB5_PATCHLEVEL 0
-#define KRB5_RELTAIL "beta2-postrelease"
+/* #undef KRB5_RELTAIL */
/* #undef KRB5_RELDATE */
-#define KRB5_RELTAG "branches/krb5-1-8"
+#define KRB5_RELTAG "tags/krb5-1-8-final"
commit b34189eb4d7899db3a17b402e09636ad135d2cf3
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Thu Feb 25 21:28:22 2010 +0000
README and patchlevel.h for krb5-1.8-beta2
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23754 dc483132-0cff-0310-8789-dd5450dbe970
README | 15 +++++++++++++--
src/patchlevel.h | 4 ++--
2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/README b/README
index 26e516b..1135b8f 100644
--- a/README
+++ b/README
@@ -64,6 +64,11 @@ and logging in as "guest" with password "guest".
DES transition
--------------
+The krb5-1.8 release disables single-DES cryptosystems by default. As
+a result, you may need to add the libdefaults setting
+"allow_weak_crypto = true" to communicate with existing Kerberos
+infrastructures if they do not support stronger ciphers.
+
The Data Encryption Standard (DES) is widely recognized as weak. The
krb5-1.7 release contains measures to encourage sites to migrate away
from using single-DES cryptosystems. Among these is a configuration
@@ -192,6 +197,7 @@ krb5-1.8 changes by ticket ID
6599 memory leak in krb5_rd_req_decrypt_tkt_part
6600 gss_inquire_context cannot handle no target name from mechanism
6601 gsssspi_set_cred_option cannot handle mech specific option
+6603 issues with SPNEGO
6605 PKINIT client should validate SAN for TGS, not service principal
6606 allow testing when offline
6607 anonymous PKINIT
@@ -202,7 +208,8 @@ krb5-1.8 changes by ticket ID
6622 kinit_fast fails if weak enctype is among client principal keys
6623 Always treat anonymous as preauth required
6624 automated tests for anonymous pkinit
-6625 yarrow code does not initialize keyblock enctype and uses unitialized value
+6625 yarrow code does not initialize keyblock enctype and uses
+ unitialized value
6626 Restore interoperability with 1.6 addprinc -randkey
6627 Set enctype in crypto_tests to prevent memory leaks
6628 krb5int_dk_string_to_key fails to set enctype
@@ -217,7 +224,8 @@ krb5-1.8 changes by ticket ID
6645 Add krb5_allow_weak_crypto API
6648 define MIN() in lib/gssapi/krb5/prf.c
6649 Get rid of kdb_ext.h and allow out-of-tree KDB plugins
-6651 Handle migration from pre-1.7 databases with master key kvno != 1 (1.8 pullup)
+6651 Handle migration from pre-1.7 databases with master key
+ kvno != 1 (1.8 pullup)
6652 Make decryption of master key list more robust
6653 set_default_enctype_var should filter not reject weak enctypes
6654 Fix greet_server build
@@ -225,9 +233,12 @@ krb5-1.8 changes by ticket ID
6656 krb5int_fast_free_state segfaults if state is null
6657 enc_padata can include empty sequence
6658 Implement gss_set_neg_mechs
+6659 Additional memory leaks in kdc
6660 Minimal support for updating history key
6662 MITKRB5-SA-2010-001 CVE-2010-0283 KDC denial of service
6663 update mkrel to deal with changed source layout
+6665 Fix cipher state chaining in OpenSSL back end
+6669 doc updates for allow_weak_crypto
Acknowledgements
----------------
diff --git a/src/patchlevel.h b/src/patchlevel.h
index 7b8dc9f..1dd918e 100644
--- a/src/patchlevel.h
+++ b/src/patchlevel.h
@@ -53,6 +53,6 @@
#define KRB5_MAJOR_RELEASE 1
#define KRB5_MINOR_RELEASE 8
#define KRB5_PATCHLEVEL 0
-#define KRB5_RELTAIL "beta1-postrelease"
+#define KRB5_RELTAIL "beta2"
/* #undef KRB5_RELDATE */
-#define KRB5_RELTAG "branches/krb5-1-8"
+#define KRB5_RELTAG "tags/krb5-1-8-beta2"
commit 1f1506d37300ac8ed3100641702135355e929fe1
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Thu Feb 25 20:14:21 2010 +0000
ticket: 6669
version_fixed: 1.8
status: resolved
pull up r23750 from trunk
------------------------------------------------------------------------
r23750 | tlyu | 2010-02-25 15:09:45 -0500 (Thu, 25 Feb 2010) | 7 lines
ticket: 6669
target_version: 1.8
tags: pullup
subject: doc updates for allow_weak_crypto
Update documentation to be more helpful about allow_weak_crypto.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23751 dc483132-0cff-0310-8789-dd5450dbe970
doc/admin.texinfo | 7 +++++--
src/config-files/krb5.conf.M | 8 ++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/doc/admin.texinfo b/doc/admin.texinfo
index b7c87ac..5e80af3 100644
--- a/doc/admin.texinfo
+++ b/doc/admin.texinfo
@@ -456,8 +456,11 @@ key encryption. The default value for this tag is
@itemx allow_weak_crypto
If this is set to 0 (for false), then weak encryption types will be
filtered out of the previous three lists (as noted in @ref{Supported
-Encryption Types}). The default value for this tag is true, but that
-default may change in the future.
+Encryption Types}). The default value for this tag is false, which
+may cause authentication failures in existing Kerberos infrastructures
+that do not support strong crypto. Users in affected environments
+should set this tag to true until their infrastructure adopts stronger
+ciphers.
@itemx clockskew
Sets the maximum allowable amount of clockskew in seconds that the
diff --git a/src/config-files/krb5.conf.M b/src/config-files/krb5.conf.M
index b60836f..9778e81 100644
--- a/src/config-files/krb5.conf.M
+++ b/src/config-files/krb5.conf.M
@@ -128,6 +128,14 @@ types that should be requested by the client, in the same format.
This relation identifies the permitted list of session key encryption
types.
+.IP allow_weak_crypto
+If this is set to 0 (for false), then weak encryption types will be
+filtered out of the previous three lists. The default value for this
+tag is false, which may cause authentication failures in existing
+Kerberos infrastructures that do not support strong crypto. Users in
+affected environments should set this tag to true until their
+infrastructure adopts stronger ciphers.
+
.IP clockskew
This relation sets the maximum allowable amount of clockskew in seconds
that the library will tolerate before assuming that a Kerberos message
commit 0a70aed9791deab5ece6b173f4c116091328f835
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Tue Feb 23 00:25:58 2010 +0000
ticket: 6603
version_fixed: 1.8
status: resolved
pull up r23742 from trunk
------------------------------------------------------------------------
r23742 | ghudson | 2010-02-21 23:52:30 -0500 (Sun, 21 Feb 2010) | 24 lines
ticket: 6603
target_version: 1.8
tags: pullup
Fix two unrelated problems in SPNEGO which don't crop up with the krb5
mechanism.
1. The third call to spnego_init_accept_context uses faulty logic to
determine if the exchange is complete, preventing a third mech token
from being sent to the acceptor if no MIC exchange is required.
Follow the logic used in the second call (in init_ctx_nego), which is
correct.
2. If the acceptor selects a mech other than the optimistic mech, it
sets sc->mic_reqd to 1 whether or not the selected mech supports MICs
(which isn't known until the mech completes). Most code outside of
handle_mic checks sc->mic_reqd along with (sc->ctx_flags &
GSS_C_INTEG_FLAG), but the code in acc_ctx_call_acc neglected to do
so, so it could improperly delegate responsibility for deciding when
the negotiation was finished to handle_mic--which never gets called if
(sc->ctx_flags & GSS_C_INTEG_FLAG) is false. Fix acc_ctx_call_acc to
check sc->ctx_flags so that mechs which don't support integrity
protection can complete if they are selected non-optimistically.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23748 dc483132-0cff-0310-8789-dd5450dbe970
src/lib/gssapi/spnego/spnego_mech.c | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/src/lib/gssapi/spnego/spnego_mech.c b/src/lib/gssapi/spnego/spnego_mech.c
index 60fadd5..cb286bc 100644
--- a/src/lib/gssapi/spnego/spnego_mech.c
+++ b/src/lib/gssapi/spnego/spnego_mech.c
@@ -448,8 +448,9 @@ create_spnego_ctx(void)
}
/*
- * Both initiator and acceptor call here to verify and/or create
- * mechListMIC, and to consistency-check the MIC state.
+ * Both initiator and acceptor call here to verify and/or create mechListMIC,
+ * and to consistency-check the MIC state. handle_mic is invoked only if the
+ * negotiated mech has completed and supports MICs.
*/
static OM_uint32
handle_mic(OM_uint32 *minor_status, gss_buffer_t mic_in,
@@ -658,18 +659,20 @@ init_ctx_cont(OM_uint32 *minor_status, gss_ctx_id_t *ctx, gss_buffer_t buf,
supportedMech, responseToken,
mechListMIC,
negState, tokflag);
- } else if (!sc->mech_complete &&
- *responseToken == GSS_C_NO_BUFFER) {
- /*
- * mech not finished and mech token missing
- */
+ } else if ((!sc->mech_complete && *responseToken == GSS_C_NO_BUFFER) ||
+ (sc->mech_complete && *responseToken != GSS_C_NO_BUFFER)) {
+ /* Missing or spurious token from acceptor. */
ret = GSS_S_DEFECTIVE_TOKEN;
- } else if (sc->mic_reqd &&
- (sc->ctx_flags & GSS_C_INTEG_FLAG)) {
+ } else if (!sc->mech_complete ||
+ (sc->mic_reqd &&
+ (sc->ctx_flags & GSS_C_INTEG_FLAG))) {
+ /* Not obviously done; we may decide we're done later in
+ * init_ctx_call_init or handle_mic. */
*negState = ACCEPT_INCOMPLETE;
*tokflag = CONT_TOKEN_SEND;
ret = GSS_S_CONTINUE_NEEDED;
} else {
+ /* mech finished on last pass and no MIC required, so done. */
*negState = ACCEPT_COMPLETE;
*tokflag = NO_TOKEN_SEND;
ret = GSS_S_COMPLETE;
@@ -1535,10 +1538,13 @@ acc_ctx_call_acc(OM_uint32 *minor_status, spnego_gss_ctx_id_t sc,
if (ret_flags != NULL)
*ret_flags = sc->ctx_flags;
- if (!sc->mic_reqd) {
+ if (!sc->mic_reqd ||
+ !(sc->ctx_flags & GSS_C_INTEG_FLAG)) {
+ /* No MIC exchange required, so we're done. */
*negState = ACCEPT_COMPLETE;
ret = GSS_S_COMPLETE;
} else {
+ /* handle_mic will decide if we're done. */
ret = GSS_S_CONTINUE_NEEDED;
}
} else if (ret != GSS_S_CONTINUE_NEEDED) {