[Swan-dev] decryption could change selected state transition

Andrew Cagney andrew.cagney at gmail.com
Wed Feb 18 03:40:03 EET 2015


On 17 February 2015 at 14:12, Paul Wouters <paul at nohats.ca> wrote:
> On Mon, 16 Feb 2015, Andrew Cagney wrote:
>
>> Problem is, ikev2_process_decrypted_payloads does the following:
>>
>> - unpacks the payload saving the result (good)
>>
>> - starting with the previously selected transition, search the state
>> transition table for a transition that matches the payload contents;
>> if a match is found the message digest is updated
>>
>> - if no transition matches, issue an error/fail for the last bad match
>>
>> It's that middle bit that is wrong.  It is there so that the
>> transition search code can look deeper into a packet for the correct
>> match (for instance a INIT response with a COOKIE or INVALID_KE
>> notification)

It is only possible to understand this function by knowing all this
additional context -> it isn't exactly simple and transparent
behaviour.

> An IKE_INIT packet does not contain encrypted payloads? eg it has no
> .req_enc_payloads or .opt_enc_payloads entry in the SMF2. We would
> reject it if the packet had an encrypted payload.
>
>> Fortunately, none of the transitions involving an encrypted payload
>> have SMF2_CONTINUE_MATCH set so it won't happen.
>>
>> confusing - to me the code iterating through the table should be kept
>> separate (which means splitting up the function)
>
>
> I'm not sure I understand what you think is a problem?
>
> Paul


More information about the Swan-dev mailing list