summaryrefslogtreecommitdiffstats
path: root/CommandListener.cpp
diff options
context:
space:
mode:
authorKen Sumrall <ksumrall@android.com>2011-01-17 15:26:29 -0800
committerKen Sumrall <ksumrall@android.com>2011-01-17 15:26:29 -0800
commit8ddbe40a8a8708dac7c472fa8c098c8f7b24534c (patch)
tree690fa93847ce64ef85e8794f17a902855344a8bc /CommandListener.cpp
parent6864b7ec94a57b73c300457955d86dc604aeddf5 (diff)
downloadsystem_vold-8ddbe40a8a8708dac7c472fa8c098c8f7b24534c.zip
system_vold-8ddbe40a8a8708dac7c472fa8c098c8f7b24534c.tar.gz
system_vold-8ddbe40a8a8708dac7c472fa8c098c8f7b24534c.tar.bz2
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
Diffstat (limited to 'CommandListener.cpp')
-rw-r--r--CommandListener.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/CommandListener.cpp b/CommandListener.cpp
index c38a6d1..03cb179 100644
--- a/CommandListener.cpp
+++ b/CommandListener.cpp
@@ -514,8 +514,6 @@ CommandListener::CryptfsCmd::CryptfsCmd() :
int CommandListener::CryptfsCmd::runCommand(SocketClient *cli,
int argc, char **argv) {
- dumpArgs(argc, argv, -1);
-
if (argc < 2) {
cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing Argument", false);
return 0;
@@ -528,20 +526,31 @@ int CommandListener::CryptfsCmd::runCommand(SocketClient *cli,
cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs checkpw <passwd>", false);
return 0;
}
+ dumpArgs(argc, argv, 2);
rc = cryptfs_check_passwd(argv[2]);
} else if (!strcmp(argv[1], "restart")) {
if (argc != 2) {
cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs restart", false);
return 0;
}
+ dumpArgs(argc, argv, -1);
rc = cryptfs_restart();
} else if (!strcmp(argv[1], "enablecrypto")) {
if ( (argc != 4) || (strcmp(argv[2], "wipe") && strcmp(argv[2], "inplace")) ) {
cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs enablecrypto <wipe|inplace> <passwd>", false);
return 0;
}
+ dumpArgs(argc, argv, 3);
rc = cryptfs_enable(argv[2], argv[3]);
+ } else if (!strcmp(argv[1], "changepw")) {
+ if (argc != 4) {
+ cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs changepw <oldpasswd> <newpasswd>", false);
+ return 0;
+ }
+ SLOGD("cryptfs changepw <oldpw> <newpw>");
+ rc = cryptfs_changepw(argv[2], argv[3]);
} else {
+ dumpArgs(argc, argv, -1);
cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown cryptfs cmd", false);
}