Commit Graph

55 Commits

Author SHA1 Message Date
Cindy Zhou
335c39e89f Enable CFI in libjni_pacprocessor
Bug: 147359729
Bug: 145990493
Test: Run proxy CTS tests on cuttlefish
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testProxyPacProxyTest

Change-Id: I9b82cf6eeb2e880484cd2e51815a2b70a753a1a6
2020-02-13 13:20:53 -08:00
Richard Coles
e6c57082d8 Merge "Disable CFI in libpac." 2020-02-13 15:14:42 +00:00
Anna Malova
b186af1bfb Disable CFI in libpac.
Bug: 147359729
Bug: 145990493
Test: Run proxy CTS tests on cuttlefish
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testProxyPacProxyTest

Change-Id: I5b1bb53b3acb2b5587657ce266070ca7c09f2f9d
2020-02-13 12:20:31 +00:00
Anna Malova
23782a50ab Use synchronize methods instead of synchronized blocks in PacWebView.
No change in logic.

Bug: 148516710
Test: atest DeviceOwnerTest#testProxyPacProxyTest
Change-Id: Id8089ff4e93b6b6df6547c226610be99ae5dabb1
2020-02-12 13:03:41 +00:00
Anna Malova
29ed0cc421 Implement PacService using WebView's version of libpac.
Add config flag to choose between PacService implementations.
Added flag (config_useWebViewPacProcessor) is disabled
by default for now.

Bug: 148516710
Test: atest DeviceOwnerTest#testProxyPacProxyTest
Change-Id: I5d376a2a37f1bfb7ba5268c0088bf4417434b8f5
2020-02-11 12:54:26 +00:00
Automerger Merge Worker
8efe77c998 Merge "Mitigate race conditions in PacService" am: d7942eef48 am: 6cd7b812ca am: c19a2ed00d
Change-Id: Ibd7b037d692ef478c36a05d1ba2ab4231fc1dc44
2020-02-10 13:50:28 +00:00
Rubin Xu
b770235a86 Mitigate race conditions in PacService
There are some design limitations in PacService (one-way aidl calls
from ConnectivityService) that causes it to be racy when PAC proxy are
set and cleared in quick succession. Attempt to mitigate them with the
following changes:

1. Make PacNative a singleton instead of one instance per binder. The
underlying v8 engine is singleton so it makes little sense to have
multiple instances of the PacNative wrapper.
2. Remove the startPacSystem and stopPacSystem API and bind the
PacNative lifecycle to the PacService. Otherwise the one-way
stopPacSystem() binder call could have raced with a next
startPacSystem() call when PAC proxy is cleared and then set.

For this change, startPacSystem() and stopPacSystem() and made no-op
only. They will be fully removed in the next change.

Test: atest --iterations 200 com.android.cts.devicepolicy.DeviceOwnerTest#testProxyPacProxyTest
Bug: 147359729
Change-Id: Ie3ce098167694421f8bd2a6dec85d7c437cfb0be
EDIT
2020-02-10 11:05:12 +00:00
Cindy Zhou
9080d16c58 libjni_pacprocessor removing diag
Removing diagnostic mode for CFI before IC

Bug: 147144481
Bug: 145990493
Test: N/A
Change-Id: Ibef8919c62d455531914b62a1b3697eb35527d9e
2020-01-16 14:40:26 -08:00
Cindy Zhou
dabebc6f4f Enable CFI libjni_pacprocessor
Bug: 145990493
Test: Ran native test proxy_resolver_v8_unittest and GTS
DeviceOwnerTest.

Change-Id: Ieae52f8569435cc2f85adb0335caae0772ea26ea
2019-12-12 10:22:43 -08:00
Jiyong Park
d6be579720 Use filegroup to simplify Android.bp for frameworks and its friends
Java and AIDL source files under frameworks/base are now modularized
using filegroup. Each filegroup has 'path' property set to the base
directory of the ssource files. This allows us to not rely on
aidl.[local_]include_dirs and srcs_lib_whitelist_dirs to get the base
directories.

Bug: 70046217
Test: m
Exempt-From-Owner-Approval: Approved internally
Merged-In: I0705ddf76b3c628127f65d75e0a8b06c6c250fe2
(cherry picked from commit b360931bf0)
Change-Id: I0705ddf76b3c628127f65d75e0a8b06c6c250fe2
2019-08-26 08:09:49 +00:00
Jiyong Park
b360931bf0 Use filegroup to simplify Android.bp for frameworks and its friends
Java and AIDL source files under frameworks/base are now modularized
using filegroup. Each filegroup has 'path' property set to the base
directory of the ssource files. This allows us to not rely on
aidl.[local_]include_dirs and srcs_lib_whitelist_dirs to get the base
directories.

