* Random value RAND
*/
chunk_t rand;
+
+ /**
+ * EAP-AKA message we have initiated
+ */
+ simaka_subtype_t pending;
+
+ /**
+ * Did the client send a synchronize request?
+ */
+ bool synchronized;
};
/**
message->add_attribute(message, AT_AUTN, chunk_create(autn, AKA_AUTN_LEN));
*out = message->generate(message, this->crypto, chunk_empty);
message->destroy(message);
+
+ this->pending = AKA_CHALLENGE;
return NEED_MORE;
}
simaka_attribute_t type;
chunk_t data, res = chunk_empty;
+ if (this->pending != AKA_CHALLENGE)
+ {
+ DBG1(DBG_IKE, "received %N, but not expected",
+ simaka_subtype_names, AKA_CHALLENGE);
+ return FAILED;
+ }
enumerator = in->create_attribute_enumerator(in);
while (enumerator->enumerate(enumerator, &type, &data))
{
chunk_t data, auts = chunk_empty;
bool found = FALSE;
+ if (this->synchronized)
+ {
+ DBG1(DBG_IKE, "received %N, but peer did already resynchronize",
+ simaka_subtype_names, AKA_SYNCHRONIZATION_FAILURE);
+ return FAILED;
+ }
+
DBG1(DBG_IKE, "received synchronization request, retrying...");
enumerator = in->create_attribute_enumerator(in);
"resynchronization for '%Y'", this->peer);
return FAILED;
}
+ this->synchronized = TRUE;
return initiate(this, out);
}
this->msk = chunk_empty;
this->xres = chunk_empty;
this->rand = chunk_empty;
+ this->pending = 0;
+ this->synchronized = FALSE;
/* generate a non-zero identifier */
do {
this->identifier = random();
* MSK, used for EAP-SIM based IKEv2 authentication
*/
chunk_t msk;
+
+ /**
+ * EAP-SIM message we have initiated
+ */
+ simaka_subtype_t pending;
};
/* version of SIM protocol we speak */
bool supported = FALSE;
int i;
+ if (this->pending != SIM_START)
+ {
+ DBG1(DBG_IKE, "received %N, but not expected",
+ simaka_subtype_names, SIM_START);
+ return FAILED;
+ }
+
enumerator = in->create_attribute_enumerator(in);
while (enumerator->enumerate(enumerator, &type, &data))
{
message->add_attribute(message, AT_RAND, rands);
*out = message->generate(message, this->crypto, nonce);
message->destroy(message);
+
+ this->pending = SIM_CHALLENGE;
return NEED_MORE;
}
simaka_attribute_t type;
chunk_t data;
+ if (this->pending != SIM_CHALLENGE)
+ {
+ DBG1(DBG_IKE, "received %N, but not expected",
+ simaka_subtype_names, SIM_CHALLENGE);
+ return FAILED;
+ }
+
enumerator = in->create_attribute_enumerator(in);
while (enumerator->enumerate(enumerator, &type, &data))
{
message->add_attribute(message, AT_VERSION_LIST, version);
*out = message->generate(message, this->crypto, chunk_empty);
message->destroy(message);
+
+ this->pending = SIM_START;
return NEED_MORE;
}
this->peer = peer->clone(peer);
this->sreses = chunk_empty;
this->msk = chunk_empty;
+ this->pending = 0;
/* generate a non-zero identifier */
do {
this->identifier = random();