Commit Graph

4578 Commits

Author SHA1 Message Date
TreeHugger Robot
7085d9496e Merge "Add isMobileDataEnabled in TelephonyManager." 2017-12-18 22:08:38 +00:00
Benedict Wong
c41067d51a [ipsec-qtaguid] Tag sockets upon creation of encap sockets
Added calls to tag encap sockets to that of the UID for which the encap
socket is being created on behalf of. This ensures that all data
accounting generated for the UDP-encap-ESP socket is correctly billed to
the right UID.

Bug: 62994731
Test: New tests added to IpSecServiceTest.java, passing
Change-Id: I15365ea9c982fd7b4e3cdeff314ddfba2289c86e
2017-12-18 19:46:06 +00:00
Hugo Benichi
3f83b8ad4e MacAddress: address api review comments
1) toSafeString() is renamed to toOuiString()
2) toOuiString() returns a String that only contains the first 3 bytes
   of the mac address.

Bug: 70336442
Test: runtest frameworks-net
Change-Id: I798d8fec32dbff5687a682028e5d90eb941f81c1
2017-12-18 09:22:47 +09:00
Hugo Benichi
3f33d23522 Expose the MacAddress class in the api
Test: built,  flashed, $ runtest frameworks-net
Bug: 69390696
Change-Id: Ica5efdf5ffe8ad2500a87f574508a2bcd074b33d
Merged-In: Ica5efdf5ffe8ad2500a87f574508a2bcd074b33d

(cherry picked from commit d411cf61ed5b948aaf6f6234217d6c6999c35159)
2017-12-18 09:21:26 +09:00
nharold
2fcc1812e5 Merge "Fix broken test due to API rename" am: 2ea0bc5ffa am: ee898c81a7
am: 9f34247bc3

Change-Id: Ie52ce3da0507421313a73688e831d3802b888cfd
2017-12-14 23:38:17 +00:00
nharold
9f34247bc3 Merge "Fix broken test due to API rename" am: 2ea0bc5ffa
am: ee898c81a7

Change-Id: I7e99991cd2c71c66e1acb3aa3957efb28c9a426a
2017-12-14 23:28:16 +00:00
Nathan Harold
e5768f496f Fix broken test due to API rename
A race condition during an Api rename has caused
the name change from reserveSecurityParameterIndex
to allocateSecurityParameterIndex to be wrong in
a test. Fixing.

Bug: 69128142
Test: runtest frameworks-net
Change-Id: I12fb9832cb938dc19f463b1f1124127435d7b173
2017-12-14 23:13:45 +00:00
nharold
2ea0bc5ffa Merge "Fix broken test due to API rename" 2017-12-14 23:07:53 +00:00
Nathan Harold
bcbe3b6bf2 Fix broken test due to API rename
A race condition during an Api rename has caused
the name change from reserveSecurityParameterIndex
to allocateSecurityParameterIndex to be wrong in
a test. Fixing.

Bug: 69128142
Test: runtest frameworks-net
Change-Id: I12fb9832cb938dc19f463b1f1124127435d7b173
2017-12-14 23:04:42 +00:00
nharold
2079139e73 Merge "Use consistent naming for allocating SPI." am: 37303d5e94 am: 4753ed4b1b
am: b6bca5a59d

Change-Id: Ib6845ab0d7f385fbd1d59c0179771542e12c8be0
2017-12-14 21:48:58 +00:00
nharold
b6bca5a59d Merge "Use consistent naming for allocating SPI." am: 37303d5e94
am: 4753ed4b1b

Change-Id: Ib5d89044313341790b1ee9271642072ddce181af
2017-12-14 21:36:32 +00:00
nharold
37303d5e94 Merge "Use consistent naming for allocating SPI." 2017-12-14 21:10:16 +00:00
Benedict Wong
882e5ed408 Merge "Convert IpSecService resources to use refcounting" am: a87a442c5a am: 8698b33cc2
am: 393a328478

