krb5/krb5 — pull request #76 by tkuthan (2014-03-10 16:36:37+00:00)
Title: g_order_check() fails iff first token arrives out-of-order

After the queue was re-written to store deltas from firstnum, the first
(dummy) element was changed from firstnum-1 to (-1 & mask). Now, when the
firstnum arrives out of order, it should be inserted between the
dummy element and the element that arrived first. But its delta from
firstnum is zero, which is not greater that the value of dummy element
(all ones binary). It doesn't fit in any other place in the queue
either, and g_order_check returns GSS_S_FAILURE, which (according to the
comment) should never happen.

To reproduce: 2 - 1 - 3
Expected outcome: GSS_S_GAP_TOKEN, GSS_S_UNSEQ_TOKEN, GSS_S_COMPLETE
Actual outcome: GSS_S_GAP_TOKEN, GSS_S_FAILURE, GSS_S_COMPLETE