Merge "Include PORT_4500 option when encoding IkeSessionParams"
This commit is contained in:
@@ -78,6 +78,7 @@ public final class IkeSessionParamsUtils {
|
|||||||
IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_ACCEPT_ANY_REMOTE_ID);
|
IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_ACCEPT_ANY_REMOTE_ID);
|
||||||
IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_EAP_ONLY_AUTH);
|
IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_EAP_ONLY_AUTH);
|
||||||
IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_MOBIKE);
|
IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_MOBIKE);
|
||||||
|
IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_FORCE_PORT_4500);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Serializes an IkeSessionParams to a PersistableBundle. */
|
/** Serializes an IkeSessionParams to a PersistableBundle. */
|
||||||
@@ -124,6 +125,8 @@ public final class IkeSessionParamsUtils {
|
|||||||
result.putInt(DPD_DELAY_SEC_KEY, params.getDpdDelaySeconds());
|
result.putInt(DPD_DELAY_SEC_KEY, params.getDpdDelaySeconds());
|
||||||
result.putInt(NATT_KEEPALIVE_DELAY_SEC_KEY, params.getNattKeepAliveDelaySeconds());
|
result.putInt(NATT_KEEPALIVE_DELAY_SEC_KEY, params.getNattKeepAliveDelaySeconds());
|
||||||
|
|
||||||
|
// TODO: b/185941731 Make sure IkeSessionParamsUtils is automatically updated when a new
|
||||||
|
// IKE_OPTION is defined in IKE module and added in the IkeSessionParams
|
||||||
final List<Integer> enabledIkeOptions = new ArrayList<>();
|
final List<Integer> enabledIkeOptions = new ArrayList<>();
|
||||||
for (int option : IKE_OPTIONS) {
|
for (int option : IKE_OPTIONS) {
|
||||||
if (params.hasIkeOption(option)) {
|
if (params.hasIkeOption(option)) {
|
||||||
|
|||||||
@@ -55,11 +55,13 @@ public class IkeSessionParamsUtilsTest {
|
|||||||
private static IkeSessionParams.Builder createBuilderMinimum() {
|
private static IkeSessionParams.Builder createBuilderMinimum() {
|
||||||
final InetAddress serverAddress = InetAddresses.parseNumericAddress("192.0.2.100");
|
final InetAddress serverAddress = InetAddresses.parseNumericAddress("192.0.2.100");
|
||||||
|
|
||||||
|
// TODO: b/185941731 Make sure all valid IKE_OPTIONS are added and validated.
|
||||||
return new IkeSessionParams.Builder()
|
return new IkeSessionParams.Builder()
|
||||||
.setServerHostname(serverAddress.getHostAddress())
|
.setServerHostname(serverAddress.getHostAddress())
|
||||||
.addSaProposal(SaProposalUtilsTest.buildTestIkeSaProposal())
|
.addSaProposal(SaProposalUtilsTest.buildTestIkeSaProposal())
|
||||||
.setLocalIdentification(new IkeFqdnIdentification("client.test.android.net"))
|
.setLocalIdentification(new IkeFqdnIdentification("client.test.android.net"))
|
||||||
.setRemoteIdentification(new IkeFqdnIdentification("server.test.android.net"))
|
.setRemoteIdentification(new IkeFqdnIdentification("server.test.android.net"))
|
||||||
|
.addIkeOption(IkeSessionParams.IKE_OPTION_FORCE_PORT_4500)
|
||||||
.setAuthPsk("psk".getBytes());
|
.setAuthPsk("psk".getBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user