summaryrefslogtreecommitdiff
path: root/MetadataCrypt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* system: vold: Use ICE for UFS cardGaurav Kashyap2020-01-031-0/+14
| | | | | | | | | | | Identify UFS Card while mounting during adoptable storage, and use ICE for encryption/decryption if it is the case as compared to software encryption being used for SD card. CRs-Fixed: 2491182 Change-Id: Iea7e34b06e3ceab8e292ac14d5115566382609ab
* Make ext4 userdata checkpoints work with metadata encryptionPaul Lawrence2019-06-271-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When both ext4 user data checkpoints and metadata encryption are enabled, we are creating two stacked dm devices. This had not been properly thought through or debugged. Test: Enable metadata encryption on taimen (add keydirectory=/metadata/vold/metadata_encryption to flags for userdata in fstab.hardware) Unfortunately metadata is not wiped by fastboot -w, so it is necessary to rm metadata/vold -rf whenever you wipe data. fastboot flashall -w works fastboot reboot -w works A normal boot works Disable checkpoint commits with setprop persist.vold.dont_commit_checkpoint 1 vdc checkpoint startCheckpoint 10 adb reboot wait for device to fully boot then adb reboot Wait for device to fully boot then adb logcat -d | grep Checkpoint shows the rollback in the logs This tests encryption on top of checkpoints with commit, encryption without checkpoints, and rollback, which seems to be the key cases. Also ran same tests on unmodified Taimen and Blueline Bug: 135905679 Merged-In: I8365a40298b752af4bb10d00d9ff58ce04beab1f Change-Id: I8365a40298b752af4bb10d00d9ff58ce04beab1f
* Move over to the C++ Fstab classTom Cherry2019-01-311-10/+12
| | | | | Test: build and boot Change-Id: Id3850c9c133f6644073a2439368501253a2a94a9
* Remove secontext.h, secontext.cpp, hash.hLongPing Wei2019-01-301-2/+1
| | | | | | | | cryptfs.cpp and MetadataCrypt.cpp can use android::vold::sFsckContext directly. hash.h is unuseful. Test: make Change-Id: I7acdac97d6ed1c9b2a5dc367fcea8aa2942192e8
* vold: Pass std::string by const referenceGreg Kaiser2018-12-201-1/+1
| | | | | | | | In a couple places, we change to pass a std::string argument instead of by copy. Test: TreeHugger Change-Id: Ib179299a2322fcbab4e6d192051218823ad66a36
* Add Support for metadata key with rollbackDaniel Rosenberg2018-12-141-1/+55
| | | | | | | | | | | | | This adds the ability to upgrade a key and retain the old one for rollback purposes. We delete the old key if we boot successfully and delete the new key if we do not. Test: Enable checkpointing and test rolling back between two versions Bug: 111020314 Change-Id: I19f31a1ac06a811c0644fc956e61b5ca84e7241a
* vold: rename from "ext4 encryption" to fscryptEric Biggers2018-10-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | We support file-based encryption on both ext4 and f2fs now, and the kernel API is the same. So rename things appropriately in vold: e4crypt => fscrypt ext4enc => fscrypt Ext4Crypt => FsCrypt EXT4_* => FS_* ext4_encryption_key => fscrypt_key Additionally, the common functions shared by 'vold' and 'init' are now in libfscrypt rather than ext4_utils. So update vold to link to libfscrypt and include the renamed headers. Note: there's a chance of 'fscrypt' being confused with the dm-crypt based encryption code in vold which is called 'cryptfs'. However, fscrypt is the name used in the kernel for ext4/f2fs/ubifs encryption, and it's preferable to use the same name in userspace. Test: built, booted device with f2fs encryption Change-Id: I2a46a49f30d9c0b73d6f6fe09e4a4904d4138ff6
* Merge "Add support for checkpointing"Treehugger Robot2018-09-251-1/+3
|\
| * Add support for checkpointingDaniel Rosenberg2018-09-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | Checkpointing uses a combination of files on the meta partition and the checkpoint= fs_mgr flag. Checkpointed partitions will revert to their starting state on reboot unless checkpoint commit is called. Test: Run vdc commands, check file on metadata Merged-In: Icba16578608a6cbf922472e9d4ae5b8cf5f016c6 Change-Id: Icba16578608a6cbf922472e9d4ae5b8cf5f016c6
* | Add GetBlockDevSize, GetBlockDevSectors helpersOleksiy Avramchenko2018-09-241-11/+1
|/ | | | | | | | | | | Helpers to get a block device size in bytes or 512 byte sectors, using BLKGETSIZE64 and returning value of uint64_t type. This also removes get_blkdev_size(). Test: build, manual, mount exFAT volume Bug: 80202067 Change-Id: Ib07e8ac6ef7ff49de0ed570d1fa202e8b558b80c
* clang-format many files.Paul Crowley2018-09-181-18/+17
| | | | | Test: Format-only changes; treehugger suffices. Change-Id: I23cde3f0bbcac13bef555d13514e922c79d5ad48
* Fix spurious errorPaul Crowley2018-05-101-2/+3
| | | | | | Bug: 79542247 Test: error no longer appears Change-Id: I2cf91c8cd937b81041a47e4b64a882445a80eb0b
* Add a mount with metadata encryption servicePaul Crowley2018-02-011-104/+32
| | | | | | | | | Don't use the FDE flow to support metadata encryption; just provide a vold service which directly mounts the volume and use that. Bug: 63927601 Test: Boot Taimen to SUW with and without metadata encryption. Change-Id: Ifc6a012c02c0ea66893020ed1d0da4cba6914aed
* Refactor of use of fstab in advance of fix.Paul Crowley2017-09-261-5/+4
| | | | | | Test: Ensure device still boots. Bug: 65737446 Change-Id: Ie466db9f5d8c77656cc525c0d49fe6a3cce154f1
* Zero memory used for encryuption keys.Pavel Grafov2017-08-101-13/+18
| | | | | | | | | | std::vector with custom zeroing allocator is used instead of std::string for data that can contain encryption keys. Bug: 64201177 Test: manually created a managed profile, changed it's credentials Test: manually upgraded a phone with profile from O to MR1. Change-Id: Ic31877049f69eba9f8ea64fd99acaaca5a01d3dd
* Abolish AutoCloseFD.h in favour of unique_fdPaul Crowley2017-06-161-5/+7
| | | | | | | | | Android has a standard way to do what AutoCloseFD.h does, so use that instead. Refactor before work on the bug. Bug: 36029169 Test: Deleted a user and checked that secdiscard logs looked good. Change-Id: I5d8bedfb3fa1f032fd2bced88b1b561e4a8c2ff4
* Revert "Enable metadata encryption"Guang Zhu2017-04-281-2/+23
| | | | | | | | Bug: 37792477 This reverts commit 3963b2364561a7d732995d5b8fec42097f548caa. Change-Id: I3b6bf5a9a4c3899aabe2c824d8498a06981daed8
* Enable metadata encryptionPaul Lawrence2017-04-281-23/+2
| | | | | | | | | Bug: 26778031 Test: Boots, reboots, sector 0 of userdata encrypted Make sure an FDE device, both default and password protected, boots. Make sure an FBE device without metadata encryption boots. Change-Id: Ic44a32ce7e9b978e9c9e2dc112b26206741c838d
* Add support for metadata encryptionPaul Crowley2017-04-211-0/+312
Support encrypting metadata in /userdata using the dm-default-key driver with a key in the /metadata partition. Bug: 29189559 Test: Angler & Marlin build and boot Change-Id: I716b117508d4bb4f6a4039293acb848cbc60f67b