174833 Commits

Author SHA1 Message Date
Alex Klyubin
5927c9f1b1 Use JCA names for block modes, paddings, and digests.
This replaces int-based enums from KeyStoreKeyConstraints with
String values commonly used in JCA API.

As part of under the hood refactoring:
* KeyStoreKeyCharacteristics and KeyStoreKeyConstraints have been
  merged into KeyStoreKeyProperties.
* KeymasterUtils methods operating on KeymasterArguments and
  KeymasterCharacteristics have been moved to their respective
  classes.

Bug: 18088752
Change-Id: I9c8b984cb3c28184adb617e34d87f2837bd1d3a1
2015-04-13 09:59:04 -07:00
Alex Klyubin
a270264c61 Merge "Track more changes to keymaster_defs.h" 2015-04-10 17:51:49 +00:00
Nick Kralevich
08d76a946b Merge "Impose an ordering on created SELinuxMMAC Policy objects." 2015-04-10 16:10:27 +00:00
Alex Klyubin
55f7c2770f Track more changes to keymaster_defs.h
KeyStoreTest needed to be adjusted because OCB is no longer supported.

Bug: 18088752
Change-Id: I7594daaa5e97423d34726b07cc79e3ee28418d95
2015-04-10 08:58:38 -07:00
John Reck
a08f6a66e9 Merge "Fix GL_INVALID_OPERATION in font renderer when font cache is limited." 2015-04-10 15:32:01 +00:00
John Reck
d56e087b55 Merge "Fixing memory leak in RenderBufferCache" 2015-04-10 15:27:02 +00:00
Robert Craig
4caa6b1efb Impose an ordering on created SELinuxMMAC Policy objects.
Imposing an order on Policy objects allows us to extend the
policy writers ability to union mac_permissions.xml files.
Policy developers can now create new mac_permissions.xml
entries under their device specific directories. This is
in contrast to current methods which only allow differing
stanzas to appear outside the base mac_permissions.xml.

Also, report on stanzas with duplicate input selectors and
treat these as errors. There are some ambiguities that can
arise otherwise.

Lastly, impose an XOR condition on signer stanzas w.r.t seinfo
and package tags. This finer distinction helps the union feature
of policy to become clearer and simpler to code.

Change-Id: Idd86df8ad9a63d1b8ba6e8270670814ca6cee8d2
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
2015-04-10 11:14:37 -04:00
Tim Murray
6d718c2f43 Merge "Add support for setting the cache directory." 2015-04-10 00:51:15 +00:00
Tim Murray
47f31582b6 Add support for setting the cache directory.
Change-Id: I2bf1874705b877a8a8262ab49b47fe8241e603d5
2015-04-09 17:50:39 -07:00
Alex Klyubin
ba2836e6cf Merge "Track recent keymaster_defs.h changes." 2015-04-10 00:01:19 +00:00
Alex Klyubin
862e6c7814 Track recent keymaster_defs.h changes.
Bug: 18088752
Change-Id: If47bb7cc7a385941db9f12d478676594e9bc9d86
2015-04-09 16:58:58 -07:00
Alex Klyubin
c6eb62882b Merge "Split key origin into TEE/not and generated/imported." 2015-04-09 23:34:45 +00:00
Mathieu Chartier
da164973f3 Merge "Add dalvik subitems for -d in dumpsys meminfo "Total PSS by category"" 2015-04-09 23:14:28 +00:00
Mathieu Chartier
537691fc2d Add dalvik subitems for -d in dumpsys meminfo "Total PSS by category"
Example output of "adb shell dumpsys meminfo -d":

Total PSS by category:
   193605 kB: Dalvik
               87561 kB: .Heap
               77863 kB: .LOS
               15333 kB: .Zygote
               12848 kB: .NonMoving
                6770 kB: .GC
                2597 kB: .LinearAlloc
                1180 kB: .JITCache
                1180 kB: .IndirectRef
   103936 kB: EGL mtrack
   101827 kB: Native

Bug: 17643507

(cherry picked from commit 546edc5a31bb5a843048e11d8afb0b1f6441ddb4)

Change-Id: If34627cf93ba5305b428d2278f350a2649d63d5e
2015-04-09 15:53:17 -07:00
Alex Klyubin
b503c52f07 Split key origin into TEE/not and generated/imported.
This is to match the upcoming changes in Keymaster HAL API.

