Commit graph

6376 commits

Author SHA1 Message Date
Ken Sumrall
e113373708 am 0cc16638: Verify that it\'s OK to run the various cryptfs commands
* commit '0cc166385a7e1d3026bbcb62f094e419f779e872':
  Verify that it's OK to run the various cryptfs commands
2011-01-18 22:03:31 -08:00
Ken Sumrall
e874407036 Create and use a salt when calling pbkdf2 to encrypt/decrypt the master key.
In order to prevent rainbow table attacks on decrypting the master key,
create a 16 byte "salt" by reading /dev/urandom.  This is done right after
reading urandom to get the master key for the filesystem.  The salt is
stored 32 bytes after the end of the key (a padding added to help prevent
accidental overwriting of the salt) and the salt is fixed at 16 bytes long.

This change will make existing encrypted filesystems unusable.

Change-Id: I420549d064c61d38aea78eef4d86c88acb265ca3
2011-01-18 22:01:55 -08:00
Ken Sumrall
694bc70d42 am 7df84120: Don\'t wait for the framework to come up before starting to encrypt in place.
* commit '7df84120b25dca713f623528801385b00208c2aa':
  Don't wait for the framework to come up before starting to encrypt in place.
2011-01-18 21:53:23 -08:00
Ken Sumrall
0cc166385a Verify that it's OK to run the various cryptfs commands
Maintain and query some internal state to know if it's OK to run
the various cryptfs commands.  Do not allow enablecrypto to run if
the device is already encrypted.  Do no allow restart to run if
we have already run it before or if the password has not been
validated.  Do not allow checkpw to run if not encrypted, or it
has already validated the password.

This is an extra layer of safety on top of the checks up in the
UI code agains possible DoS attacks on the device.

Change-Id: I9afc8d42773020e82a512e6b637feede101d1362
2011-01-18 20:32:26 -08:00
Ken Sumrall
7df84120b2 Don't wait for the framework to come up before starting to encrypt in place.
Also, change the value that triggers the progress bar framework from
"startup" to "0" in the property vold.encrypt_progress.

Change-Id: I3890e66a95283ce2ceeca82f516859b083919b9e
2011-01-18 14:04:08 -08:00
Ken Sumrall
e23667fa00 am 57b63e61: Minor tweaks to logging for the cryptfs changepw command.
* commit '57b63e61cb41e377708a4fdf18ecc80eb1b2b521':
  Minor tweaks to logging for the cryptfs changepw command.
2011-01-18 08:47:29 -08:00
Ken Sumrall
57b63e61cb Minor tweaks to logging for the cryptfs changepw command.
Change-Id: I87ff9788a56de6d461002407bf6c3cd4c6f900ee
2011-01-17 18:29:19 -08:00
Ken Sumrall
934dfed05d am 8ddbe40a: Updates to cryptfs framework.
* commit '8ddbe40a8a8708dac7c472fa8c098c8f7b24534c':
  Updates to cryptfs framework.
2011-01-17 15:32:50 -08:00
Ken Sumrall
8ddbe40a8a Updates to cryptfs framework.
Update the enable inplace API to allow the UI to show a progress bar.
Add new command changepw (whichis currently not working)
Internal restructuring of code to support these two features.
Some minor cleanup of the code as well.

Change-Id: I11461fc9ce66965bea6cd0b6bb2ff48bcf607b97
2011-01-17 15:26:29 -08:00
Ken Sumrall
3b3b89e07c am 6864b7ec: Change the cryptfs command to separate out checking the password and restarting
* commit '6864b7ec94a57b73c300457955d86dc604aeddf5':
  Change the cryptfs command to separate out checking the password and restarting
2011-01-17 14:45:11 -08:00
Ken Sumrall
6864b7ec94 Change the cryptfs command to separate out checking the password and restarting
In order to make the animations and the UI look right, we need to change
the cryptfs checkpw command to return a status if the password was
correct or not, and not have it automatically restart if it's correct.

There is a new command restart that will restart the framework with the
encrypted filesystem.

