Do not log passwords returned through vdc
Requires framework change:
https://googleplex-android-review.git.corp.google.com/#/c/585511/
Bug: 18260068
Change-Id: I95d3bb39404ede7128b8f5d61ce2423a5f09a9b8
diff --git a/CommandListener.cpp b/CommandListener.cpp
index 4c65959..f135a01 100644
--- a/CommandListener.cpp
+++ b/CommandListener.cpp
@@ -710,8 +710,14 @@
dumpArgs(argc, argv, -1);
char* password = cryptfs_get_password();
if (password) {
- cli->sendMsg(ResponseCode::CommandOkay, password, false);
- return 0;
+ char* message = 0;
+ int size = asprintf(&message, "{{sensitive}} %s", password);
+ if (size != -1) {
+ cli->sendMsg(ResponseCode::CommandOkay, message, false);
+ memset(message, 0, size);
+ free (message);
+ return 0;
+ }
}
rc = -1;
} else if (!strcmp(argv[1], "clearpw")) {