Improve IKEv2/IPsec VPN by proposing more IPsec algorithms
This commit allows IKEv2/IPsec VPN to propose more algorithms that newly added in IpSecAlgorithm. Those new algorithms have stronger security guarantees and better performances. This commit also removes algorithm name validation because all algorithms are URL encoded to ensure no special characters create problems due to their use by VpnProfile for list or field delimiting (e.g. rfc7539esp(chacha20,poly1305)) Bug: 185265778 Test: atest FrameworksNetTests, CtsNetTestCases Test: All new algorithms are manually verified Change-Id: I1de322c95aacc8924e95bcdbcfdbd1ec441de99c
This commit is contained in:
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import android.net.IpSecAlgorithm;
|
||||
|
||||
@@ -97,6 +96,7 @@ public class VpnProfileTest {
|
||||
p.setAllowedAlgorithms(
|
||||
Arrays.asList(
|
||||
IpSecAlgorithm.AUTH_CRYPT_AES_GCM,
|
||||
IpSecAlgorithm.AUTH_CRYPT_CHACHA20_POLY1305,
|
||||
IpSecAlgorithm.AUTH_HMAC_SHA512,
|
||||
IpSecAlgorithm.CRYPT_AES_CBC));
|
||||
p.isBypassable = true;
|
||||
@@ -125,30 +125,6 @@ public class VpnProfileTest {
|
||||
assertParcelSane(getSampleIkev2Profile(DUMMY_PROFILE_KEY), 23);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetInvalidAlgorithmValueDelimiter() {
|
||||
final VpnProfile profile = getSampleIkev2Profile(DUMMY_PROFILE_KEY);
|
||||
|
||||
try {
|
||||
profile.setAllowedAlgorithms(
|
||||
Arrays.asList("test" + VpnProfile.VALUE_DELIMITER + "test"));
|
||||
fail("Expected failure due to value separator in algorithm name");
|
||||
} catch (IllegalArgumentException expected) {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetInvalidAlgorithmListDelimiter() {
|
||||
final VpnProfile profile = getSampleIkev2Profile(DUMMY_PROFILE_KEY);
|
||||
|
||||
try {
|
||||
profile.setAllowedAlgorithms(
|
||||
Arrays.asList("test" + VpnProfile.LIST_DELIMITER + "test"));
|
||||
fail("Expected failure due to value separator in algorithm name");
|
||||
} catch (IllegalArgumentException expected) {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEncodeDecode() {
|
||||
final VpnProfile profile = getSampleIkev2Profile(DUMMY_PROFILE_KEY);
|
||||
|
||||
Reference in New Issue
Block a user