Change-Id: Ia8ae00d7ed8667699aa58d05ad8ba953cca9316e
2011-01-14 15:20:02 -08:00
Ken Sumrall
eed82c368b am 2eaf7138: Cleanup a few issues with the cryptfs code.
* commit '2eaf7138528d30c331d83ab8346a97e66b5499e2':
  Cleanup a few issues with the cryptfs code.
2011-01-14 14:30:52 -08:00
Ken Sumrall
2eaf713852 Cleanup a few issues with the cryptfs code.
Now that the framework shuts down quickly, remove the 30
second sleep when enabling crypto.  Also, stop spewing
the secret master key to the disk in the system log!

Change-Id: Icb3f9456ababe3dff8de52cbbae92da0e9e5dd2f
2011-01-14 14:23:26 -08:00
Wink Saville
5fb760a63c Revert "Change constructor to match new definition of the superclass"
This reverts commit 499806cd60.
2011-01-09 12:18:21 -08:00
Stan Chesnutt
499806cd60 Change constructor to match new definition of the superclass
Change-Id: I3526b1920817c2a28ac3e84c1ea278932a9ec895
2010-12-26 22:17:48 -08:00
Ken Sumrall
8f869aa1bc Support for encrypting /data on Stingray.
There are still a few hacks and performance issues related
to shutting down the framework in this code, but it is
functional and tested.  Without the UI changes, it requires
cryptic adb shell commands to enable, which I shall not
utter here.

Change-Id: I0b8f90afd707e17fbdb0373d156236946633cf8b
2010-12-18 18:35:56 -08:00
Mike Lockwood
3c9a73f643 Stifle "Ignoring unknown switch" logging
Change-Id: I9770ab880f379e2f7f6a93d3c84990edec60a116
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-12-10 15:07:14 -08:00
Jean-Baptiste Queru
905ed1fbd3 am c1d80272: am 08da5c1f: Merge "vold: replace strsep by strtok_r"
* commit 'c1d80272b117cf837de93fadd8d456d89a203e2f':
  vold: replace strsep by strtok_r
2010-11-19 17:26:47 -08:00
Jean-Baptiste Queru
c1d80272b1 am 08da5c1f: Merge "vold: replace strsep by strtok_r"
* commit '08da5c1f17afefe3c9f4f4d4456c5757dede62e1':
  vold: replace strsep by strtok_r
2010-11-19 17:24:49 -08:00
Jean-Baptiste Queru
08da5c1f17 Merge "vold: replace strsep by strtok_r" 2010-11-19 17:20:39 -08:00
Jinho You
74ca25a716 vold: replace strsep by strtok_r
It permits more white spaces between words in vold.fstab.

Change-Id: I38250c3dcc860643e4f102e980fe844693a1451a
2010-11-19 17:01:48 -08:00
Jean-Baptiste Queru
2996451f77 am 1206e872: resolved conflicts for merge of 09f774b7 to gingerbread-plus-aosp
* commit '1206e872ce74aab253c39c3547bfaadc5e1f6011':
  vold: fix an offset one bug that makes partition 4 unusable
  vold: set state back to idle on formatting error
2010-11-19 10:25:51 -08:00
Jean-Baptiste Queru
1206e872ce resolved conflicts for merge of 09f774b7 to gingerbread-plus-aosp
Change-Id: I103db47198ad09783aa6539cde271df0fdb9c594
2010-11-19 10:20:37 -08:00
Jean-Baptiste Queru
09f774b7d3 Merge changes Ic8e18e61,I62c78eb8
* changes:
  vold: fix an offset one bug that makes partition 4 unusable
  vold: set state back to idle on formatting error
2010-11-17 18:24:33 -08:00
Chih-Wei Huang
def8f31683 vold: fix an offset one bug that makes partition 4 unusable
Change-Id: Ic8e18e6191ad7ee33162e36060b57a6802cf0883
2010-11-17 18:53:09 +08:00
Olivier Bailly
37dcda68d3 Add missing include headers for compilation on Intel target for Google TV.
Change-Id: I9f71b5e871671d1d64ad37f78a8944653409b8e1
2010-11-16 10:41:53 -08:00
Chih-Wei Huang
64382de1f9 vold: set state back to idle on formatting error
On formatting error due to some reasons, the state is left at
Formatting, therefore the user is unable to mount the sdcard
again. The patch sets the state to Idle no matter formatting
error or not.