Bug: 18088752
Change-Id: I602d56d1c29a839583be1d9efa681a6fab6642db
2015-04-09 15:50:17 -07:00
Jeff Sharkey
1d3c77a21e Merge "Start passing volume UUID to installd." 2015-04-09 21:41:12 +00:00
Alex Klyubin
97d2d7c427 Merge "Fix minor issues in new Javadocs of AndroidKeyStore." 2015-04-09 21:41:00 +00:00
Alex Klyubin
7882a7fcd4 Fix minor issues in new Javadocs of AndroidKeyStore.
Bug: 18088752
Change-Id: Ie84cc6066c82f2659da17a1eb158c2e3acf5094d
2015-04-09 14:33:11 -07:00
Jeff Sharkey
790a4ecac7 Start passing volume UUID to installd.
This change adds new method overloads to provide volume UUID.  The
older methods remain for now, and pass through the "null" UUID to
reference internal storage.

Follows the existing pattern where null arguments are passed as "!".

Bug: 19993667
Change-Id: Ia1b7c8550cabc13e4f6e1182eabb650f2c33e44f
2015-04-09 14:19:07 -07:00
Alex Klyubin
aeae0f384f Merge "Add asymmetric crypto constants for AndroidKeyStore API." 2015-04-09 20:02:39 +00:00
Alex Klyubin
8c58ba87bb Merge "Add missing mapping between JCA and keystore HMAC names." 2015-04-09 19:57:13 +00:00
Alex Klyubin
ccfea5024b Add asymmetric crypto constants for AndroidKeyStore API.
Bug: 18088752
Change-Id: Iee72a4c230f3a2cd30d9eb4d29c4301f3e113f31
2015-04-09 11:38:44 -07:00
Dan Albert
d9f32b164b Merge "Ensure alignment of Res_png_9patch." 2015-04-09 18:09:11 +00:00
Dan Albert
a18cee52d9 Ensure alignment of Res_png_9patch.
This doesn't alter the alignment of the data within the struct, but
enforces that this structure will be appropriately aligned when used.

The image_info struct has this struct preceded by a bool, which causes
odd alignment for the members of this struct.

Change-Id: Ia2ef5c81b2f961c0f61858a10a7821d82f600919
2015-04-09 10:41:38 -07:00
Alex Klyubin
5324702a02 Add missing mapping between JCA and keystore HMAC names.
This is a follow-up to 70376a77280551791dae62586a6bb0c77ed9429a where
I forgot to update this mapping.

Bug: 18088752
Change-Id: I322a9abd642ddee3bd2b4f49379b121012e32836
2015-04-09 10:10:34 -07:00
Alex Klyubin
e26347bb74 Merge "Hide KeyStoreParameter.Builder.setRandomizedEncryptionRequired." 2015-04-09 16:51:02 +00:00
Alex Klyubin
223977b914 Hide KeyStoreParameter.Builder.setRandomizedEncryptionRequired.
This wasn't meant to be public API yet.

Bug: 18088752
Change-Id: I40e57fd9121348086ae88ad9fa54f930547b77ba
2015-04-09 09:50:34 -07:00
Alex Klyubin
a482b0469c Merge "Require IND-CPA by default for new AndroidKeyStore keys." 2015-04-09 16:12:09 +00:00
Richard Uhler
f324d245fd Merge "Reuse dexopt method for both dex2oat and patchoat." 2015-04-09 14:13:29 +00:00
Colin Cross
1be312dfb0 Merge "Re-enable -Wall and -Werror that were lost in a merge" 2015-04-09 00:49:56 +00:00
Colin Cross
01f185633c Re-enable -Wall and -Werror that were lost in a merge
-Wall and -Werror were lost during a merge when they were added to
aaptCFLAGS instead of aaptCFlags.  Fix the typo, and the warnings
that crept in while it was disabled.

Change-Id: Ib944b8d6149278e4f3861c1acac277bcd95cc7c2
2015-04-08 17:48:23 -07:00
Alex Klyubin
f853f64998 Require IND-CPA by default for new AndroidKeyStore keys.
Bug: 18088752
Change-Id: I01e44b7155df4326b5c9d83dda57f889c1f23ec7
2015-04-08 16:28:27 -07:00
Olawale Ogunwale
e8a3c320e6 Merge "Prevent windows from freezing screen while timeout" 2015-04-08 21:56:16 +00:00
Alex Klyubin
1da3d7fcf3 Merge "Add more digests to AndroidKeyStore API." 2015-04-08 21:32:09 +00:00
Alex Klyubin
70376a7728 Add more digests to AndroidKeyStore API.
This adds MD5, SHA-1, SHA-224, SHA-384, and SHA-512. SHA-256 was
already there.

MD5 is not exposed for HMAC on purpose, because MD5 has been
deprecated for years.

