Merge branch 'master' into tlv-mic
[moonshot.git] / mech_eap / util_context.c
index 46ec86e..ed6edac 100644 (file)
@@ -147,6 +147,8 @@ gssEapContextTime(OM_uint32 *minor,
                   gss_ctx_id_t context_handle,
                   OM_uint32 *time_rec)
 {
+    *minor = 0;
+
     if (context_handle->expiryTime == 0) {
         *time_rec = GSS_C_INDEFINITE;
     } else {
@@ -214,7 +216,7 @@ gssEapVerifyConversationMIC(OM_uint32 *minor,
      */
     tokenHeaderLength = ITOK_HEADER_LENGTH + convMIC->length
         + 2 + ctx->mechanismUsed->length + 2;
-    assert(ctx->conversation.length > tokenHeaderLength);
+    assert(ctx->conversation.length >= tokenHeaderLength);
     iov[0].buffer.length -= tokenHeaderLength;
 
     iov[1].type = GSS_IOV_BUFFER_TYPE_HEADER;
@@ -250,7 +252,7 @@ gssEapMakeTokenChannelBindings(OM_uint32 *minor,
 
         tokenHeaderLength = ITOK_HEADER_LENGTH + inputToken->length +
             2 + ctx->mechanismUsed->length + 2;
-        assert(ctx->conversation.length > tokenHeaderLength);
+        assert(ctx->conversation.length >= tokenHeaderLength);
     }
 
     wireData->length = ctx->conversation.length - tokenHeaderLength;