Change-Id: I62c78eb8299cc397ee5cc442890f8b3dbf09425c
2010-11-16 13:27:36 +08:00
Mike Lockwood
92c243afae am a28056b3: Set VM dirty ratio to zero when UMS is active
* commit 'a28056b38275003895ff5d9576681aca01544822':
  Set VM dirty ratio to zero when UMS is active
2010-10-29 08:16:15 -07:00
Mike Lockwood
a28056b382 Set VM dirty ratio to zero when UMS is active
Improves UI responsiveness when copying large amount of data to the device.

BUG: 3131847

Change-Id: I4aa5ade7e2cd7e5110c8f0f7ee43bdc57577e11d
Signed-off-by: Mike Lockwood <lockwood@google.com>
2010-10-28 15:21:24 -04:00
Kenny Root
456b7e6a99 am 918e5f9f: Better error code for unmounting not-mounted volumes
Merge commit '918e5f9f10b9c1ff929683743ffbf229027ce240' into gingerbread-plus-aosp

* commit '918e5f9f10b9c1ff929683743ffbf229027ce240':
  Better error code for unmounting not-mounted volumes
2010-09-30 18:05:58 -07:00
Kenny Root
918e5f9f10 Better error code for unmounting not-mounted volumes
ENOENT is more descriptive than the generic error that EINVAL gets
turned into. Then we can actually treat it how we want on the other
side.

Change-Id: I9b4f3be6308e13f680eae368d2167ab9ee6aae5f
2010-09-30 18:02:34 -07:00
Kenny Root
45f22ad121 am cbacf78e: Track type of container mounted
Merge commit 'cbacf78eff70bd43bb899e164ec2ab409bc0904c' into gingerbread-plus-aosp

* commit 'cbacf78eff70bd43bb899e164ec2ab409bc0904c':
  Track type of container mounted
2010-09-26 11:17:39 -07:00
Kenny Root
cbacf78eff Track type of container mounted
OBB and ASEC are tracked in the same active container list, but when it
comes time to unmount everything, it was trying to unmount the OBBs
according to ASEC rules. This led to the OBB not being unmounted and the
volume unmount failing.

Change-Id: I12c1d4d387b8022185d552b63edd61a50b9c0fc3
2010-09-26 07:35:17 -07:00
Mike Lockwood
9b46bebd2c am a4886f1f: More fixes for internal FAT partitions:
Merge commit 'a4886f1f8ed72e24a302a91a0ab18bc54b6f585e' into gingerbread-plus-aosp

* commit 'a4886f1f8ed72e24a302a91a0ab18bc54b6f585e':
  More fixes for internal FAT partitions:
2010-09-21 11:09:58 -07:00
Mike Lockwood
a4886f1f8e More fixes for internal FAT partitions:
Fix formatting partitions beyond the first partition.
Do not try to initialize the MBR when formatting only a single partition.

Change-Id: Ifbbd279b1c288b7b1b884a1a89248e3086ed735f
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-21 13:59:31 -04:00
Brad Fitzpatrick
08cd8f76bf am 1b15d463: Add some missing closes on error conditions.
Merge commit '1b15d463d4816fc084767cbeda3ee69ff5527545' into gingerbread-plus-aosp

* commit '1b15d463d4816fc084767cbeda3ee69ff5527545':
  Add some missing closes on error conditions.
2010-09-20 11:45:40 -07:00
Brad Fitzpatrick
1b15d463d4 Add some missing closes on error conditions.
Also, some formatting fixes to get back into line with netd's copy of
logwrapper.c.

Change-Id: Id471b99e9c3c8c9bb0890ca0d5e1567125e35bd7
2010-09-20 11:11:46 -07:00
Mike Lockwood
3374b41f1f am 2dfe297e: Fixes for devices with internal FAT file system:
Merge commit '2dfe297ec47559dbe2297a72bea71cf515c03797' into gingerbread-plus-aosp

* commit '2dfe297ec47559dbe2297a72bea71cf515c03797':
  Fixes for devices with internal FAT file system:
2010-09-17 15:58:04 -07:00
Mike Lockwood
2dfe297ec4 Fixes for devices with internal FAT file system:
Only share a single partition via UMS if a specific partition
is specified in vold.fstab (rather than "auto")