Bug: 18088752
Change-Id: I4df3d3f6cf10805c7910a1bdb577a91c85055945
2015-04-08 14:17:21 -07:00
Alex Klyubin
c0d6b7cb75 Merge "Fix typo" 2015-04-08 18:16:38 +00:00
Alex Klyubin
6895a549ec Fix typo
Change-Id: I1c47ade98ad3ae41dc55e7bcafcad6901b559c89
2015-04-08 11:08:37 -07:00
Alex Klyubin
edd0e6c098 Merge "Refuse to reuse IV in encryption mode in AndroidKeyStore." 2015-04-08 18:04:39 +00:00
Alex Klyubin
3283d2d208 Merge "Add BlockMode.GCM constant to AndroidKeyStore API." 2015-04-08 17:51:13 +00:00
Alex Klyubin
d1ccb45945 Refuse to reuse IV in encryption mode in AndroidKeyStore.
This makes IV-using Cipher implementations backed by AndroidKeyStore
refuse to be reused. After Cipher.doFinal completes, invoking update
or doFinal will raise an exception. This is to make it harder to
violate the security best practice of not reusing IV in encryption
mode.

Bug: 18088752
Change-Id: I5102f9e8b2ff428254294703e48948ea8576603d
2015-04-08 09:46:16 -07:00
tiger_huang
951e27f344 Prevent windows from freezing screen while timeout
The original logic lets windows be able to freeze screen again (by
setting win.mOrientationChanging=true) after WINDOW_FREEZE_TIMEOUT is
triggered before mInnerFields.mOrientationChangeComplete is set to
true. In this case, we would lose the protection of
WINDOW_FREEZE_TIMEOUT. If the app never finishes drawing the window,
the screen would keep freezing that the user cannot operate the
device.

Change-Id: I45a0a9e4b3f8d5b0b0043229bfa4890236ae8ab2
2015-04-08 16:10:04 +00:00
Olawale Ogunwale
393f89f26d Merge "[ActivityManager] Avoid NullPointerException if no crash info" 2015-04-08 16:07:44 +00:00
Olawale Ogunwale
1bdbce295c Merge "[ActivityManager] Finish the failed-to-pause activity" 2015-04-08 12:51:12 +00:00
louis_chang
3d86b88fa7 [ActivityManager] Avoid NullPointerException if no
crash info

Symptom:
This issue happens because the ANR process got killed
(because it crashed) before the ANR dialog dismissed.
In that case, the process record is marked as crashed
(ProcessRecord.crashing = true). When the ANR dialog
dismissed by user, it will cause NullPointerException
when writeToParcel while performing IPC because there
is no crash info (ApplicationErrorReport.crashInfo = null)

Solution:
Check crashinfo before access it

Change-Id: I2995de57684c1e13aab8297f5eea1e82ca3b7ad8
2015-04-08 18:04:11 +08:00
louis_chang
047dfd40fd [ActivityManager] Finish the failed-to-pause activity
Symptom:
In some scenario, the mPausingActivity may be replaced by other
activity. When previous activity paused, the completePausedLocked()
won't be invoked because it is no longer the mPausingActivity. If
the activity is also pending to finish, it would never be done
because the activity kept in PAUSING state. Since the activity's
window also remain visible and is above on Wallpaper, user would
see it when back to home.

Solution:
Finish the failed-to-pause activity if the activity is pending to
finish.

A Real Case:
(1) Screen turn off
(2) The top activity T1 crashed
(3) When finish activity T1, the next top activity T2 will be
    scheduled to resume and pause (due to screen off).
(4) The activity T2 is also set to finishing due to T1 crashed.
(5) Before T2 paused and before paused timeout occurs, there has
    a new process started which brings up the next top activity T3
    to resume and pause. So the pausing activity is now replaced.
(6) When activity T2 paused, it cannot completed the pause operation
    T2 will remain in PAUSING and finishing state with its window
    visible. The process won't be killed because the oomadj stays
    at 1 (Visible).

Change-Id: Ib10fded891b21c774b26a93071c717fa50516e22
2015-04-08 16:35:55 +08:00
Romain Guy
80e455e325 Merge "Prevent possible memory leak in SpanSet" 2015-04-08 06:56:26 +00:00
Jim Miller
40c4021a70 Merge "third part apps can disable the secret lockscreen" 2015-04-07 22:41:19 +00:00
Alex Klyubin
38bb642bbb Add BlockMode.GCM constant to AndroidKeyStore API.
GCM mode is not yet implemented. This is just adding a constant to
KeyStoreKeyConstraints.BlockMode.

Bug: 18088752
Change-Id: Ibba5b393f56ab9f6bb96d994f110687ab8d65ff3
2015-04-07 15:09:12 -07:00
Adam Powell
7a3c8c70a6 Merge "Fixed memory leak in ExtractEditLayout finish()" 2015-04-07 20:56:49 +00:00
Adam Powell
8391e03b7e Merge "ProgressBar: Fix error of process bar cannot update on some condition." 2015-04-07 20:56:36 +00:00