[Swan-dev] Calling all Message ID bugs

Andrew Cagney andrew.cagney at gmail.com
Mon Feb 4 17:38:10 UTC 2019


I've pushed the below re-implementation of IKEv2's Message ID code -
used to identify re-transmits, route incoming responses to the correct
state, and manage the send queue.

For the moment pluto continues to use values generated by the old
code, but then compares those values against those generated by the
new code - any discrepancies being debug-logged.
The below are all bugs in the old code that the new code identified:

>         v2 msgids: hack process_encrypted_informational_ikev2() to patch up .st_msgid_lastack when a response
>         v2 msgids: hack delete request so that the the current Message ID is saved in the IKE SA's .st_msgid
>         v2 msgids: hack v2_msgid_update_counters() to not set .st_msgid_lastrecv=v2_INVALID_MSGID when MD is fake

I'm now wondering if anyone knows of any additional edge cases or bugs
not covered by the testsuite (or WIP tests that should now work).

Over coming days I'll switch pluto to rely on the new code and values.
The old code can then be deleted.

Andrew

On Mon, 4 Feb 2019 at 10:38, Andrew Cagney <cagney at vault.libreswan.fi> wrote:
>
> New commits:
> commit 6fa2fd9f21407581397d6cd6e7b24ebe6566378f
> Merge: 4bc3929 87c192e
> Author: Andrew Cagney <cagney at gnu.org>
> Date:   Mon Feb 4 10:22:47 2019 -0500
>
>     v2 msgids: implement simple MSGID strategy, shadow existing code
>
>     Merge commit '87c192e5229d3fca3c7161f6c9dea0e7a09d4bf0'
>
> commit 87c192e5229d3fca3c7161f6c9dea0e7a09d4bf0
> Author: Andrew Cagney <cagney at gnu.org>
> Date:   Wed Jan 30 22:58:20 2019 -0500
>
>     v2 msgids: add a new Message ID / window implementation, shadow existing code
>
>     The new code determines which IDs need updating using only the state
>     transition's .send field and any incoming message.  It shadows the old
>     code and, when debugging is enabled, pexpect()s discrepancies.
>
>     Of course there be dragons.
>
>     Here it come in the form of record 'n' send.  During a state
>     transition, instead of adding the message to the outgoing queue and
>     then letting success_v2...() send the next message in the queue, code
>     is jumping the queue by recording 'n' sending messages mid-transition
>     (bonus code also then deletes the state and message ...).
>
>     The new code gets around this by forcing a call to
>     v2_msgid_update_sent().  The old code does:
>
>         v2 msgids: hack process_encrypted_informational_ikev2() to patch up .st_msgid_lastack when a response
>         v2 msgids: hack delete request so that the the current Message ID is saved in the IKE SA's .st_msgid
>         v2 msgids: hack v2_msgid_update_counters() to not set .st_msgid_lastrecv=v2_INVALID_MSGID when MD is fake
>
> _______________________________________________
> Swan-commit mailing list
> Swan-commit at lists.libreswan.org
> https://lists.libreswan.org/mailman/listinfo/swan-commit


More information about the Swan-dev mailing list