Do not fail to reformat if MBR cannot be found.

Change-Id: I544ca2ee325c308af656ab9f4732c788a964c156
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-17 18:50:51 -04:00
Kenny Root
90d92f11ab am a3e06084: Allow execute on mounted ASEC and OBB containers
Merge commit 'a3e06084564c86ff618c40f185f3676b8b629b94' into gingerbread-plus-aosp

* commit 'a3e06084564c86ff618c40f185f3676b8b629b94':
  Allow execute on mounted ASEC and OBB containers
2010-09-02 13:25:27 -07:00
Kenny Root
a3e0608456 Allow execute on mounted ASEC and OBB containers
This allows us to place shared libraries in these containers which may
only be loaded if they are executable.

Change-Id: I78fa9ab6d5c58ec8b98c40004da72aebc0aade2a
2010-09-02 13:16:53 -07:00
Ethan
2c7d5761d2 am 75a3e1a9: VOLD - make volume daemon to handle state change from shared to no_media
Merge commit '75a3e1a95af0a2790de1b12aeca0008bfdc61649' into gingerbread-plus-aosp

* commit '75a3e1a95af0a2790de1b12aeca0008bfdc61649':
  VOLD - make volume daemon to handle state change from shared to no_media
2010-08-30 13:20:44 -07:00
Ethan
75a3e1a95a VOLD - make volume daemon to handle state change from shared to no_media
When volume state changed from shared to no_media,
    volume is not properly unshared.

Change-Id: I0117d67da95440d982275746a166ef6f4ac1c0e2
Signed-off-by: Ethan <ethan.too@gmail.com>
2010-08-30 09:07:59 -07:00
Jean-Baptiste Queru
582677b50c am 826bec79: Merge "vold: remove unnecessary code from VolumeManager::unshareVolume()"
Merge commit '826bec79ea253505813d125700a12816e2c3bc0f' into gingerbread-plus-aosp

* commit '826bec79ea253505813d125700a12816e2c3bc0f':
  vold: remove unnecessary code from VolumeManager::unshareVolume()
2010-07-29 11:31:13 -07:00
Jean-Baptiste Queru
826bec79ea Merge "vold: remove unnecessary code from VolumeManager::unshareVolume()" 2010-07-29 11:21:44 -07:00
Bruce Beare
8f295e9dee am d766090b: Avoid array overrun. We can now mount the /sdcard partition on our boot sdcards
Merge commit 'd766090b7a72562be9e64700e13882663004650e' into gingerbread-plus-aosp

* commit 'd766090b7a72562be9e64700e13882663004650e':
  Avoid array overrun. We can now mount the /sdcard partition on our boot sdcards
2010-07-29 11:19:15 -07:00
Seth Forshee
b2b3d2cd34 vold: remove unnecessary code from VolumeManager::unshareVolume()
Signed-off-by: Seth Forshee <seth.forshee@garmin.com>
2010-07-23 03:31:57 -05:00
Bruce Beare
d766090b7a Avoid array overrun. We can now mount the /sdcard partition on our boot sdcards
Change-Id: I6e9db8c55db49b4aa61dd40cd59495f55e5b3368
Signed-off-by: Bruce Beare <brucex.j.beare@intel.com>
2010-07-22 13:30:11 -07:00
Kenny Root
e17e91f63b Fix loop_info/loop_info64 impedance mismatch
LOOP_GET_STATUS64 isn't useful here since the data contained within
isn't actually checked, so stick with the regular LOOP_GET_STATUS here
to match the struct loop_info we're using.

Change-Id: I4f9ff06fa44d4ae3aed046d423054554f9cf450b
2010-07-16 16:28:49 -07:00
Kenny Root
508c0e1605 Additional Obb functionality
* Rename all functions dealing with OBB files to mention Obb

* Add 'path' and 'list' functionality to OBB commands

* Store hashed filename in loop's lo_crypt_name and keep lo_file_name
  for the real source filename. That way we can recover it later with an
  ioctl call.

Change-Id: I29e468265988bfb931d981532d86d7be7b3adfc8
2010-07-15 12:41:01 -07:00