Commit Graph

963 Commits

Author SHA1 Message Date
Benedict Wong
d12ea7c331 Merge "Update documentation for AES-GCM-ESP keymat length" am: f27dc03921
am: 6491b03410

Change-Id: I5e61a9c28dac49f2dca554ce2fdf755ab7be0dab
2017-11-08 18:12:25 +00:00
Benedict Wong
f27dc03921 Merge "Update documentation for AES-GCM-ESP keymat length" 2017-11-08 17:47:40 +00:00
Benedict Wong
01b1ab4034 Update documentation for AES-GCM-ESP keymat length
Added notes that keymat length must include 32 bits of salt.

Bug: 68672051
Test: Frameworks-net unit tests & IpSecManager CTS tests run
Change-Id: I0ae0c5be8a45b2374783b3bd1fa8bf930f15e687
2017-11-07 17:39:35 -08:00
Jeff Sharkey
0a2582193e Merge "Define NOT_ROAMING network capability." am: 8f380ab29c
am: 3fe1ae29cd

Change-Id: Ib511f7af82c80fd4e95f4da9de1fdce200deb987
2017-11-03 23:07:03 +00:00
Jeff Sharkey
7c19a1abd6 Define NOT_ROAMING network capability.
The "roaming" state of a network really belongs on NetworkCapabilities
instead of being published through NetworkInfo.isRoaming().  One major
reason is to support developers creating NetworkRequests for a
non-roaming network.

Watch for any capability changes that network statistics are
interested in (either metered or roaming) and notify it to perform
an update pass; fixes bug where we previously only triggered on
roaming changes.

Fix bug in VPNs where metered/roaming capabilities of underlying
networks weren't being propagated; this was probably preventing
some jobs from running over unmetered networks, and causing other
jobs to run over roaming networks!  Also passes along link bandwidth
information from underlying networks, and propegates any changes
to underlying networks.

Fix race condition by reading prevNc inside lock.  Utility methods
correctly calculate min/max link bandwidth values.

Test: bit FrameworksNetTests:android.net.,com.android.server.net.,com.android.server.connectivity.,com.android.server.ConnectivityServiceTest
Bug: 68397798, 16207332
Change-Id: I3e1a6544c902bf3a79356b72d3616af1fd2b0f49
2017-11-01 19:05:42 -06:00
Manoj Boopathi Raj
3794b5692e Merge "Fixed NullPointerException in IpSecService-Netd binder layer" am: bf74a93eb2
am: a096e8d177

Change-Id: I23ea94140ac3e34fc92fdc6a2c0d694396489e03
2017-10-27 18:06:09 +00:00
Manoj Boopathi Raj
8c302f08a9 Fixed NullPointerException in IpSecService-Netd binder layer
Replaced null with empty byte array in createTransportModeTransform
for null auth.getKey, crypt.getKey() and authCrypt.getKey()

Test: Ran CTS test
Bug: 68052730
Change-Id: I5110b1297b4bfbb5766e8ecfd3d64f8110b52945
2017-10-26 13:10:22 -07:00
Benedict Wong
26719cddc7 Merge "Return a port from bindToPort() in IpSecService" am: 1ce430a022
am: da8815017b

Change-Id: Ie59d496a38bf9775c1f40a543a24cb3fec5719bf
2017-10-24 16:54:57 +00:00
Benedict Wong
da8815017b Merge "Return a port from bindToPort() in IpSecService"
am: 1ce430a022

Change-Id: I51705d5db6af560f2423ef7861bfde6734632ec9
2017-10-24 16:44:59 +00:00
Benedict Wong
1ce430a022 Merge "Return a port from bindToPort() in IpSecService" 2017-10-24 16:31:21 +00:00
Benedict Wong
982cb0db7f Merge "Add support for AES-GCM-ESP as an IPSec algorithm" am: b6df7f0d35 am: cb2c14fc55
am: f92bfc3b77

Change-Id: I49932a5fc048b4a60512fac45a3537f050397168
2017-10-19 17:37:22 +00:00
Benedict Wong
cb2c14fc55 Merge "Add support for AES-GCM-ESP as an IPSec algorithm"
am: b6df7f0d35

