[krbdev.mit.edu #6695] gss_wrap_iov/gss_unwrap_iov and SSPI

Arlene Berry via RT rt-comment at krbdev.mit.edu
Mon Apr 5 17:44:29 EDT 2010


I have discovered that gss_wrap_iov and gss_unwrap_iov do not
interoperate very well with SSPI when not using GSS_C_DCE_STYLE.  The
reason is that SSPI includes the length of sign only buffers in the
message length but MIT does not.  I understand there was a design goal
of being able to string buffers together and call gss_unwrap on them.
It seems to me that this is only going to work if there are no sign only
buffers, in which case it doesn't matter whether you include sign only
buffers in the message length.  This fixes interoperability with SSPI:

Index: src/lib/gssapi/krb5/k5sealiov.c
===================================================================
--- src/lib/gssapi/krb5/k5sealiov.c	(revision 42826)
+++ src/lib/gssapi/krb5/k5sealiov.c	(working copy)
@@ -112,7 +112,7 @@
         if (ctx->gss_flags & GSS_C_DCE_STYLE)
             tmsglen = k5_headerlen; /* confounder length */
         else
-            tmsglen = conf_data_length + padding->buffer.length;
+            tmsglen = conf_data_length + padding->buffer.length +
assoc_data_length;
     }
 
     /* Determine token size */
Index: src/lib/gssapi/krb5/k5unsealiov.c
===================================================================
--- src/lib/gssapi/krb5/k5unsealiov.c	(revision 42826)
+++ src/lib/gssapi/krb5/k5unsealiov.c	(working copy)
@@ -352,7 +352,7 @@
 
         kg_iov_msglen(iov, iov_count, &data_length,
&assoc_data_length);
 
-        input_length += data_length - assoc_data_length;
+        input_length += data_length;
 
         if (padding != NULL)
             input_length += padding->buffer.length;





More information about the krb5-bugs mailing list