Commit Graph

4439 Commits

Author SHA1 Message Date
Benedict Wong
3064d7cfe0 Merge "Add validation to IpSecConfig algorithm setters" am: a954f20f46 am: c93df5ca1c
am: 96b8f818af

Change-Id: I7ff85771945c68025ce8d66ca85313bac087b3a5
2018-01-09 21:23:35 +00:00
Benedict Wong
96b8f818af Merge "Add validation to IpSecConfig algorithm setters" am: a954f20f46
am: c93df5ca1c

Change-Id: I45289bc8e8b93f7eb912a76a10b951b1a615338a
2018-01-09 19:51:19 +00:00
Benedict Wong
48db30d4c7 Add validation to IpSecConfig algorithm setters
Adds checks to ensure that users can only set the correct types of
algorithms for the Authentication, Encryption and Authenticated
Encryption algorithms.

Bug: 65223935
Test: Added tests in IpSecConfigTest, and passed on aosp_marlin-eng
Change-Id: I462c77d9eb5710b8d03a48866453649d3b6fc6bf
2018-01-04 16:56:40 -08:00
Hugo Benichi
9aa103913b 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
Merged-In: I798d8fec32dbff5687a682028e5d90eb941f81c1

(cherry pick from commit b41f870464)
2017-12-21 08:34:05 +09:00
Benedict Wong
e6714a3685 Merge "[ipsec-doze] Add fchown to IpSecService to support doze" am: 4edb4c8ec4 am: 5949912523
am: 1281a3629a

Change-Id: Id6a5ff71ead4566b9a91b9e9b6c78d81f1ac0f54
2017-12-20 18:58:30 +00:00
Benedict Wong
1281a3629a Merge "[ipsec-doze] Add fchown to IpSecService to support doze" am: 4edb4c8ec4
am: 5949912523

Change-Id: I9036fc2768dd9664ab7407b359f3c689c7ce700e
2017-12-20 18:42:26 +00:00
Benedict Wong
590c47f6dd Merge "[ipsec-qtaguid] Tag sockets upon creation of encap sockets" am: 12045eafe6 am: 8caa274ade
am: 46a6429f68

Change-Id: I4140f386687c579044f9b5fe59dd7e05f86000fe
2017-12-19 00:41:55 +00:00
Benedict Wong
46a6429f68 Merge "[ipsec-qtaguid] Tag sockets upon creation of encap sockets" am: 12045eafe6
am: 8caa274ade

Change-Id: I2f27c76a1f493ff4f0bd423c06f159e629866d4d
2017-12-19 00:27:57 +00:00
Hugo Benichi
a30c2c823d Merge changes I798d8fec,I4a2d5866 am: c5212b6654 am: 99be302c71
am: 5864454338  -s ours

Change-Id: Ib8024661997e84e64cd56a3ca9ee17c514122ead
2017-12-19 00:23:04 +00:00
Hugo Benichi
5864454338 Merge changes I798d8fec,I4a2d5866 am: c5212b6654
am: 99be302c71

Change-Id: I41b507c4e4bf9b8b9082f5e7eaab8985b5bbef41
2017-12-19 00:06:00 +00:00
Benedict Wong
3e4e37a38b [ipsec-doze] Add fchown to IpSecService to support doze
Encap sockets are currently created as the system server, and should be
fchown'd to the user for whom it was created on behalf of.

