Commit Graph

14 Commits

Author SHA1 Message Date
Yan Yan
69eb8325c0 Revert "Support getting transform state in IpSecService"
This reverts commit ab5006c17d.

Reason for revert: b/316010034 breaking VCN unit tests

Change-Id: I68cb1a99bb6e492c16901972d201761cd00df6fa
2023-12-12 21:53:46 +00:00
Yan Yan
ab5006c17d Support getting transform state in IpSecService
Bug: 308011229
Test: IpSecServiceParameterizedTest (new tests)
Change-Id: I3f1c2ef60ee9b6ac17909e0ee083ee6f8483588e
2023-12-12 00:14:13 +00:00
Lorenzo Colitti
b31a85addb Minor simplification to IpSecService#bindToRandomPort.
Make the caller pass in localAddr as well.

Bug: 259001350
Test: atest FrameworksNetTests
Change-Id: I978f0944ac1824169a800bda35a261ed168eeeaa
2023-02-08 15:05:14 +09:00
Lorenzo Colitti
b38fef8333 Experimental support for IPv6 UDP encap.
This is a back-pocket solution only, to ensure that VpnManager
privileged clients can temporarily rely on IPv6 UDP encap if on
certain carriers IPv4 UDP and IPv6 ESP cannot provide acceptable
performance and battery life.

For these reasons IPv6 UDP encap is not a public or system API
and is triggered by passing a port greater than 65535 to the
existing openUdpEncapsulationSocket API.

Bug: 259001350
Test: new CTS tests
Change-Id: I02e0566ba910a300dda6a589cd265a3360add40c
2023-02-08 15:05:07 +09:00
Yan Yan
a48dcd9d1f Require IPSEC_TUNNEL_MIGRATION feature flag to migrate transforms
Bug: 169169973
Test: atest IpSecServiceParameterizedTest (new tests added)
Change-Id: I3dd45b29163cd1e0cdbef08cb8aabdb629cf73bc
2022-12-21 23:12:48 +00:00
Yan Yan
e114b38f07 Support IPsec transform migration
This commit adds methods to support migrating tunnel mode
IpSecTransform to new source/destination addresses.

Bug: 169171001
Test: atest FrameworksNetTests (new tests added)
Change-Id: Ic177015fba5b62d3f73009633118109d3631086f
2022-12-21 23:12:35 +00:00
Yan Yan
f4eceba0a9 Fix policy leak by deleting forwarding security policies
Fix the policy leak by deleting forwarding policies when deleting
the IPsec tunnel interface.

Bug: 254566085
Test: atest IpSecServiceParameterizedTest (new tests added)
Change-Id: I29dd4810abb978fe886776b2fbacdfc74325436d
2022-10-31 22:51:08 +00:00
Yan Yan
be3eb3d56a Throw IAE when Network's LinkProperties is null
Improve the setUnderlyingNetwork method by throwing IAE
when Network's LinkProperties is null. Also update the
API doc to give caller more guidance in using this API

Bug: 232309601
Test: UT: IpSecServiceParameterizedTest, IpSecServiceTest,
      IpSecServiceRefcountedResourceTest, IpSecManagerTest, VpnTest
Test: CTS: IpSecManagerTest, IpSecManagerTunnelTest, Ikev2VpnTest
Test: make doc-comment-check-docs
Change-Id: Idab4706b0db42ed2222fb48b168589ed005d2f2f
2022-05-20 17:03:07 -07:00
Aaron Huang
b944ff1540 Split out the ipsec API surface and use framework-connectivity-tiramisu
(cherry picked from commit 1dad7aa006492035293e68080aeaf606df02618a)
Bug: 204153604
Test: TH
Change-Id: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
Merged-In: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
2022-02-10 19:01:00 +09:00
Aaron Huang
b01254f350 Remove ParcelFileDescriptor hidden API usage from IpSecService
IpSec service is going to be a part of Connectivity mainline module
and ParcelFileDescriptor(FileDescriptor) is a hidden API that cannot
be used by mainline module.

Therefore, use ParcelFileDescriptor.dup(FileDescriptor) to get a
ParcelFileDescriptor instead.

Bug: 204153604
Test: FrameworksNetTests
Change-Id: I0ccabdfc5060f4b635e9a7009a67fbd5d32002fd
2022-01-06 19:16:43 +08:00
Aaron Huang
2617cf51ba Remove NetdService usage from IpSecService
IpSecService is going to be moved into ConnectivityService
module. So, NetdService won't be visible to IpSecService
since it is a hidden class.

NetdService.get(timeout) is a method that blocks for specified time
until INetd instance is available. In SystemServer IpSecService is
created after NetworkManagementService and NMS uses NetdService.get()
to get INetd instance which is a method that blocks until an INetd
instance is available. Thus, connectNativeNetdService can be removed
because NMS already waits for INetd instance is available so IpSecService
should be able to get INetd instance immediately.

Bug: 204153604
Test: FrameworksNetTest
Change-Id: I007cb28de63783d60084f93dddb4de78faa0e868
2021-12-15 19:29:00 +08:00
Aaron Huang
9b27b0e6bf Refactor IpSecServiceConfiguration to Dependencies
IpSecService is going to be moved into ConnectivityService module,
so the hidden API usage should be removed.

NetdService.getNetdInstance is a hidden API, therefore the alternative
is to get the instance by Context.getSystemService.

Bug: 204153604
Test: FrameworksNetTests

Change-Id: I1bd8efc03c37654d12a8eadd3e78ed45e10b5691
2021-12-14 14:39:42 +08:00
Aaron Huang
fbae308e6a Fix style errors for IpSec associated files
Bug: 204153604
Test: build pass.
Change-Id: I940de8bef7f693dcce8808148a975bea1f36712c
2021-12-14 14:36:59 +08:00
Aaron Huang
9a708a4a19 Move IpSec associated files to f/b/packages/ConnectivityT
IpSecService is going to be moved into Connectivity mainline module.
Move all ipsec associated files to packages/ConnectivityT so that
it can be easily migrate these files to connectivity module after
clearing the hidden API usages.

Bug: 204153604
Test: build pass
      FrameworksNetTests
      CtsNetTestCases
Change-Id: I562b47f18e345988a2638cf886f86818f9144b91
2021-12-14 14:06:44 +08:00