Change-Id: Ic099206a28c4f21fa796969c953a8d4e81e8495b
2017-10-19 17:14:53 +00:00
Benedict Wong
c423cc8311 Return a port from bindToPort() in IpSecService
When binding to a random port, the port number was not being
returned, so the user is incorrectly receiving a port of zero.
Return the port number that was ultimately bound.

Bug: 67662580
Test: Ran CTS test on aosp_angler-eng
Change-Id: I22f4e5cdc83d43dc453788889990feb34e451bd3
2017-10-18 11:43:43 -07:00
Benedict Wong
53d60a2d24 Add support for AES-GCM-ESP as an IPSec algorithm
Allows native AES-GCM-ESP to be used as an IPSec transport/tunnel mode
algorithm with kernel support

Bug: 63589918
Test: IPsecService tests added, existing ones pass
Change-Id: Ie1a9a902be205f269aa37bf956198f2e5b177c21
2017-10-18 11:22:24 -07:00
nharold
2b71ef1fe2 Merge "Cosmetic Cleanups for IpSecService" am: 87d6fc04b2 am: ffb9ae2323
am: cc51ef0a47

Change-Id: I0a9c52ca26ad1b7e4505f7c9dc32ad9550b62afc
2017-10-05 01:07:53 +00:00
nharold
ffb9ae2323 Merge "Cosmetic Cleanups for IpSecService"
am: 87d6fc04b2

Change-Id: If47968dbd55f8f38f9e8dda4d78a0e2e41827da8
2017-10-05 00:44:37 +00:00
nharold
87d6fc04b2 Merge "Cosmetic Cleanups for IpSecService" 2017-10-05 00:14:16 +00:00
nharold
14f0da3e06 Merge changes from topic "ipsec-svc-cleanup" am: 9778c7884f am: 328365b5ed
am: 4e793fd0b5

Change-Id: Ib7eae5c9e223493281524e862979e16d25984dde
2017-10-04 20:53:04 +00:00
nharold
328365b5ed Merge changes from topic "ipsec-svc-cleanup"
am: 9778c7884f

Change-Id: Ide81ae76bd05ba3a2cc7c06c072306d30a489057
2017-10-04 20:24:10 +00:00
Nathan Harold
37b4cf3ecb Cosmetic Cleanups for IpSecService
This is a follow-up CL to address comments
on aosp/466677
-Rename ManagedResourceArray.get()
-Comment cleanup

Bug: 38397094
Test: runtest frameworks-net
Change-Id: I6fbdd89c4a864fe1d8a19c68947f582d7b1f0f21
2017-10-04 13:04:55 -07:00
Nathan Harold
727fe3e941 Add equals() for IpSecAlgorithm and IpSecConfig
Add equality testing methods to support tests
for parceling and un-parceling IpSecConfig.

Bug: 38397094
Test: runtest -x IpSecConfigTest.java
Change-Id: I31e318334d39ed6e9daf5ec8f3be7dcec75e12ad
2017-10-03 19:45:58 -07:00
Nathan Harold
19b99d998a Input Validation for IpSecService
All of the input to IpSecService over the Binder
interface needs to be validated both for sanity
and for safety.

-Sanity check all the parameters coming from binder.
-Added setters for IpSecConfig to decouple the test
 from the IpSecManager. This was needed because the
 input validation caused the tests to fail due to a
 null parameter that was previously un-tested.
-Added the mode flag to the IpSecConfig bundle this
 oversight was found during testing.
-Expose the getResourceId() methods for testing in
 UdpEncapsulationSocket, SecurityParameterIndex, and
 IpSecTransform classes.
-Remove the unneeded getIpSecConfig() from
 IpSecTransform: unneeded now that we can synthesize
 configs.

Bug: 38397094
Test: runtest frameworks-net
Change-Id: I5241fc7fbfa9816d54219acd8d81a9f7eef10dd4
2017-10-03 19:45:55 -07:00
nharold
59872858db Merge changes from topic "re-enable-ipsec" am: 61cf7b284e am: 5a77657433
am: 80107540bb

Change-Id: I13a7134864a648aff9338fda044b3bffd653119e
2017-09-26 22:39:01 +00:00
Nathan Harold
8a243c7ae2 Re-Enable Starting of the IpSecService am: 81f54633f0 am: a246237c74
am: 686a8282bb

Change-Id: Ia24348d585b2f1050dafd161eafcdadf0edd82c0
2017-09-26 22:37:44 +00:00
nharold
5a77657433 Merge changes from topic "re-enable-ipsec"
am: 61cf7b284e