Bug: 62994731
Test: New tests added and run to IpSecService
Change-Id: Icc49e709ae588981e69765fdb77537d7ffbac5fe
2017-12-18 16:01:58 -08:00
Benedict Wong
12045eafe6 Merge "[ipsec-qtaguid] Tag sockets upon creation of encap sockets" 2017-12-18 23:50:52 +00:00
TreeHugger Robot
d858917c08 Merge "Add isMobileDataEnabled in TelephonyManager." 2017-12-18 22:08:38 +00:00
Benedict Wong
768c332e51 [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
b41f870464 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
635a73111c 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
02470067d8 Merge "Fix broken test due to API rename" am: e6238af8e5 am: ee898c81a7
am: dd0006fcd4

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

Change-Id: I7e99991cd2c71c66e1acb3aa3957efb28c9a426a
2017-12-14 23:28:16 +00:00
Nathan Harold
4d3d0e096b 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
e6238af8e5 Merge "Fix broken test due to API rename" 2017-12-14 23:07:53 +00:00
Nathan Harold
55bd2e0e92 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
fc35e198fc Merge "Use consistent naming for allocating SPI." am: 624b2c1541 am: 4753ed4b1b
am: 4109d207eb

Change-Id: Ib6845ab0d7f385fbd1d59c0179771542e12c8be0
2017-12-14 21:48:58 +00:00
nharold
4109d207eb Merge "Use consistent naming for allocating SPI." am: 624b2c1541
am: 4753ed4b1b

Change-Id: Ib5d89044313341790b1ee9271642072ddce181af
2017-12-14 21:36:32 +00:00
nharold
624b2c1541 Merge "Use consistent naming for allocating SPI." 2017-12-14 21:10:16 +00:00
Benedict Wong
0ffe141dd8 Merge "Convert IpSecService resources to use refcounting" am: 583a29abe6 am: 8698b33cc2
am: 6b129a012f

Change-Id: Ib18839d7dff8e25898f81e877337fbb8cb24cc7b
2017-12-14 02:41:28 +00:00
Benedict Wong
6b129a012f Merge "Convert IpSecService resources to use refcounting" am: 583a29abe6
am: 8698b33cc2

Change-Id: I9645df5304d7f11068d190cbdaccfe83ca0580bc
2017-12-14 02:20:20 +00:00
Benedict Wong
583a29abe6 Merge "Convert IpSecService resources to use refcounting" 2017-12-14 01:45:15 +00:00
Benedict Wong
1cb5dabc65 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
95d27f7d0d 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
d6a38397b0 Merge "Add reference counted resources to IpSecService" am: 42ae264bc8 am: adb6437fea
am: 24ddbe542c

Change-Id: Iae17a5d33d71e8abf24211cbf2b215520f45c619
2017-12-13 22:11:20 +00:00
Benedict Wong
24ddbe542c Merge "Add reference counted resources to IpSecService" am: 42ae264bc8
am: adb6437fea

Change-Id: I927ac534570b3836510e0fb4feda8cf544f5a9e4
2017-12-13 22:00:26 +00:00
Benedict Wong
42ae264bc8 Merge "Add reference counted resources to IpSecService" 2017-12-13 21:33:38 +00:00
Benedict Wong
c926bdefee 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
Jonathan Basseri
298643506a 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
116b5bd3c1 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: 5c01207b27 -s ours am: 3aafa4c9ce
am: fa4b4aff87  -s ours

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

Change-Id: I0e586f759df230aeff2dd045e5ff1d138d284ec3
2017-12-07 08:34:18 +00:00
Xin Li
5c01207b27 Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:26 +00:00
ludi
01061a6e75 Merge "Cleanup of resource limit tests" am: 5bb84059ba am: 6cd30fe9d5
am: c5d7f3b714

Change-Id: If26dc3a8a969ad63f250608427480996c3b02845
2017-12-06 04:08:23 +00:00
ludi
c5d7f3b714 Merge "Cleanup of resource limit tests" am: 5bb84059ba
am: 6cd30fe9d5

Change-Id: I102693c752fb8fbaf9c1bac824047b5ed6d3d9c1
2017-12-06 03:49:56 +00:00
ludi
6cd30fe9d5 Merge "Cleanup of resource limit tests"
am: 5bb84059ba

Change-Id: Ifcbc61ad8003c43ba1baff6d4d534192f6498206
2017-12-06 03:29:35 +00:00
Treehugger Robot
5bb84059ba Merge "Cleanup of resource limit tests" 2017-12-06 02:58:41 +00:00
Hugo Benichi
4a2f548ba5 Merge "Expose the MacAddress class in the api" 2017-12-05 23:58:32 +00:00
Hugo Benichi
e7091f6fbd Merge "Fix bug in MacAddress.fromString()" am: cdb84d2fc7 am: 7d3ce34445
am: 09a9fc003d

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

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

Change-Id: If4c85f0a5ea259f53f9cffa6eacb58fcde1fd1df
2017-12-05 09:47:50 +00:00
Hugo Benichi
06d9bd1560 Fix bug in MacAddress.fromString()
Test: runtest frameworks-net
Bug: 69390696
Change-Id: I83f01e4915092e08ed201d9b6738bb02498d3bba
2017-12-05 13:14:08 +09:00
nharold
88cd56fadc Merge "Validate IpSecAlgorithm Length" am: b592c42328 am: ae3d30d148
am: b0f302f7ad

Change-Id: I1a28d860ac7125afc1f82ac17d1834b0121c0e11
2017-12-05 02:46:06 +00:00
nharold
b0f302f7ad Merge "Validate IpSecAlgorithm Length" am: b592c42328
am: ae3d30d148

Change-Id: I1ffaa4de392777c5199a411aef9cd10f4e7c3666
2017-12-05 02:37:14 +00:00
nharold
ae3d30d148 Merge "Validate IpSecAlgorithm Length"
am: b592c42328

Change-Id: I23f7612c119e67f9a1647568aeefde38a365f8da
2017-12-05 02:28:10 +00:00
nharold
b592c42328 Merge "Validate IpSecAlgorithm Length" 2017-12-05 02:13:55 +00:00