summaryrefslogtreecommitdiffstats
path: root/keystore
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | 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
* | 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
* | 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
* | Make specifying self-signed cert parameters optional.Alex Klyubin2015-04-142-40/+64
|/ | | | | | | | | | | | | 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
* 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
* | Merge "Add EcIesParameterSpec to enable ECIES crypto."Alex Klyubin2015-04-111-0/+287
|\ \
| * | Add EcIesParameterSpec to enable ECIES crypto.Alex Klyubin2015-04-101-0/+287
| | | | | | | | | | | | | | | Bug: 18088752 Change-Id: I597b019106c500188e0fbbc9608722668c08b421
* | | Merge "Fix testSaw_ungrantedUid_Bluetooth"Chad Brubaker2015-04-101-2/+2
|\ \ \ | |_|/ |/| |
| * | Fix testSaw_ungrantedUid_BluetoothChad Brubaker2015-04-101-2/+2
| |/ | | | | | | | | | | | | Keystore.saw returns [] on no result, not null, so the test was incorrectly failing. Change-Id: I22dcf85c5d6c5c0368848bc784c3215c092d9ea8
* | Track more changes to keymaster_defs.hAlex Klyubin2015-04-101-9/+5
|/ | | | | | | KeyStoreTest needed to be adjusted because OCB is no longer supported. Bug: 18088752 Change-Id: I7594daaa5e97423d34726b07cc79e3ee28418d95
* Track recent keymaster_defs.h changes.Alex Klyubin2015-04-091-2/+2
| | | | | Bug: 18088752 Change-Id: If47bb7cc7a385941db9f12d478676594e9bc9d86
* 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
* Fix minor issues in new Javadocs of AndroidKeyStore.Alex Klyubin2015-04-093-21/+14
| | | | | Bug: 18088752 Change-Id: Ie84cc6066c82f2659da17a1eb158c2e3acf5094d
* 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
* | 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
* | Hide KeyStoreParameter.Builder.setRandomizedEncryptionRequired.Alex Klyubin2015-04-091-1/+2
|/ | | | | | | This wasn't meant to be public API yet. Bug: 18088752 Change-Id: I40e57fd9121348086ae88ad9fa54f930547b77ba
* Merge "Require IND-CPA by default for new AndroidKeyStore keys."Alex Klyubin2015-04-096-12/+247
|\
| * Require IND-CPA by default for new AndroidKeyStore keys.Alex Klyubin2015-04-086-12/+247
| | | | | | | | | | Bug: 18088752 Change-Id: I01e44b7155df4326b5c9d83dda57f889c1f23ec7
* | Add more digests to AndroidKeyStore API.Alex Klyubin2015-04-084-23/+190
|/ | | | | | | | | | | 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
* Fix typoAlex Klyubin2015-04-081-1/+1
| | | | Change-Id: I1c47ade98ad3ae41dc55e7bcafcad6901b559c89
* Merge "Refuse to reuse IV in encryption mode in AndroidKeyStore."Alex Klyubin2015-04-081-14/+44
|\
| * Refuse to reuse IV in encryption mode in AndroidKeyStore.Alex Klyubin2015-04-081-14/+44
| | | | | | | | | | | | | | | | | | | | | | 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
* | Add BlockMode.GCM constant to AndroidKeyStore API.Alex Klyubin2015-04-071-1/+12
|/ | | | | | | | GCM mode is not yet implemented. This is just adding a constant to KeyStoreKeyConstraints.BlockMode. Bug: 18088752 Change-Id: Ibba5b393f56ab9f6bb96d994f110687ab8d65ff3
* Make the new AndroidKeyStore API conformant.Alex Klyubin2015-04-078-698/+470
| | | | | | | | | | | | | | | | | | | | | This makes the new AndroidKeyStore API conform with the latest Keymaster API changes as well as the latest Android framework API design guidelines. Keymaster changes: * Multiple paddings, block modes, and digests can be set on a key. * "max uses per boot" and "min seconds between use" restrictions will not be exposed in the framework API. * Padding scheme ZERO will not be exposed. Changes due to Android framework design guidelines: * Sets of enum values have been replaced with bitsets represented as ints. * Integer has been replaced with int, with null being represented with a special value (e.g., -1 or 0) where possible. Bug: 18088752 Change-Id: Ib21739aa9b42d48895cb7a681e836a5c6d972ac6
* Load fewer classes when AndroidKeyStore provider is installed.Alex Klyubin2015-04-031-15/+23
| | | | | | | | | | This avoids loading all AndroidKeyStore crypto SPI classes when the AndroidKeyStore provider is instantiated and installed. This provider is installed early on during the initialization of each app. Most apps don't need these classes loaded. Bug: 18088752 Change-Id: Ib43c9dd6a7d434b128916e0f9c8652ba61df0d47
* Merge "Rename KeymasterException to KeyStoreException."Alex Klyubin2015-04-037-51/+75
|\
| * Rename KeymasterException to KeyStoreException.Alex Klyubin2015-04-027-51/+75
| | | | | | | | | | | | | | | | | | | | | | | | The code in question talks to KeyStore which returns error codes which are a mix of keystore and keymaster error codes. To better match the layering of KeyStore on top of keystore and keymaster, this CL renames KeymasterException into KeyStoreException. It also adds human-readable error messages to exceptions raised by keystore rather than keymaster (e.g., key not found). Bug: 18088752 Change-Id: I4cd1235e16518c9f2e8c5557a457774c6e687b88
* | Merge "Mark all test keys as no auth required"Chad Brubaker2015-04-031-0/+32
|\ \
| * | Mark all test keys as no auth requiredChad Brubaker2015-04-021-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that auth token checks are in keystore keys without any auth tags are invalid. Also adds a test to check that a key with auth required fails when none is present. Change-Id: I0d5d44d70a849978e9b2e809675b8343c6650ff2
* | | Obtain SPI without using Reflection.Alex Klyubin2015-04-031-14/+7
| |/ |/| | | | | | | Bug: 18088752 Change-Id: I76d42e17f5f28af6fd9a96ee812d286f6c6a085b
* | Merge "Improve the AndroidKeyStore-backed HMAC state machine."Alex Klyubin2015-04-022-10/+18
|\ \
| * | Improve the AndroidKeyStore-backed HMAC state machine.Alex Klyubin2015-04-012-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | This defers the start of a new KeyStore operation after Mac.doFinal until the next Mac.update or .doFinal. Previously, the a new KeyStore operation was started immediately, at the end of doFinal. Bug: 18088752 Change-Id: I2d594067ef261f519631d09f7a6087b715801656
* | | Merge "Expose new key use constraints in KeyPairGeneratorSpec."Alex Klyubin2015-04-023-17/+458
|\ \ \
| * | | Expose new key use constraints in KeyPairGeneratorSpec.Alex Klyubin2015-04-023-17/+458
| |/ / | | | | | | | | | | | | | | | | | | The constraints are currently ignored. Bug: 18088752 Change-Id: Iabd2018200afb2bf8ac1748d1def47af74bfb9d3
* | | Add exception types for AndroidKeyStore key validity issues.Alex Klyubin2015-04-014-0/+115
|/ / | | | | | | | | Bug: 18088752 Change-Id: I7494cb6a793e2b57bb849a4253bba2803778c161
* | Use Keymaster-friendly validity dates.Alex Klyubin2015-04-013-27/+41
| | | | | | | | | | | | | | | | | | | | Keymaster HAL currently requires that key validity start and end dates always be specified. The framework API does not. This CL expresses the framework API's "not specified" instants to Keymaster as instants in distant past or future. Bug: 18088752 Change-Id: Ia9d66d5e57bfca30628cdef6e0925a2781a3acfb
* | Merge "Hook in user authenticators and their exceptions."Alex Klyubin2015-04-019-30/+159
|\ \
| * | Hook in user authenticators and their exceptions.Alex Klyubin2015-03-319-30/+159
| | | | | | | | | | | | | | | Bug: 18088752 Change-Id: I2835dbe51d09587a3081597c6aaf536aa1427e24
* | | A way to obtain KeyStore operation handle from crypto primitives.Alex Klyubin2015-03-314-3/+103
|/ / | | | | | | | | | | | | | | | | | | This adds AndroidKeyStore.getKeyStoreOperationHandle method which can be used to obtain the KeyStore operation handle corresponding to the provided JCA cryto primitive (provided it's backed by AndroidKeyStore). Bug: 18088752 Change-Id: Iaa3b6f9b2281b2ec2de8fd5946d353dc7fdb3d2d
* | Add license banner to recently added AndroidKeyStore files.Alex Klyubin2015-03-3114-0/+224
| | | | | | | | | | Bug: 18088752 Change-Id: I027f9530a02cca081aae8eb94833d2fdcb678e9a
* | Add SecretKeyFactory backed by AndroidKeyStore.Alex Klyubin2015-03-316-1/+445
|/ | | | | | | | | | | | | | | | This factory provides a way to obtain information about a SecretKey backed by AndroidKeyStore. The information is provided in a form of an instance of KeyStoreKeySpec class. EXAMPLE SecretKeyFactory factory = SecretKeyFactory.getInstance( key.getAlgorithm(), "AndroidKeyStore"); KeyStoreKeySpec keySpec = factory.getKeySpec(key, KeyStoreKeySpec.class); Bug: 18088752 Change-Id: I26c9dd544f80230fe7039501eeb471eaf875452b
* Add unauthenticated AES ciphers backed by AndroidKeyStore.Alex Klyubin2015-03-317-111/+758
| | | | | | | | | | | | This adds the following AES transformations: * AES/ECB/NoPadding * AES/ECB/PKCS7Padding * AES/CBC/NoPadding * AES/CBC/PKCS7Padding * AES/CTR/NoPadding Bug: 18088752 Change-Id: I3e4702e59868f8f2225c31b1c159d20008b9999d
* Merge "Add HmacSHA256 backed by AndroidKeyStore."Alex Klyubin2015-03-309-4/+472
|\
| * Add HmacSHA256 backed by AndroidKeyStore.Alex Klyubin2015-03-309-4/+472
| | | | | | | | | | | | | | | | This also adds the MAC length constraint on imported HMAC keys. HMAC doesn't work without this constraint at the moment. Bug: 18088752 Change-Id: I8613f58f5d2a84df00bcf6179d13e30619440330