summaryrefslogtreecommitdiffstats
path: root/keystore/java/android
Commit message (Collapse)AuthorAgeFilesLines
* Surface KeyPermanentlyInvalidatedException for per-op auth keys.Alex Klyubin2015-04-292-0/+20
| | | | | Bug: 20642549 Change-Id: Ibda270921f13a1fd695264583b0e4bd255f63aed
* Enable per-use user authenticated keys to be used.Alex Klyubin2015-04-293-2/+12
| | | | | | | | | | | | This makes symmetric Cipher and Mac implementations backed by AndroidKeyStore succeed in their initialization when the key is configured to require user authentication for every use. Users of such keys should obtain an instance of Cipher or Mac, initialize it with the key, and then authorize the operation by passing this Cipher or Mac instance to FingerprintManager.authenticate. Bug: 18088752 Change-Id: Ia15a1e5f8274c3623f665dae1f400ff539639ab1
* Add KeyPermanentlyInvalidatedException.Alex Klyubin2015-04-298-73/+130
| | | | | | | | | | | | | | | | | | | This enables users of AndroidKeyStore crypto to differentiate between the key being unusable until the user is authenticated (UserNotAuthenticatedException) and the key being permanently unusable (KeyPermanentlyInvalidatedException). The latter is the case when the secure lock screen has been disabled or reset, and, for keys that require user authentication for every use, when a new fingerprint is enrolled or all fingerprints are unenrolled. NOTE: The KeyPermanentlyInvalidatedException subsumes/replaces the NewFingerprintEnrolledException which has thus been removed. There is no way to find out whether a key was permenently invalidated specifically because a new fingerprint was added. Bug: 20642549 Bug: 20526234 Change-Id: I0206cd99eef5c605c9c4d6afc5eea02eb3b1fe6b
* Merge "Add OP_AUTH_NEEDED KeyStore result code" into mnc-devChad Brubaker2015-04-291-0/+8
|\
| * Add OP_AUTH_NEEDED KeyStore result codeChad Brubaker2015-04-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | OP_AUTH_NEEDED will be returned from begin when an operation needs a per operation authentication before calling update. Note that the begin call succeeds when this error is returned, the token and handle are valid. (cherry picked from commit dabe520a3e6b0d0c40adfd748483fa336c43c366) Change-Id: I0ba4e997360843b5eb6c1db9c5fcd1c4d5a2c717
* | Align AndroidKeyStore API with user auth API.Alex Klyubin2015-04-289-362/+216
|/ | | | | | | | | | | | | | | This simplifies the AndroidKeyStore API around user authentication: no more explicit control over which user authenticators are bound to which keys. User-authenticated keys with timeout are unlocked by whatever unlocks the secure lock screen (currently, password/PIN/pattern or fingerprint). User-authenticated keys that need authentication for every use are unlocked by fingerprint only. Bug: 20526234 Bug: 20642549 Change-Id: I1e5e6c988f32657d820797ad5696797477a9ebe9
* am 6c1af7ea: am 8652bce1: am c71f2648: Merge "frameworks/base: switch to ↵Kenny Root2015-04-242-10/+10
|\ | | | | | | | | | | | | using NativeConstants." * commit '6c1af7ea497b1a2f04bdf45a19d2147f5b9665b9': frameworks/base: switch to using NativeConstants.
| * Merge "frameworks/base: switch to using NativeConstants."Kenny Root2015-04-242-10/+10
| |\
| | * frameworks/base: switch to using NativeConstants.Adam Langley2015-04-242-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NativeCrypto is a conscrypt class that contained several OpenSSL constants. NativeConstants is the new class that contains the same thing, but the latter is automatically generated and thus won't drift from the C headers. Bug: 20521989 Change-Id: I45c7b9a6844a06e3ffd09be692ebf733e1ebbbcc
* | | resolved conflicts for merge of f9c14b7d to masterAlex Klyubin2015-04-2411-94/+105
|\ \ \ | |/ / | | | | | | Change-Id: Ifa29891b8ad7979cbc28c54180b9606bb1319ff0
| * | No runtime exceptions during normal use of AndroidKeyStore crypto.Alex Klyubin2015-04-2410-95/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the implementation of AndroidKeyStore-backed Cipher and Mac to avoid throwing runtime exceptions during normal use. Runtime exceptions will now be thrown only due to truly exceptional and unrecoverable errors (e.g., keystore unreachable, or crypto primitive not initialized). This also changes the implementation of Cipher to cache any errors encountered in Cipher.update until Cipher.doFinal which then throws them as checked exceptions. Bug: 20525947 Change-Id: I3c4ad57fe70abfbb817a79402f722a0208660727
* | | am edf5454a: am 3167fb4b: am 71223ebe: Merge "Reset AndroidKeyStore Mac and ↵Alex Klyubin2015-04-242-22/+79
|\ \ \ | |/ / | | | | | | | | | | | | | | | Cipher state when init fails." * commit 'edf5454a14cc53de92eaf1ef15fcfb21d8caccca': Reset AndroidKeyStore Mac and Cipher state when init fails.
| * | Reset AndroidKeyStore Mac and Cipher state when init fails.Alex Klyubin2015-04-242-22/+79
| |/ | | | | | | | | | | | | | | For consistency, this also switches AndroidKeyStore's Mac init/reset implementation to the same approach as used in Cipher. Bug: 18088752 Change-Id: Id34caf7cfe04f2058e22d8632890f762927bb31c
* | Merge "Set Secure User ID from app level."Alex Klyubin2015-04-163-0/+42
|\ \
| * | Set Secure User ID from app level.Alex Klyubin2015-04-163-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When AndroidKeyStore keys require used authentication, they need to be bound to a Keymaster's Secure User ID. This ID will be set by keystore soon. Until then, set it from the framework level (i.e., from apps which use AndroidKeyStore). NOTE: Accessing gatekeeper to obtain the Secure User ID will be blocked by SELinux policy. To test this code, disable SELinux enforcing mode. Bug: 18088752 Change-Id: I7a3315eb52f0fc978d14d5d0e9613f2f36c6c01e
* | | Unhide KeyStoreKeyProperties.Origin.UNKNOWN.Alex Klyubin2015-04-161-3/+1
|/ / | | | | | | | | Bug: 18088752 Change-Id: Idaed45d7e84f5f3eb4f623552b60206c504e967a
* | am b1aa7d0b: am 51884f0e: am 499126c4: Merge "Add Keymaster ↵Alex Klyubin2015-04-161-1/+11
|\ \ | |/ | | | | | | | | | | KM_ORIGIN_UNKNOWN constant." * commit 'b1aa7d0bc821614d943075c0d786cc3f5eeb8c73': Add Keymaster KM_ORIGIN_UNKNOWN constant.
| * Merge "Add Keymaster KM_ORIGIN_UNKNOWN constant."Alex Klyubin2015-04-161-1/+11
| |\
| | * Add Keymaster KM_ORIGIN_UNKNOWN constant.Alex Klyubin2015-04-141-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | This tracks d359b044830b292f492f8a8df5471f869e358399 from hardware/libhardware. Bug: 18088752 Change-Id: I9a7bd8bdee51c18ae0427eff4efe036213d2b175
* | | am 22b5d9b9: am 28a9089f: am 216d18b9: Merge "Remove IV auto-generation ↵Alex Klyubin2015-04-161-12/+6
|\ \ \ | |/ / | | | | | | | | | | | | | | | workaround." * commit '22b5d9b969176a196b0b29ce9441ac3d1d35d208': Remove IV auto-generation workaround.
| * | Remove IV auto-generation workaround.Alex Klyubin2015-04-151-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This workaround prevents use of keys with randomized encryption (IND-CPA). Since randomized encryption is on by default, it's better to keep it working and break non-randomized encryption (until Keymaster is fixed). Bug: 18088752 Change-Id: I4b11ce72cff705be41d3e66f28b507d6ddc1da79
* | | am 763100e6: am 1cb119d3: am 71ba4e46: Merge "Unbreak obtaining symmetric ↵Shawn Willden2015-04-151-5/+10
|\ \ \ | |/ / | | | | | | | | | | | | | | | keys from AndroidKeyStore." * commit '763100e6442494a85cfcb7949c8021836071b1f6': Unbreak obtaining symmetric keys from AndroidKeyStore.
| * | Unbreak obtaining symmetric keys from AndroidKeyStore.Alex Klyubin2015-04-141-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | This tracks 59f977c6988e21b3b8aa6c83428bd6ee1a98816d due to which AndroidKeyStore is unable to provide symmetric keys because it assumes that the digest field is not repeating. Bug: 18088752 Change-Id: Ie8ed01449280b7c759e81aeaf2066953b0abaf2a
* | | resolved conflicts for merge of 1d5a2592 to masterAlex Klyubin2015-04-141-29/+2
|\ \ \ | |/ / | | | | | | Change-Id: Ia1ea7c9c8c23eeffcd596b96506e961989ccb7a6
| * | Merge "No need to specify EC curve name in EcIesParameterSpec."Alex Klyubin2015-04-141-25/+2
| |\ \
| | * | No need to specify EC curve name in EcIesParameterSpec.Alex Klyubin2015-04-131-25/+2
| | |/ | | | | | | | | | | | | | | | | | | EC curve parameters will be obtained from the provided EC key. Bug: 18088752 Change-Id: Ic99353a6566c8d4ce2b6b73d0309edaa40f84fa6
* | | am fa2bd4fe: am 888f5cb7: am ecfda064: Merge "Make specifying self-signed ↵Alex Klyubin2015-04-141-10/+38
|\ \ \ | |/ / | | | | | | | | | | | | | | | cert parameters optional." * commit 'fa2bd4fe5c10b8132a155f0f8d0207435ca2c8dc': Make specifying self-signed cert parameters optional.
| * | Make specifying self-signed cert parameters optional.Alex Klyubin2015-04-141-10/+38
| |/ | | | | | | | | | | | | | | | | | | | | | | | | This removes the need to specify the three parameters of the self-signed certificate (serial number, subject, validity range) when generating key pairs in AndroidKeyStore. This is achieved by providing sensible defaults for these parameters: * serial number: 1 * subject: CN=fake * validity range: Jan 1 1970 to Jan 1 2048. Bug: 18088752 Change-Id: I5df918b1ef8b26ed3ddd43828c4c78c9fa58cd43
* | Unhide the new AndroidKeyStore API.Alex Klyubin2015-04-1312-129/+10
| | | | | | | | | | Bug: 18088752 Change-Id: I93f87cbb1cd04a4a2e34f3d544d678c92cf052ee
* | resolved conflicts for merge of a978a3d6 to masterAlex Klyubin2015-04-1315-1456/+1099
|\ \ | |/ | | | | Change-Id: Ifd7ca9e1dfa0d50a87f2bafef377fcaeb5d9f6d5
| * Merge "Use JCA names for block modes, paddings, and digests."Alex Klyubin2015-04-1315-1446/+1089
| |\
| | * Use JCA names for block modes, paddings, and digests.Alex Klyubin2015-04-1315-1446/+1089
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am 651dbfde: am ad48c4c9: am c1c6528d: Merge "Add EcIesParameterSpec to ↵Alex Klyubin2015-04-111-0/+287
|\ \ \ | |/ / | | | | | | | | | | | | | | | enable ECIES crypto." * commit '651dbfde73171ad6451dc8f9288fa4df50f99e4c': Add EcIesParameterSpec to enable ECIES crypto.
| * | Add EcIesParameterSpec to enable ECIES crypto.Alex Klyubin2015-04-101-0/+287
| |/ | | | | | | | | Bug: 18088752 Change-Id: I597b019106c500188e0fbbc9608722668c08b421
* | am 037dfb94: am 5f8c17b9: am ba2836e6: Merge "Track recent keymaster_defs.h ↵Alex Klyubin2015-04-101-2/+2
|\ \ | |/ | | | | | | | | | | changes." * commit '037dfb9423a0988398b67520546dae5673aa54bb': Track recent keymaster_defs.h changes.
| * Track recent keymaster_defs.h changes.Alex Klyubin2015-04-091-2/+2
| | | | | | | | | | Bug: 18088752 Change-Id: If47bb7cc7a385941db9f12d478676594e9bc9d86
* | am 04a99c7b: am 82cba6aa: am c6eb6288: Merge "Split key origin into TEE/not ↵Alex Klyubin2015-04-103-15/+29
|\ \ | |/ | | | | | | | | | | and generated/imported." * commit '04a99c7b4435598e4f9d53fadbe5faca4ad7ebdc': Split key origin into TEE/not and generated/imported.
| * Split key origin into TEE/not and generated/imported.Alex Klyubin2015-04-093-15/+29
| | | | | | | | | | | | | | This is to match the upcoming changes in Keymaster HAL API. Bug: 18088752 Change-Id: I602d56d1c29a839583be1d9efa681a6fab6642db
* | am 4acc3392: am 8676a88e: am 97d2d7c4: Merge "Fix minor issues in new ↵Alex Klyubin2015-04-093-21/+14
|\ \ | |/ | | | | | | | | | | Javadocs of AndroidKeyStore." * commit '4acc3392c35e5ad98c8e7b650b1368a2956746b7': Fix minor issues in new Javadocs of AndroidKeyStore.
| * Fix minor issues in new Javadocs of AndroidKeyStore.Alex Klyubin2015-04-093-21/+14
| | | | | | | | | | Bug: 18088752 Change-Id: Ie84cc6066c82f2659da17a1eb158c2e3acf5094d
* | am 098833c5: am ec01623b: am aeae0f38: Merge "Add asymmetric crypto ↵Alex Klyubin2015-04-091-5/+98
|\ \ | |/ | | | | | | | | | | constants for AndroidKeyStore API." * commit '098833c59d8b3984e3983169b460198c2d5e2670': Add asymmetric crypto constants for AndroidKeyStore API.
| * Merge "Add asymmetric crypto constants for AndroidKeyStore API."Alex Klyubin2015-04-091-5/+98
| |\
| | * Add asymmetric crypto constants for AndroidKeyStore API.Alex Klyubin2015-04-091-5/+98
| | | | | | | | | | | | | | | Bug: 18088752 Change-Id: Iee72a4c230f3a2cd30d9eb4d29c4301f3e113f31
* | | am c6112eb7: am 21c4e465: am 8c58ba87: Merge "Add missing mapping between ↵Alex Klyubin2015-04-092-0/+11
|\ \ \ | |/ / | | | | | | | | | | | | | | | JCA and keystore HMAC names." * commit 'c6112eb7057f91df1f885da37564f89a423f64e4': Add missing mapping between JCA and keystore HMAC names.
| * | Merge "Add missing mapping between JCA and keystore HMAC names."Alex Klyubin2015-04-092-0/+11
| |\ \ | | |/ | |/|
| | * Add missing mapping between JCA and keystore HMAC names.Alex Klyubin2015-04-092-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to 70376a77280551791dae62586a6bb0c77ed9429a where I forgot to update this mapping. Bug: 18088752 Change-Id: I322a9abd642ddee3bd2b4f49379b121012e32836
* | | am bbf3cc57: am fd168151: am e26347bb: Merge "Hide ↵Alex Klyubin2015-04-091-1/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | KeyStoreParameter.Builder.setRandomizedEncryptionRequired." * commit 'bbf3cc5797293dc915d7ecfe41e85bbe5682548d': Hide KeyStoreParameter.Builder.setRandomizedEncryptionRequired.
| * | Hide KeyStoreParameter.Builder.setRandomizedEncryptionRequired.Alex Klyubin2015-04-091-1/+2
| |/ | | | | | | | | | | | | This wasn't meant to be public API yet. Bug: 18088752 Change-Id: I40e57fd9121348086ae88ad9fa54f930547b77ba
* | resolved conflicts for merge of b9a9d46c to masterAlex Klyubin2015-04-096-12/+249
|\ \ | |/ | | | | Change-Id: Ibec45f0f8f9618dd7bd1b34561dccbdd9599cdeb
| * Merge "Require IND-CPA by default for new AndroidKeyStore keys."Alex Klyubin2015-04-096-12/+247
| |\