Change-Id: Ib18839d7dff8e25898f81e877337fbb8cb24cc7b
2017-12-14 02:41:28 +00:00
Benedict Wong
393a328478 Merge "Convert IpSecService resources to use refcounting" am: a87a442c5a
am: 8698b33cc2

Change-Id: I9645df5304d7f11068d190cbdaccfe83ca0580bc
2017-12-14 02:20:20 +00:00
Benedict Wong
a87a442c5a Merge "Convert IpSecService resources to use refcounting" 2017-12-14 01:45:15 +00:00
Benedict Wong
d21105064e Convert IpSecService resources to use refcounting
This is part 2 of 2 of the refcounting refactor for IpSecService
resources.

Switched ManagedResources to use RefcountedResource structure for
managing reference counts and eventual cleanup. Further, resource arrays
and quota management have been aggregated into a UserRecord for better
isolation. UID access checking has been similarly moved into the
UserRecordTracker, and resourceId checking has been rolled into
RefcountedResourceArray's accessor methods.

Bug: 63409385
Test: CTS, all unit tests run on aosp_marlin-eng, new tests added
Change-Id: Iee52dd1c9d2583bb6bfaf65be87569e9d50a5b63
2017-12-13 23:28:41 +00:00
Malcolm Chen
7e42131e05 Add isMobileDataEnabled in TelephonyManager.
Added a new hidden API isMobileDataEnabled in TelephonyManager.
Rename related APIs to isUserMobileDataEnabled,
isUserMobileDataEnabled and setUserMobileDataEnabled to better
clarify their functionality.

Bug: 69814555
Test: build
Change-Id: I2f186f1e7550cafbe4ee3a5af293c39274cbfeaa
2017-12-13 14:44:39 -08:00
Benedict Wong
9802ad3701 Merge "Add reference counted resources to IpSecService" am: 05013f3965 am: adb6437fea
am: 5dd409e76b

Change-Id: Iae17a5d33d71e8abf24211cbf2b215520f45c619
2017-12-13 22:11:20 +00:00
Benedict Wong
5dd409e76b Merge "Add reference counted resources to IpSecService" am: 05013f3965
am: adb6437fea

Change-Id: I927ac534570b3836510e0fb4feda8cf544f5a9e4
2017-12-13 22:00:26 +00:00
Benedict Wong
05013f3965 Merge "Add reference counted resources to IpSecService" 2017-12-13 21:33:38 +00:00
Benedict Wong
11c8f27e22 Add reference counted resources to IpSecService
This patch adds (but does not enable the usage of) RefcountedResource
objects to IpSecService, with tests to ensure correct function. This is
patch 1 of a series of patches to refactor the resource management
systems in IpSecService.

RefcountedResource objects allow for management of acyclical dependency
trees, ensuring eventual cleanup when resources are no longer used. This
cleanup may be triggered by binder death or by explicit user action.

Bug: 63409385
Test: New tests written in IpSecServiceRefcountedResourceTest,
explicitly testing the RefcountedResource class

Change-Id: Ib5be7482b2ef5f1c8dec9be68f15e90d8b3aba6d
2017-12-12 23:40:52 -08:00
Hugo Benichi
7a480f3f67 ConnectivityService: synchronize access on mLockdownEnabled
The mLockdownEnabled boolean and the mLockdownTracker objects are read
and mutated in many places involving vpn logic inside of
ConnectivityService. This includes codepaths run on the
ConnectivityService handler and codepaths run on Binder calls from
IConnectivityManager.aidl, however the access to these variables are not
synchronized.

This patch adds proper synchronization to mLockdownEnabled and
mLockdownTracker by moving access to them into the mVpns lock used for
all of vpn logic.