Change-Id: Ia1d1f3981a9dd1eb8f60631d318211daf135d575
2017-09-26 22:13:20 +00:00
Nathan Harold
a246237c74 Re-Enable Starting of the IpSecService
am: 81f54633f0

Change-Id: I1f64aa2fdf1cce6dea91427eda65c4b8ee6f6b02
2017-09-26 22:11:58 +00:00
nharold
61cf7b284e Merge changes from topic "re-enable-ipsec"
* changes:
  Re-Expose IpSecService API Surface
  Re-Enable Starting of the IpSecService
2017-09-26 21:46:39 +00:00
Tetsutoki Shiozawa
a6f8963ba8 Merge "Merge "Abort connecting to native daemon during shutdown" am: aa8608db31" into stage-aosp-master am: 6e07110891
am: c3c4007a10

Change-Id: Iaf4f8b10727ae8b455e5cd2bfa021e2f77d4c6d6
2017-09-14 10:36:40 +00:00
Tetsutoki Shiozawa
b694d3637a Merge "Abort connecting to native daemon during shutdown" am: aa8608db31 am: d0c03869ff
am: ce96d1dd9d

Change-Id: I46c3e0c4f7241d1dccaa3963c462028ca8f1322d
2017-09-14 10:33:39 +00:00
Android Build Merger (Role)
6e07110891 Merge "Merge "Abort connecting to native daemon during shutdown" am: aa8608db31" into stage-aosp-master 2017-09-13 22:38:38 +00:00
Tetsutoki Shiozawa
af741b2b0b Merge "Abort connecting to native daemon during shutdown"
am: aa8608db31

Change-Id: I5b8984d51ff0715b29074cee98197263b5ce1c29
2017-09-13 22:36:59 +00:00
Tetsutoki Shiozawa
d0c03869ff Merge "Abort connecting to native daemon during shutdown"
am: aa8608db31

Change-Id: I044badaab323b836580b5231e9f2661aa320d1e9
2017-09-13 22:27:48 +00:00
Treehugger Robot
aa8608db31 Merge "Abort connecting to native daemon during shutdown" 2017-09-13 22:09:54 +00:00
Nathan Harold
69cb0af0a8 Re-Expose IpSecService API Surface
Note, This reverts commit 7194bb9bf9.

Bug: 64800246
Test: compilation
Change-Id: I709d4c476647cfe9f6b982fc373f8d76018b3922
2017-09-12 19:25:13 -07:00
Nathan Harold
81f54633f0 Re-Enable Starting of the IpSecService
This reverts commit 41004ff4113dc9175c993638a47af602af6d8a98.

Bug: 64800246
Test: compilation
Change-Id: I4f5e3cd23001b9d94b3f6dc9fcfe731a90650e6e
2017-09-12 19:25:09 -07:00
Hugo Benichi
8e37bf202b Merge "NetworkStats: more robust subtraction for deltas" am: e941c8a497 -s ours am: 67fbf6ac5e -s ours
am: 5509ba6d40  -s ours

Change-Id: Ib7cf5b4eb2cc858d93e2d3e49b9325495a47667e
2017-09-08 07:53:47 +00:00
Hugo Benichi
67fbf6ac5e Merge "NetworkStats: more robust subtraction for deltas"
am: e941c8a497  -s ours

Change-Id: Ibdb6876083588ad5c741fe8d45d46d119fd713fd
2017-09-08 07:29:15 +00:00
Hugo Benichi
e941c8a497 Merge "NetworkStats: more robust subtraction for deltas" 2017-09-08 07:13:37 +00:00
Hugo Benichi
624e54f225 NetworkStats: more robust subtraction for deltas
This patch ensures that subtract() between two NetworkStats object will
return a delta with no negative entries in all cases.

When the stats delta contains some negative values, there are clamped to
0. Some logging is added when this happens.

This is what's expected by NetworkStatsHistory#recordData().

Bug: 64365917
Bug: 65439160
Test: runtest frameworks-net
Merged-In: I16e97e73f600225f80e0ce517e80c07c6f399196
Merged-In: I2ac0bc3914cb65ae8ee27921856d698dc59624b2
Merged-In: I67d5dc4b52b254748ff17fe1e16c2eeb1d03c30d
Merged-In: Ib488fb034f72c92f19916490981342a3ef2eb33b

