Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04992800 authored by Yan Yan's avatar Yan Yan Committed by Automerger Merge Worker
Browse files

Merge "Include PORT_4500 option when encoding IkeSessionParams" am: c65ed07b am: 33f08103

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682405

Change-Id: I1e72d91a232e4c54782e69c4c20142efefc53873
parents 2d810df8 33f08103
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public final class IkeSessionParamsUtils {
        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_MOBIKE);
        IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_FORCE_PORT_4500);
    }

    /** Serializes an IkeSessionParams to a PersistableBundle. */
@@ -124,6 +125,8 @@ public final class IkeSessionParamsUtils {
        result.putInt(DPD_DELAY_SEC_KEY, params.getDpdDelaySeconds());
        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<>();
        for (int option : IKE_OPTIONS) {
            if (params.hasIkeOption(option)) {
+2 −0
Original line number Diff line number Diff line
@@ -55,11 +55,13 @@ public class IkeSessionParamsUtilsTest {
    private static IkeSessionParams.Builder createBuilderMinimum() {
        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()
                .setServerHostname(serverAddress.getHostAddress())
                .addSaProposal(SaProposalUtilsTest.buildTestIkeSaProposal())
                .setLocalIdentification(new IkeFqdnIdentification("client.test.android.net"))
                .setRemoteIdentification(new IkeFqdnIdentification("server.test.android.net"))
                .addIkeOption(IkeSessionParams.IKE_OPTION_FORCE_PORT_4500)
                .setAuthPsk("psk".getBytes());
    }