ikev2: fix crash during peer live check
Fix crash when peer tries to build INFO req before key exchange which
results using NULL key pointers for crypto operations.
Type: fix
@@ -2595,9 +2595,13 @@ ikev2_node_fn (vlib_main_t * vm,
}
}
}
+ if (!(ike0->flags & IKEV2_HDR_FLAG_RESPONSE))
+ {
+ ike0->flags |= IKEV2_HDR_FLAG_RESPONSE;
len = ikev2_generate_message (sa0, ike0, 0);
}
}
+ }
else if (ike0->exchange == IKEV2_EXCHANGE_CREATE_CHILD_SA)
{
uword *p;
@@ -3956,6 +3960,9 @@ ikev2_mngr_process_responder_sas (ikev2_sa_t * sa)
ikev2_main_t *km = &ikev2_main;
vlib_main_t *vm = km->vlib_main;
+ if (!sa->sk_ai || !sa->sk_ar)
+ return 0;
+
if (sa->liveness_retries > IKEV2_LIVENESS_RETRIES)
return 1;