(cherry picked from commit d78311f267)

Change-Id: Ic86b65a65a2517c871221f8784088ec1de18f534
2017-09-08 13:39:44 +09:00
Hugo Benichi
619ce0a8f4 Merge "Network Service Discovery test: properly release resources" am: c9d24d203d am: 3a2e98b3ce
am: f467db29f9

Change-Id: Id9be284a16112f999d752751a7972fd735573cda
2017-09-04 12:42:56 +00:00
Hugo Benichi
3a2e98b3ce Merge "Network Service Discovery test: properly release resources"
am: c9d24d203d

Change-Id: If34b3770a5c0fef65d124201e0ca1374cc6b1eca
2017-09-04 12:14:11 +00:00
Hugo Benichi
fa8a0bb61f Network Service Discovery test: properly release resources
Bug: 32561414
Bug: 62918393
Bug: 62044295
Test: runtest frameworks-net
Change-Id: If23993b5e391947ecbdc01677f0a643144794b2b
2017-09-02 14:54:29 +09:00
Jeff Sharkey
4aa35f8d1b Merge "Gracefully handle integer overflows." into oc-mr1-dev
am: a7c5d0b053

Change-Id: I6ed70a40ad3e6df55e7669fedfe5b34faf95bd9f
2017-09-02 02:07:25 +00:00
TreeHugger Robot
a7c5d0b053 Merge "Gracefully handle integer overflows." into oc-mr1-dev 2017-09-02 01:54:58 +00:00
Jeff Sharkey
121a1fcbb2 Gracefully handle integer overflows.
Try sticking with integer-based math as much as possible for speed,
but switch to double-based math if we detect that we'd end up
causing an overflow.

New tests to verify.

Test: bit FrameworksNetTests:com.android.server.net.NetworkStatsCollectionTest
Bug: 65257769
Change-Id: I1ae35599be134f81850c0a3d86928b057fba1eff
2017-09-01 17:13:01 -06:00
Jeff Sharkey
f4dd66f12c Merge "Don't over-acquire NPMS locks." into oc-mr1-dev
am: 4576171c33

Change-Id: I2d23f8b238b8386958c0fd7348542713abb355dd
2017-09-01 22:03:47 +00:00
Jeff Sharkey
5f1befb42e Don't over-acquire NPMS locks.
We only need to hold mNetworkPoliciesSecondLock when working with
subscription plans; before this CL we could end up acquiring the two
NPMS locks out of order, resulting in a deadlock.

Also annotate objects in NSS that require mStatsLock to be held.

Test: builds, boots
Bug: 65268076
Change-Id: I06497564424316ef895dc8dceba72ae784781dc3
2017-09-01 12:36:20 -06:00
Jeff Sharkey
488cf28ae9 Merge "Augment network stats based on SubscriptionPlan." into oc-mr1-dev
am: f31cf45e82

Change-Id: Ia6c6d5893d841f21d181363dc01f77efa6579a8f
2017-08-30 19:14:21 +00:00
Jeff Sharkey
2f0f8f418f Augment network stats based on SubscriptionPlan.
When a carrier provides an "anchor" of data usage at a specific
moment in time, augment the network statistics used by warning/limit
thresholds and Settings UI.  For example, if the OS measured 500MB
of usage, but the carrier says only 400MB has been used, we "squish"
down the OS measured usage to match that anchor.

Callers using the hidden API will have their data augmented by
default, and the public API offers a way to opt-into augmentation.

Thorough testing to verify behavior.

Test: bit FrameworksNetTests:android.net.,com.android.server.net.
Test: cts-tradefed run commandAndExit cts-dev -m CtsUsageStatsTestCases -t android.app.usage.cts.NetworkUsageStatsTest
Bug: 64534190
Change-Id: Id3d4d7625bbf04f57643e51dbf376e3fa0ea8eca
2017-08-30 10:01:10 -06:00
Lorenzo Colitti
1d1d06f8dd Merge changes I325b13d5,I89719fe7 am: 31cb4583e5 am: d1800f3e6f am: 4fa0187015
am: 4187540d39  -s ours

Change-Id: Iddb0b4e22d942c9b399e57e17328b6911f473064
2017-08-19 03:47:59 +00:00