Bug: 18331877
Test: runtest frameworks-net
Change-Id: I4abde43b1036861f4486dd2b5567782d10204bd6
2017-12-13 09:54:38 +09:00
Jonathan Basseri
fbe3a82340 Use consistent naming for allocating SPI.
Throughout the IPsec code (API, system server, netd) we use "reserve"
SPI and "allocate" SPI interchangeably. This renames to use "allocate"
everywhere for self-consistency and consistency with the kernel
(ALLOCSPI).

In javadoc, I am leaving the word "reserve" in several places because it
is still an accurate description of how the method behaves.

Bug: 69128142
Test: TreeHugger should be enough
Change-Id: I8ea603b4612303b0393beef04032671fa53d2106
2017-12-12 13:50:35 -08:00
Xin Li
eb0f034af5 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: 49f174beba -s ours am: 3aafa4c9ce
am: 26f226f058  -s ours

Change-Id: Iba7fa3c7c0a70e34f97b408fe5b58187b1e433ac
2017-12-08 00:40:44 +00:00
Xin Li
26f226f058 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: 49f174beba -s ours
am: 3aafa4c9ce

Change-Id: I0e586f759df230aeff2dd045e5ff1d138d284ec3
2017-12-07 08:34:18 +00:00
Xin Li
49f174beba Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:26 +00:00
ludi
cc00bd5639 Merge "Cleanup of resource limit tests" am: 7d0a38956e am: dc7693b146
am: 5b77df1729

Change-Id: If26dc3a8a969ad63f250608427480996c3b02845
2017-12-06 04:08:23 +00:00
ludi
5b77df1729 Merge "Cleanup of resource limit tests" am: 7d0a38956e
am: dc7693b146

Change-Id: I102693c752fb8fbaf9c1bac824047b5ed6d3d9c1
2017-12-06 03:49:56 +00:00
ludi
dc7693b146 Merge "Cleanup of resource limit tests"
am: 7d0a38956e

Change-Id: Ifcbc61ad8003c43ba1baff6d4d534192f6498206
2017-12-06 03:29:35 +00:00
Treehugger Robot
7d0a38956e Merge "Cleanup of resource limit tests" 2017-12-06 02:58:41 +00:00
Hugo Benichi
731c83e23f Merge "Expose the MacAddress class in the api" 2017-12-05 23:58:32 +00:00
Hugo Benichi
e06a0a395e Merge "Fix bug in MacAddress.fromString()" am: cdb84d2fc7 am: a31109c229
am: 23649344d2

Change-Id: I7df23a45618825b874658ccbbf1d1fda6b164954
2017-12-05 10:09:35 +00:00
Hugo Benichi
23649344d2 Merge "Fix bug in MacAddress.fromString()" am: cdb84d2fc7
am: a31109c229

Change-Id: If67d0b8fcc2270d4b152d4e07c79725b457574c6
2017-12-05 10:01:19 +00:00
Hugo Benichi
a31109c229 Merge "Fix bug in MacAddress.fromString()"
am: cdb84d2fc7

Change-Id: If4c85f0a5ea259f53f9cffa6eacb58fcde1fd1df
2017-12-05 09:47:50 +00:00
Hugo Benichi
21c7a52042 Fix bug in MacAddress.fromString()
Test: runtest frameworks-net
Bug: 69390696
Change-Id: I83f01e4915092e08ed201d9b6738bb02498d3bba
2017-12-05 13:14:08 +09:00
nharold
abbb6d7923 Merge "Validate IpSecAlgorithm Length" am: 98ecd7efb2 am: 2a20e7a677
am: 96af5bbd36

Change-Id: I1a28d860ac7125afc1f82ac17d1834b0121c0e11
2017-12-05 02:46:06 +00:00
nharold
96af5bbd36 Merge "Validate IpSecAlgorithm Length" am: 98ecd7efb2
am: 2a20e7a677

