summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* keystore: Fix SoterTest issuesHEADreplicant-6.0-0004-transitionreplicant-6.0-0004-rc6replicant-6.0-0004-rc5-transitionreplicant-6.0-0004-rc5replicant-6.0-0004-rc4replicant-6.0-0004-rc3replicant-6.0-0004-rc2replicant-6.0-0004-rc1replicant-6.0-0004replicant-6.0-0003replicant-6.0-0002replicant-6.0-0001cm-13.0AnilKumar Chimata2016-08-201-1/+2
| | | | | | | One of the SoterTest apk test is failing due to garbage value seen when logging params.blob.data in keystore. Change-Id: I8bb12bd85380c73822a7aaf1b0e0914e6b3a46a8
* keystore: Add SOTER support in keystoreMao Li2016-08-191-0/+25
| | | | | | Get and append the ASK key blob to the params set for SOTER. Change-Id: Id4d935af5b62e01727eeb23e72e31b5c00bd2587
* Merge tag 'android-6.0.1_r22' of ↵staging/cm-13.0+r22stable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2KSteve Kondik2016-03-100-0/+0
|\ | | | | | | | | | | https://android.googlesource.com/platform/system/security into cm-13.0 Android 6.0.1 release 22
| * keep history after reset to mnc-dr-devBaligh Uddin2016-01-250-0/+0
| |\
| | * Limit maximum number of concurrent keystore operations.Shawn Willden2015-11-022-12/+35
| | |\ | | |/ | |/| | | | | | | | | | | | | am: ddab0bb513 * commit 'ddab0bb51320af9f277d98a4e36e77ea527503e5': Limit maximum number of concurrent keystore operations.
| * | Limit maximum number of concurrent keystore operations.Shawn Willden2015-10-302-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If keystore is allowed to consume all 16 of the keymaster operation table slots, cryptfs may not be able to use keymaster to protect the disk encryption key during a password change. This CL prevents keystore from allowing more than 15 concurrent keystore operations, leaving one available for cyptfs. Bug: 25312003 Change-Id: I3bcae59c6a79d5f7d2e2f432251bb7b818f57581
| | * am 410ba59a: Fix failure to save master key on new profileChad Brubaker2015-10-121-4/+48
| | |\ | | |/ | |/| | | | | | | * commit '410ba59a76a8feb48ffb5bde3045ac6f76db0c36': Fix failure to save master key on new profile
| | * Prepare for BoringSSL update.Adam Langley2015-10-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change tweaks things as needed so that the code will compile against both the BoringSSL that's currently in Android and a version from upstream. The BORINGSSL_201509 define is temporary to allow the switch to happen without breaking the build and a followup change will remove it. (cherry picked from commit 9eb9295d78a4fbfb4b4916d597a5fcb6ee2d5677) Change-Id: I3d09b5644661353723803bcbda937d34455849a5
* | | Merge tag 'android-6.0.1_r3' of ↵stable/cm-13.0-ZNH0ESteve Kondik2015-12-082-16/+83
|\ \ \ | | | | | | | | | | | | | | | | | | | | https://android.googlesource.com/platform/system/security into HEAD Android 6.0.1 release 3
| * | | Limit maximum number of concurrent keystore operations.Shawn Willden2015-11-022-12/+35
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If keystore is allowed to consume all 16 of the keymaster operation table slots, cryptfs may not be able to use keymaster to protect the disk encryption key during a password change. This CL prevents keystore from allowing more than 15 concurrent keystore operations, leaving one available for cyptfs. Bug: 25312003 Change-Id: I3bcae59c6a79d5f7d2e2f432251bb7b818f57581
| * / Fix failure to save master key on new profileChad Brubaker2015-10-091-4/+48
| |/ | | | | | | | | | | | | | | | | | | | | | | | | New profiles use the master key of the parent user for keystore. Unfortunately copyMasterKey only copies the key from the parent to the user in memory but doesn't save it to disk, causing the child user to be uninitialized after a reboot. Bug: 23889443 (cherry picked from commit 79e0f6440aee69659bc01a0669a329dbaeaf471c) Change-Id: I1f148fde3862d22292dfce217aacdc3f70f9c2ef
* | Merge tag 'android-6.0.0_r26' into HEADRicardo Cerqueira2015-11-050-0/+0
|\| | | | | | | | | | | | | | | | | Android 6.0.0 release 26 Conflicts: keystore/keystore.cpp Change-Id: I32d4dc7cee4a7b1996f31d76bae94d0a408cacc3
| * Merge "Wrap incomplete keymaster1 implementations with sw keymaster." into ↵Shawn Willden2015-08-131-73/+175
| |\ | | | | | | | | | mnc-dr-dev
| | * Wrap incomplete keymaster1 implementations with sw keymaster.Shawn Willden2015-08-101-73/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SoftKeymasteDevice can provide software digesting and padding for keymaster1 implementations that don't provide all of the required digests. This CL modifies keymaster to check for such keymaster1 implementations and add a SoftKeymasterDevice wrapper. The SoftKeymasterDevice work necessary to make this function would have required adding an implementation of the keymaster0 API import_keypair in terms of keymaster1 API calls (import_key). Rather than do that, I instead implemented the relevant keystore function directly on the keymaster1 API. This approach is cleaner than adding the same code into the translation layer, and allows removal of the last vestiges of keymaster0 API usage from keystore. Bug: 22529223 Change-Id: Ie4c7bba7943a549f35df3086dccea001edb5bb2b
* | | Wrap incomplete keymaster1 implementations with sw keymaster.Shawn Willden2015-10-161-73/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SoftKeymasteDevice can provide software digesting and padding for keymaster1 implementations that don't provide all of the required digests. This CL modifies keymaster to check for such keymaster1 implementations and add a SoftKeymasterDevice wrapper. The SoftKeymasterDevice work necessary to make this function would have required adding an implementation of the keymaster0 API import_keypair in terms of keymaster1 API calls (import_key). Rather than do that, I instead implemented the relevant keystore function directly on the keymaster1 API. This approach is cleaner than adding the same code into the translation layer, and allows removal of the last vestiges of keymaster0 API usage from keystore. Bug: 24873723 Change-Id: Ie4c7bba7943a549f35df3086dccea001edb5bb2b
* | | keystore: Read KeyBlob after type changeZhen Kong2015-10-061-0/+9
|/ / | | | | | | | | | | | | During type change, the keyblob gets encrypted, read keyblob again to decrypt the keyblob. Change-Id: I74e9c4b835e165d71a5e4a265496247bf72a6737
* | am 8a2c33b6: (-s ours) am 48d998cd: am aca71139: am 738d1e9d: am 1b8885ba: ↵Chad Brubaker2015-08-130-0/+0
|\ \ | | | | | | | | | | | | | | | | | | am 0d593526: Properly check for Blob max length * commit '8a2c33b6f9b28e18a2a59d1fa0e11cf553a51eac': Properly check for Blob max length
| * \ am 48d998cd: am aca71139: am 738d1e9d: am 1b8885ba: am 0d593526: Properly ↵Chad Brubaker2015-08-121-4/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | check for Blob max length * commit '48d998cd4982554f9b66b029331dab17154299cc': Properly check for Blob max length
| | * \ am aca71139: am 738d1e9d: am 1b8885ba: am 0d593526: Properly check for Blob ↵Chad Brubaker2015-08-121-4/+4
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | max length * commit 'aca711395dd65d05b48c8bec3b1d2da8d81d41b8': Properly check for Blob max length
| | | * \ am 738d1e9d: am 1b8885ba: am 0d593526: Properly check for Blob max lengthChad Brubaker2015-08-121-4/+4
| | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | * commit '738d1e9d0ec29964f01211ceb6f471d6666b2316': Properly check for Blob max length
| | | | * \ am 1b8885ba: am 0d593526: Properly check for Blob max lengthChad Brubaker2015-08-121-4/+4
| | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1b8885baf5ebe2e2e6fdfe6e53174fd79f46ae11': Properly check for Blob max length
| | | | | * \ am 0d593526: Properly check for Blob max lengthChad Brubaker2015-08-121-4/+4
| | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '0d5935262dbbcaf2cf6145529ffd71a728ef4609': Properly check for Blob max length
| | | | | | * | Properly check for Blob max lengthChad Brubaker2015-08-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sizeof(mBlob.value) is incorrect because writeBlob pads up to the next AES_BLOCK_SIZE Bug:22802399 Change-Id: I377edca2c7ea2cf4455f22f5f927fdad79893729
* | | | | | | | Properly check for Blob max lengthChad Brubaker2015-08-121-4/+4
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sizeof(mBlob.value) is incorrect because writeBlob pads up to the next AES_BLOCK_SIZE Bug:22802399 Change-Id: I377edca2c7ea2cf4455f22f5f927fdad79893729
* | | | | | | am c761a1ed: (-s ours) am 63bc525c: am 853b8d79: am fd1ad379: am 1c73457a: ↵Chad Brubaker2015-08-050-0/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am b124c9e8: Fix unchecked length in Blob creation * commit 'c761a1ed08d110348bdc897804f3ba59d746579f': Fix unchecked length in Blob creation
| * | | | | | am 63bc525c: am 853b8d79: am fd1ad379: am 1c73457a: am b124c9e8: Fix ↵Chad Brubaker2015-08-051-1/+9
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unchecked length in Blob creation * commit '63bc525c24efc3a1f6386a4e0e395a4c70a335ca': Fix unchecked length in Blob creation
| | * | | | | am 853b8d79: am fd1ad379: am 1c73457a: am b124c9e8: Fix unchecked length in ↵Chad Brubaker2015-08-031-1/+9
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blob creation * commit '853b8d7984673976f943fc1664012598cb040696': Fix unchecked length in Blob creation
| | | * | | | am fd1ad379: am 1c73457a: am b124c9e8: Fix unchecked length in Blob creationChad Brubaker2015-08-031-1/+9
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'fd1ad3790fb089485cf7afc07f8b9f53d4c3136a': Fix unchecked length in Blob creation
| | | | * | | am 1c73457a: am b124c9e8: Fix unchecked length in Blob creationChad Brubaker2015-08-031-1/+9
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1c73457afe3cb0afbc2a2884c41cfdd1148aca36': Fix unchecked length in Blob creation
| | | | | * | am b124c9e8: Fix unchecked length in Blob creationChad Brubaker2015-08-031-1/+9
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b124c9e86a5f8466f527501c6677b4b1b165c0b1': Fix unchecked length in Blob creation
| | | | | | * Fix unchecked length in Blob creationChad Brubaker2015-07-291-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications can specify arbitrary blobs using insert(), check their length to prevent overflow issues. Bug:22802399 Change-Id: I4097bd891c733914df70da5e2c58783081d913bf
* | | | | | | Fix unchecked length in Blob creationChad Brubaker2015-07-291-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications can specify arbitrary blobs using insert(), check their length to prevent overflow issues. Bug:22802399 Change-Id: I4097bd891c733914df70da5e2c58783081d913bf
* | | | | | | Add all digests and padding modes to legacy keysShawn Willden2015-07-271-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 22556114 Change-Id: I44fda03305ddd50cb4ba3c6f6b24cfd9c2af9659
* | | | | | | Mark 0 length files as corruptChad Brubaker2015-07-171-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Files created by keystore should never be 0 length however a vendor ran into such a case when testing their keymaster and a side effect of how keystore parses files leads to these keys being considered encrypted and ulitmately undeletable. Now mark 0 length files as corrupt in readKey and when deleting a key if the key fails to read in because it was corrupt simply rm the file since it is not possible to feed the key blob to keymaster's delete method. Bug: 22561219 Change-Id: Ie8c1ffe97d1d89c202cdab7a6b4b5efc914cbbff
* | | | | | | Fix erroneous reporting of all tokens as timed out.Shawn Willden2015-06-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 22205545 Change-Id: I170e798b327020ff741031ec05e875c685a49e9d
* | | | | | | Rename keymaster tag types to clarify that integers are unsigned.Shawn Willden2015-06-241-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 22008538 Change-Id: Id6e3ca5c1defc8149b7ae7de5787b3635e2a4262
* | | | | | | Merge "Abort operation pruning only if it fails to make space." into mnc-devAlex Klyubin2015-06-233-3/+17
|\ \ \ \ \ \ \
| * | | | | | | Abort operation pruning only if it fails to make space.Alex Klyubin2015-06-233-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | keystore service's begin operation may sometimes encounter a situation where the underlying device's begin operation fails because of too many operations in progress. In that case, keystore attempts to prune the oldest pruneable operation by invoking the underlying device's abort operation. Regardless of whether the abort operation fails, keystore then removes the operation from the list of in-progress prunable operations. The issue is that when the underlying device's abort operation fails, keystore fails the begin operation that caused all this prunining. This is despite the fact that keystore has managed to make space for one more operation. The fix is to fail the begin operation only if the pruning attempt did not make space for a a new operation. Bug: 22040842 Change-Id: Id98b2c6690de3cfb2a7b1d3bdd10742cc59ecbfa
* | | | | | | | Don't ignore errors from begin operation.Alex Klyubin2015-06-231-2/+3
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug introduced by 9221bff2f13451ef330135bb32ea96de2a8b09cc which invoked authorization checks after begin operation, while ignoring any errors returned by that operation. This CL restrores the correct order: authorization checks are followed by begin operation. Bug: 22039986 Change-Id: I3516cb120c21b9659289faa5d1ca0225df35a06d
* | | | | | | Fully support uint64 key validity dates.Alex Klyubin2015-06-231-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the issue where, on 32-bit platforms, keys expiring after about 2^31 - 1 seconds since epoch (Jan 19 2038) might be treated as already expired. The issue was caused by using time_t (signed 32-bit on 32-bit platforms) as current time and downcasting uint64 activation and expiration time instants to time_t to compare them to current time. This downcasting could make future time instants appear to be in the past on 32-bit platforms. Bug: 22015107 Change-Id: Iae12019c3c019beb92d791fda80b622fa5c4ac4e
* | | | | | | Add keymaster authorization policy enforcement to keystore.Shawn Willden2015-06-195-17/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 19511945 Change-Id: I76c04e8d3253ba490cedac53bbc75943ec68df1d
* | | | | | | Merge "Remove exist check from doLegacySignVerify" into mnc-devChad Brubaker2015-06-181-5/+5
|\ \ \ \ \ \ \
| * | | | | | | Remove exist check from doLegacySignVerifyChad Brubaker2015-06-171-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exist requires the keystore exist permission which callers of sign/verify may not have. Instead log key not found if begin returns ::KEY_NOT_FOUND. Bug: 21658885 Change-Id: I8c42f3a636a248e3fb1f0344bf32667fce57f667
* | | | | | | | Don't check authorizations for pubkey operations.Shawn Willden2015-06-175-24/+53
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 21877150 Change-Id: I43dafb66fc3246f4d8e3bf4743fbdcbe072468d1
* | | | | | | Rewrite legacy methods in terms of new methodsChad Brubaker2015-06-082-233/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite generate, import, get_pubkey, sign and verify using the new keymaster 1.0 methods (generateKey, exportKey, and begin/update/finish). This also removed DSA support from generate and import. Change-Id: I6c6baec4aa86325a2b9c171b9883ba5a0b47236e
* | | | | | | Allow keymaster 0.3 keys to interopt with keymaster 1.0 methodsChad Brubaker2015-06-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keymaster 0.3 keys are all valid keymaster 1.0 keys, so allow get to return a keymaster 0.3 when looking for a 1.0 key to allow new methods to work on old keys. Change-Id: I20a32e39769a548224bcca7a42ef967285431c5d
* | | | | | | Merge "Add optional additional entropy to finish" into mnc-devChad Brubaker2015-06-043-7/+27
|\ \ \ \ \ \ \
| * | | | | | | Add optional additional entropy to finishChad Brubaker2015-06-043-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If provided the extra entropy will be added to the device before calling finish. If entropy is provided and the device does not support supplying additional entropy then finish will fail with KM_ERROR_UNIMPLEMENTED. (cherry-picked from commit 8cfb8ac6e9bd291e9d861a32de2719e3bc797191) Change-Id: If26be118bf382604f6f8e96e833b76e6f9e94d58
* | | | | | | | Merge "Use keymaster adapter to support older devices" into mnc-devChad Brubaker2015-06-031-6/+14
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | |
| * | | | | | | Use keymaster adapter to support older devicesChad Brubaker2015-06-011-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The keymaster adapter wraps the hardware module to allow keystore to call the new keymaster methods on it and continue using old keys created by that device with the new methods. Change-Id: Ica08d81c3707023d378ad5fe6562dc642f58ca90