Fix NullPointerException in handling Cookie payload
When IKE library receives a Cookie payload in an IKE
INIT response, it should retry sending IKE INIT
request with the same SPI, and expect receiving
another IKE INIT response that containing payloads
for SA setup.
It also means that after IKE library has received
the Cookie payload, it should maintain the
allocated SPI resources, because the SPI resources
will be used in SA setup later.
The cause of NullPointerException is IKE library
closed and nulled out the SPI resources after it
received a Cookie payload. And then when IKE library
received the second IKE INIT response, it tried to
use the null-value SPI resources to set up the SA
by calling IkeSaRecord.makeFirstIkeSaRecord.
Test: FrameworksIkeTests (new tests added)
2 files changed