aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/ikev2/ikev2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/ikev2/ikev2.c b/src/plugins/ikev2/ikev2.c
index 7931322146c..44528e1fdaf 100644
--- a/src/plugins/ikev2/ikev2.c
+++ b/src/plugins/ikev2/ikev2.c
@@ -1671,11 +1671,13 @@ ikev2_sa_auth (ikev2_sa_t * sa)
authmsg = ikev2_sa_generate_authmsg (sa, 1);
if (sel_p->auth.method == IKEV2_AUTH_METHOD_SHARED_KEY_MIC)
{
+ vec_free (sa->r_auth.data);
sa->r_auth.data = ikev2_calc_prf (tr_prf, psk, authmsg);
sa->r_auth.method = IKEV2_AUTH_METHOD_SHARED_KEY_MIC;
}
else if (sel_p->auth.method == IKEV2_AUTH_METHOD_RSA_SIG)
{
+ vec_free (sa->r_auth.data);
sa->r_auth.data = ikev2_calc_sign (km->pkey, authmsg);
sa->r_auth.method = IKEV2_AUTH_METHOD_RSA_SIG;
}
@@ -1732,11 +1734,13 @@ ikev2_sa_auth_init (ikev2_sa_t * sa)
if (sa->i_auth.method == IKEV2_AUTH_METHOD_SHARED_KEY_MIC)
{
+ vec_free (sa->i_auth.data);
sa->i_auth.data = ikev2_calc_prf (tr_prf, psk, authmsg);
sa->i_auth.method = IKEV2_AUTH_METHOD_SHARED_KEY_MIC;
}
else if (sa->i_auth.method == IKEV2_AUTH_METHOD_RSA_SIG)
{
+ vec_free (sa->i_auth.data);
sa->i_auth.data = ikev2_calc_sign (km->pkey, authmsg);
sa->i_auth.method = IKEV2_AUTH_METHOD_RSA_SIG;
}