Change-Id: I1ffaa4de392777c5199a411aef9cd10f4e7c3666
2017-12-05 02:37:14 +00:00
nharold
2a20e7a677 Merge "Validate IpSecAlgorithm Length"
am: 98ecd7efb2

Change-Id: I23f7612c119e67f9a1647568aeefde38a365f8da
2017-12-05 02:28:10 +00:00
nharold
98ecd7efb2 Merge "Validate IpSecAlgorithm Length" 2017-12-05 02:13:55 +00:00
Jeff Sharkey
0e39b85de9 Merge "Match network roaming state to avoid wtf()." am: cd797a5069 am: 5f948c9bc1
am: 6e46b3bba8

Change-Id: I04247a01f6a93001079429b1ee40f28afc877dcd
2017-12-05 01:38:22 +00:00
Hugo Benichi
9768c1013e Expose the MacAddress class in the api
Test: built,  flashed, $ runtest frameworks-net
Bug: 69390696
Change-Id: Ica5efdf5ffe8ad2500a87f574508a2bcd074b33d
2017-12-05 10:30:31 +09:00
Jeff Sharkey
6e46b3bba8 Merge "Match network roaming state to avoid wtf()." am: cd797a5069
am: 5f948c9bc1

Change-Id: I3dd62df8b9bb89936c1c722849bfa921bc8b3e6d
2017-12-05 01:28:55 +00:00
Jeff Sharkey
5f948c9bc1 Merge "Match network roaming state to avoid wtf()."
am: cd797a5069

Change-Id: I6796d37e4458ef4da16d16f4c0f2bdd495007515
2017-12-05 01:11:53 +00:00
Jeff Sharkey
cd797a5069 Merge "Match network roaming state to avoid wtf()." 2017-12-05 00:58:46 +00:00
Hugo Benichi
41dd9c894c Merge "MacAddress: light refactors and improve documentation" am: d871cab32d am: 56eeb80dc5
am: 6600538c55

Change-Id: Iae0e87bcc9bd9c1ba98319f3b65f18f6743c02a0
2017-12-05 00:06:50 +00:00
Hugo Benichi
6600538c55 Merge "MacAddress: light refactors and improve documentation" am: d871cab32d
am: 56eeb80dc5

Change-Id: I1e9948225e7c5ad64fad2e596d03deb3524c411c
2017-12-04 23:51:41 +00:00
Hugo Benichi
56eeb80dc5 Merge "MacAddress: light refactors and improve documentation"
am: d871cab32d

Change-Id: I51bb8786ecd7f53e3342625c7a2625007eedfc0f
2017-12-04 23:38:27 +00:00
Nathan Harold
82c3470df9 Validate IpSecAlgorithm Length
Improve the Validation of IpSecAlgorithm by
explicitly checking the length in addition to
the truncation length (previously an oversight).
In addition, we now check the lengths during
un-parceling, which will catch someone maliciously
manually building a parcel and passing it, bypassing
the checks in the constructor.

Bug: 68780091
Test: runtest -x IpSecAlgorithmTest.java
Change-Id: I8172762617264d34f47d5144336464510f07a701
2017-12-04 15:12:14 -08:00
Jeff Sharkey
58330a79bb Match network roaming state to avoid wtf().
Test: sure
Bug: 70174865
Change-Id: I02faef05e3fb918c3c023fb2fdd1886d45cc8c71
Exempt-From-Owner-Approval: P0 bug
2017-12-04 15:52:54 -07:00
Hugo Benichi
5bc3546cf6 MacAddress: light refactors and improve documentation
This patch does some light refactoring in MacAddress to prepare for
exposing MacAddress in the public api:
 - documention is improved
 - some method names are renamed
 - a toSafeString method is added
 - a padding bug in the conversion methods outputting strings for
   mac addresses is fixed

Bug: 69390696
Test: runtest frameworks-net
Change-Id: I399a97dabc2dfa8df9c5518c8b12484e43ca05c9
2017-12-04 22:34:43 +09:00