Bug: 70046217
Test: m
Change-Id: I0705ddf76b3c628127f65d75e0a8b06c6c250fe2
2019-08-22 20:07:38 +09:00
Sasha Smundak
a7335a976a Convert Android.mk file to Android.bp
See build/soong/README.md for more information.

Bug: 122332340
Test: treehugger
Change-Id: I4ccc0a2e13fc49a0109e9823fbcb4077e11455d5
Merged-In: I4ccc0a2e13fc49a0109e9823fbcb4077e11455d5
2019-02-20 11:16:22 -08:00
Sasha Smundak
df848ac224 Convert Android.mk file to Android.bp
See build/soong/README.md for more information.

Bug: 122332340
Test: treehugger
Change-Id: I4ccc0a2e13fc49a0109e9823fbcb4077e11455d5
2019-02-08 15:13:25 -08:00
Victor Chang
338617d5bd Remove libpac as a JNI library in Android.mk
In fact, libpac is just a normal C++ library, not a JNI library.
Remove it from LOCAL_JNI_SHARED_LIBRARIES. libjni_pacprocessor
is the actual JNI library.

libpac is still being used. libjni_pacprocessor, specified in
frameworks/base/packages/services/PacProcessor/jni/Android.bp,
depends on libpac as shared library.

This change is needed to move libpac into the Runtime APEX.

Bug: 121269980
Test: m droid
Change-Id: I2a985acddbf2083d59fa28cfa76e6e4b80fa5b20
2019-01-16 15:30:35 +00:00
Victor Chang
361f4eb8c0 Replace C++ API by the C API provided by libpac
- libpac will be moved into the Runtime APEX module.
  Use the new stable C API interface provided by libpac
- The change also removes the following debug log when
  error occurs.

  ALOGE("Error Running PAC: %s", ret8.string());

  When ProxyServerV8::GetProxyForURL != OK, ret8 may not
  contain the error message, but the non-ASCII proxy names.

Bug: 121269980
Test: m droid
Change-Id: I0ea0ad7489a23cbc0476dcd66d320f80499f8be1
2019-01-08 14:02:09 +00:00
Victor Chang
64c3f6d6ba Use std::u16string instead of android::String16 due to API change in libpac
Bug: 121269980
Test: m droid
Change-Id: I17a91114f1a97b2ccd3049680aace1719eb7ae8a
2019-01-04 20:33:55 +00:00
Victor Chang
30428c4d53 Move the implementation of ProxyErrorListener to libpac
The implementation logs the error in Android.

libpac will provide C API, not C++ API. This change
prepares for the migration.

Bug: 121269980
Test: m droid
Change-Id: Ib39e76d1880c33656d5ddbffdc3c124e7e911c16
2019-01-04 12:15:49 +00:00
Dan Willemsen
a13b003b8b Convert screencap and libjni_pacprocessor to Android.bp
See build/soong/README.md for more information.

Test: m screencap libjni_pacprocessor
Change-Id: I976ec0fad591f30707b484722c972cd89b569163
2018-11-16 15:47:43 -08:00
Narayan Kamath
5018208eb6 PacProcessor: Include libpac as a JNI_SHARED_LIBRARY.
libpac is only used by the PacProcessor, so this prevents us
from installing both the 32 and 64 bit versions of the library
on the system partition.

Test: make

Change-Id: I61033ba66116cf21f5518657df8fcd9fa46cd1b5
2018-05-15 11:23:53 +01:00
Anton Hansson
a3e79fbb8c frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: Ibcffec873a693d1c792ca210fb597d2bf37e9068
Merged-In: I4233b9091d9066c4fa69f3d24aaf367ea500f760
2018-02-28 17:15:21 +00:00
Steven Moreland
2279b25342 frameworks/base: use proper nativehelper headers
libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.

Test: modules using frameworks/base find headers
Bug: 63762847
Change-Id: I0f9f231acdebe460f279135462f43d3e32eff64d
2017-07-19 10:06:40 -07:00
Jeff Sharkey
8a372a0a28 Refactoring FBE APIs based on council feedback.
Mostly consists of removing the word "encryption" from most APIs,
since we can't actually make promises about the data being encrypted.

Bug: 27531029
Change-Id: Iace9d7c4e64716abf86ed11847c40f3947e1d625
2016-03-17 14:49:08 -06:00
Jeff Sharkey
f9fc6d6cc0 More file-based encryption work.
Add granular StorageManager APIs for key creation/destruction and
unlocking/locking.  Start passing through an opaque token as part
of the unlock command, but leave it empty for now.  We now have a
separate "prepare" method that sanity checks that user directories
are correctly setup.

