diff options
author | Chung-yih Wang <cywang@google.com> | 2009-09-08 03:52:45 +0800 |
---|---|---|
committer | Chung-yih Wang <cywang@google.com> | 2009-09-09 15:00:43 +0800 |
commit | 801b73f661cbdf92de94b7e552a190fcbbdc3168 (patch) | |
tree | d67ad7b9bca1e97a7cc4ecbab4c6e680933ab1b6 /keystore | |
parent | 88e625795943dea84b2e7c32f37e71303143b728 (diff) | |
download | frameworks_base-801b73f661cbdf92de94b7e552a190fcbbdc3168.zip frameworks_base-801b73f661cbdf92de94b7e552a190fcbbdc3168.tar.gz frameworks_base-801b73f661cbdf92de94b7e552a190fcbbdc3168.tar.bz2 |
Replace the delimiter whitespace with '\0'.
+ Use '\0' as the delimiter.
+ Allow whitespace character for keystore password.
In previous implementation, we use space as the delimiter. That
will stop user from using passphrase with whitespace character.
Diffstat (limited to 'keystore')
-rw-r--r-- | keystore/java/android/security/Keystore.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/keystore/java/android/security/Keystore.java b/keystore/java/android/security/Keystore.java index a6cfbca..9713d29 100644 --- a/keystore/java/android/security/Keystore.java +++ b/keystore/java/android/security/Keystore.java @@ -53,7 +53,6 @@ public abstract class Keystore { private static final String CA_CERTIFICATE = "CaCertificate"; private static final String USER_CERTIFICATE = "UserCertificate"; private static final String USER_KEY = "UserPrivateKey"; - private static final String COMMAND_DELIMITER = " "; private static final ServiceCommand mServiceCommand = new ServiceCommand(SERVICE_NAME); @@ -80,7 +79,7 @@ public abstract class Keystore { @Override public int changePassword(String oldPassword, String newPassword) { Reply result = mServiceCommand.execute(ServiceCommand.PASSWD, - oldPassword + " " + newPassword); + oldPassword + "\0" + newPassword + "\0"); return (result != null) ? result.returnCode : -1; } @@ -105,14 +104,14 @@ public abstract class Keystore { @Override public int put(String namespace, String keyname, String value) { Reply result = mServiceCommand.execute(ServiceCommand.PUT_KEY, - namespace + " " + keyname + " " + value); + namespace + "\0" + keyname + "\0" + value); return (result != null) ? result.returnCode : -1; } @Override public String get(String namespace, String keyname) { Reply result = mServiceCommand.execute(ServiceCommand.GET_KEY, - namespace + " " + keyname); + namespace + "\0" + keyname + "\0"); return (result != null) ? ((result.returnCode != 0) ? null : new String(result.data, 0, result.len)) : null; } @@ -120,7 +119,7 @@ public abstract class Keystore { @Override public int remove(String namespace, String keyname) { Reply result = mServiceCommand.execute(ServiceCommand.REMOVE_KEY, - namespace + " " + keyname); + namespace + "\0" + keyname + "\0"); return (result != null) ? result.returnCode : -1; } |