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.
Bug: 179776241
Test: FrameworksIkeTests (new tests added)
Change-Id: Ia49b65051ca2576f74218b5e1a9ee3834b22a2ff
2 files changed