Define a handful of system properties used for marking devices that
should be operating in FBE mode, and if they're emulating FBE.  Wire
a command to "sm", but persisting will come later.

Start using new "encryptionAware" flag on apps previously marked with
coreApp flag, which were apps running in the legacy CryptKeeper
model.  Small tweaks to handle non-encryptionAware voice interaction
services.  Switch PackageManager to consult StorageManager about the
unlocked state of a user.

Bug: 22358539
Change-Id: Ic2865f9b81c10ea39369c441422f7427a3c3c3d6
2015-11-11 10:47:23 -08:00
Elliott Hughes
b57dd722f1 resolved conflicts for a884d81e to stage-aosp-master
Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
2015-09-24 10:01:32 -07:00
Daniel Micay
76f6a86de2 constify JNINativeMethod function pointer tables
Change-Id: I4036c924958221cbc644724f8eb01c5de3cd7954
2015-09-22 17:10:35 -04:00
Andrei Kapishnikov
1e64ab3e56 Replace absolute_uri with absolute_path when HTTP request is forwarded to non-proxy server.
According to the spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html):
When Request-URI is used to identify a resource on an origin server or
gateway, the absolute path of the URI MUST be transmitted as the
Request-URI.

Before the change,the proxy sent absolute_uri, which is used to send
HTTP requests to proxies: “The absoluteURI form is REQUIRED when the
request is being made to a proxy.”

Related Bug 18776631

Other changes:
1. Remove proxy-connection header when the request is sent to an
origin server.

2. Added “connection = close” header to indicate that the origin
server needs to close the connection right after the response.
Currently, our proxy does not support keep-alive (persistent)
connections because it analyses only the first request for a given
connection and; therefore, cannot perform required request content
substitutions.

3. Fixed an issue when a non-numeric host port number resulted in
forwarding requests to default 443 port for SSL connections, e.g.
request to https://google.com:ZZZ, would be translated to
https://google.com:443.

4. Fixed an issue when the proxy tries to establish direct connection
to the origin server even when it is not supposed to do that
according to PAC. That happened when PAC returned a proxy server
that is not available.

5. Prevent ProxyServer from crashing when PacService throws
an exception by intercepting all exception types.

Change-Id: I7d50b13b4cb24199a690a53c1925e87c15a8d45b
2015-02-11 14:58:31 -05:00
Andrei Kapishnikov
44c0259037 Do not throw NullPointerException from PacService
Do not throw NullPointerException from PacService
since the calling client may not expect it and crash.

Fix of Bug 18818567

Change-Id: Ic36e8a1ca13cdaa7f605b6ade9cc6783517cbf40
2015-01-16 15:57:55 -05:00
Dan Albert
47249598cb am 582bdf9a: am d8c169fe: am 0c437fd3: Merge "Add appropriate casts for char16_t."
* commit '582bdf9a5961a32de27556832e23e0611c4d1cbb':
  Add appropriate casts for char16_t.
2014-11-20 23:19:06 +00:00
Dan Albert
6698749dd4 Add appropriate casts for char16_t.
C++11 defines a real char16_t, which is not implicitly convertible to
uint16_t (and by extension jchar). Add casts as needed.

Bug: 18300613
Change-Id: I00752002ef2e938bdb57f70947e8fd53ec103293
2014-11-20 11:47:40 -08:00
Andreas Gampe
18fddfe020 am c25e0dce: am 5b50cd13: Merge "Frameworks/base: Fix build"
* commit 'c25e0dcea982468225c4150dcb699db5185a1eee':
  Frameworks/base: Fix build
2014-11-14 19:15:59 +00:00
Andreas Gampe
2e4ad0a641 am d99c25ef: am 37079e29: Merge "Frameworks/base: Wall Werror in packages"
* commit 'd99c25eff3ad421b900caf7af82f970b23a81733':
  Frameworks/base: Wall Werror in packages
2014-11-14 19:15:52 +00:00
Andreas Gampe
577f48c1c9 Frameworks/base: Fix build
Fix a typo.

Change-Id: Ida417c842563576b053d9f5553a2aa8d5862897c
2014-11-13 15:44:27 -08:00
Andreas Gampe
423ba098bd Frameworks/base: Wall Werror in packages
Turn on -Wall -Werror in packages/. Fix warnings.

Change-Id: I4ec7256a7df46017e1895575719f2b5aca978bd0
2014-11-13 15:25:34 -08:00
Dan Albert
45670c1dc5 am b28ff487: resolved conflicts for merge of 5e6cf242 to lmp-mr1-dev-plus-aosp
* commit 'b28ff487fb6db4a44e4d18aa17d8253f00a63bb6':
  Move frameworks/base over to libc++.
