Raise a bus alert when a received message contains unknown SPIs

This commit is contained in:
Martin Willi 2012-10-08 11:09:31 +02:00
parent 47904e3c74
commit f6f16131d0
2 changed files with 6 additions and 0 deletions

View File

@ -92,6 +92,8 @@ enum alert_t {
ALERT_PEER_ADDR_FAILED,
/** peer did not respond to initial message, current try (int, 0-based) */
ALERT_PEER_INIT_UNREACHABLE,
/** received IKE message with invalid SPI, argument is message_t* */
ALERT_INVALID_IKE_SPI,
};
/**

View File

@ -1274,6 +1274,10 @@ METHOD(ike_sa_manager_t, checkout_by_message, ike_sa_t*,
}
unlock_single_segment(this, segment);
}
else
{
charon->bus->alert(charon->bus, ALERT_INVALID_IKE_SPI, message);
}
id->destroy(id);
charon->bus->set_sa(charon->bus, ike_sa);
return ike_sa;