2014-11-12 21:31:33 +00:00
Dan Albert
ff1d8a6635 Move frameworks/base over to libc++.
Bug: 15193147
Change-Id: I96109d2d383f0c8a4aaa611f29fcf887afb3c69e
2014-11-12 11:22:20 -08:00
Jason Monk
ae392155a2 Remove unused constant and associated STOPSHIP
Bug: 10459877
Change-Id: Ic8a6632176a9417af246709c940f658639e42317
2014-09-19 13:19:06 +00:00
Narayan Kamath
80aceae89e am f4e0bf9f: am 98993813: am b75b3aaa: Merge "Build PacProcessor for 64 bit."
* commit 'f4e0bf9fe191ab86ff1dd6ba8060a34826017928':
  Build PacProcessor for 64 bit.
2014-05-28 18:02:16 +00:00
Narayan Kamath
96132a1907 Build PacProcessor for 64 bit.
external/chromium-libpac can now build for 64 bit.

Change-Id: I0bfd068ef4ea7d57686f11b79c32803e38bab719
2014-05-27 17:06:18 +01:00
Andreas Gampe
4694175624 PacProccesor: Only build for 32-bit
PacProcessor relies on libpac from chromium, which is not built
for 64b right now.

(cherry picked from commit f8749200c0)

Change-Id: Ic128e17b7437c130df29eeab3293b9c01f01d70b
2014-05-27 11:56:22 +01:00
Ying Wang
38250d9b84 Use LOCAL_JNI_SHARED_LIBRARIES to install JNI libs.
Change-Id: Ibef01983891377b859d28cff801f48ef5d8eabb2
2014-04-18 16:39:47 -07:00
Andreas Gampe
f8749200c0 PacProccesor: Only build for 32-bit
PacProcessor relies on libpac from chromium, which is not built
for 64b right now.

Change-Id: I034932343b9aef239748511d8deb498b46e77cf2
2014-04-18 23:12:39 +00:00
Ying Wang
56f43240f9 Use LOCAL_JNI_SHARED_LIBRARIES to install JNI libs.
Change-Id: Ibef01983891377b859d28cff801f48ef5d8eabb2
2014-04-17 18:14:50 -07:00
Glenn Kasten
9eed0c624e am 6afcecdc: am 2fb4a6bb: am 48988921: am d6408735: Merge "PacProcessor should be 32 bit only."
* commit '6afcecdc15b0baec1398e344f90666e13b8e337c':
  PacProcessor should be 32 bit only.
2014-03-19 19:54:03 +00:00
Narayan Kamath
58f9a645e1 PacProcessor should be 32 bit only.
It depends on external/v8, which isn't ready for 64 bit yet.

Change-Id: Ibc9705665b81d3667826dedd6217f2eb6d451c81
2014-03-19 11:39:43 +00:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Jason Monk
179d6e8e20 Change PacProxySelector to return unresolved addr
This was found by a bug in Firefox where it expects the addresses from a
ProxySelector to be unresolved.  Since ProxySelectorImpl returns unresolved
addresses the PAC version should as well to avoid breaking apps.

The ProxyServer also needed to be updated to reflect this change as it was
expecting a resolved InetSocketAddress.

Bug: 11443853
Change-Id: I3a4e9e248d22d7808603c147660df708e01cdf82
2013-10-31 14:17:48 -04:00
Jason Monk
fa4518f763 PAC Local Proxy to only receive lo connections
This changes the Local Proxy used in PAC to only accept connections coming
from the device.

Bug: 10230718
Change-Id: I5fbeb3aa018df5179a403301021f452e910a517d
2013-09-18 09:22:11 -04:00
Jason Monk
6f8a68f49a Guarantee that PAC Local Proxy owns Port
This changes the PAC support to not broadcast the Proxy information until
the Local Proxy has started up and successfully bound to a port so that
the local proxy information can be guaranteed to be owned by the proxy.

Bug: 10459877
Change-Id: I175cd3388c758c55e341115e4a8241884b90d633
2013-09-13 09:53:26 -04:00
Jason Monk
e6b4163f38 Merge "Verify inputs to PAC resolving." into klp-dev 2013-09-10 20:27:23 +00:00
Jason Monk
da205a749f System binds PAC Local Proxy instead of self start
The PAC Local Proxy priviously caught proxy broadcasts and started itself
when needed.  Now it is bound by the system the same way the pac processing
service is started.

Bug: 10425091
Change-Id: I746daa21645a11aa18ef464f00c8cb5536d8c86f
2013-08-22 16:33:26 -04:00