summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kenny Root <kroot@google.com> 2013-02-13 23:43:57 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2013-02-13 23:43:57 +0000
commitb0f4b8a7d2662e8cc63dae1001175bf72bca1539 (patch)
tree90ec01d90d588d952f3c5d068f932a0e91b51559
parent8ab767786a3b59c72b613f84d40b181428327ac1 (diff)
parente151f281d527f4bea5cbdf4219d5e0507a6668b0 (diff)
Merge "Track keystore binder changes"
-rw-r--r--core/java/android/security/IKeystoreService.java35
-rw-r--r--keystore/java/android/security/KeyStore.java14
2 files changed, 28 insertions, 21 deletions
diff --git a/core/java/android/security/IKeystoreService.java b/core/java/android/security/IKeystoreService.java
index f8a49e66f0c9..651693a970f4 100644
--- a/core/java/android/security/IKeystoreService.java
+++ b/core/java/android/security/IKeystoreService.java
@@ -78,7 +78,7 @@ public interface IKeystoreService extends IInterface {
return _result;
}
- public int insert(String name, byte[] item) throws RemoteException {
+ public int insert(String name, byte[] item, int uid) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
int _result;
@@ -86,6 +86,7 @@ public interface IKeystoreService extends IInterface {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(name);
_data.writeByteArray(item);
+ _data.writeInt(uid);
mRemote.transact(Stub.TRANSACTION_insert, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
@@ -96,13 +97,14 @@ public interface IKeystoreService extends IInterface {
return _result;
}
- public int del(String name) throws RemoteException {
+ public int del(String name, int uid) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
int _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(name);
+ _data.writeInt(uid);
mRemote.transact(Stub.TRANSACTION_del, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
@@ -113,13 +115,14 @@ public interface IKeystoreService extends IInterface {
return _result;
}
- public int exist(String name) throws RemoteException {
+ public int exist(String name, int uid) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
int _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(name);
+ _data.writeInt(uid);
mRemote.transact(Stub.TRANSACTION_exist, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
@@ -130,13 +133,14 @@ public interface IKeystoreService extends IInterface {
return _result;
}
- public String[] saw(String name) throws RemoteException {
+ public String[] saw(String name, int uid) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
String[] _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(name);
+ _data.writeInt(uid);
mRemote.transact(Stub.TRANSACTION_saw, _data, _reply, 0);
_reply.readException();
int size = _reply.readInt();
@@ -235,13 +239,14 @@ public interface IKeystoreService extends IInterface {
return _result;
}
- public int generate(String name) throws RemoteException {
+ public int generate(String name, int uid) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
int _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(name);
+ _data.writeInt(uid);
mRemote.transact(Stub.TRANSACTION_generate, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
@@ -252,7 +257,7 @@ public interface IKeystoreService extends IInterface {
return _result;
}
- public int import_key(String name, byte[] data) throws RemoteException {
+ public int import_key(String name, byte[] data, int uid) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
int _result;
@@ -260,6 +265,7 @@ public interface IKeystoreService extends IInterface {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(name);
_data.writeByteArray(data);
+ _data.writeInt(uid);
mRemote.transact(Stub.TRANSACTION_import, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
@@ -324,13 +330,14 @@ public interface IKeystoreService extends IInterface {
return _result;
}
- public int del_key(String name) throws RemoteException {
+ public int del_key(String name, int uid) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
int _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(name);
+ _data.writeInt(uid);
mRemote.transact(Stub.TRANSACTION_del_key, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
@@ -467,13 +474,13 @@ public interface IKeystoreService extends IInterface {
public byte[] get(String name) throws RemoteException;
- public int insert(String name, byte[] item) throws RemoteException;
+ public int insert(String name, byte[] item, int uid) throws RemoteException;
- public int del(String name) throws RemoteException;
+ public int del(String name, int uid) throws RemoteException;
- public int exist(String name) throws RemoteException;
+ public int exist(String name, int uid) throws RemoteException;
- public String[] saw(String name) throws RemoteException;
+ public String[] saw(String name, int uid) throws RemoteException;
public int reset() throws RemoteException;
@@ -485,9 +492,9 @@ public interface IKeystoreService extends IInterface {
public int zero() throws RemoteException;
- public int generate(String name) throws RemoteException;
+ public int generate(String name, int uid) throws RemoteException;
- public int import_key(String name, byte[] data) throws RemoteException;
+ public int import_key(String name, byte[] data, int uid) throws RemoteException;
public byte[] sign(String name, byte[] data) throws RemoteException;
@@ -495,7 +502,7 @@ public interface IKeystoreService extends IInterface {
public byte[] get_pubkey(String name) throws RemoteException;
- public int del_key(String name) throws RemoteException;
+ public int del_key(String name, int uid) throws RemoteException;
public int grant(String name, int granteeUid) throws RemoteException;
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java
index ceaff37f3c59..9dd2b0d455af 100644
--- a/keystore/java/android/security/KeyStore.java
+++ b/keystore/java/android/security/KeyStore.java
@@ -85,7 +85,7 @@ public class KeyStore {
public boolean put(String key, byte[] value) {
try {
- return mBinder.insert(key, value) == NO_ERROR;
+ return mBinder.insert(key, value, -1) == NO_ERROR;
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
return false;
@@ -94,7 +94,7 @@ public class KeyStore {
public boolean delete(String key) {
try {
- return mBinder.del(key) == NO_ERROR;
+ return mBinder.del(key, -1) == NO_ERROR;
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
return false;
@@ -103,7 +103,7 @@ public class KeyStore {
public boolean contains(String key) {
try {
- return mBinder.exist(key) == NO_ERROR;
+ return mBinder.exist(key, -1) == NO_ERROR;
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
return false;
@@ -112,7 +112,7 @@ public class KeyStore {
public String[] saw(String prefix) {
try {
- return mBinder.saw(prefix);
+ return mBinder.saw(prefix, -1);
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
return null;
@@ -167,7 +167,7 @@ public class KeyStore {
public boolean generate(String key) {
try {
- return mBinder.generate(key) == NO_ERROR;
+ return mBinder.generate(key, -1) == NO_ERROR;
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
return false;
@@ -176,7 +176,7 @@ public class KeyStore {
public boolean importKey(String keyName, byte[] key) {
try {
- return mBinder.import_key(keyName, key) == NO_ERROR;
+ return mBinder.import_key(keyName, key, -1) == NO_ERROR;
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
return false;
@@ -194,7 +194,7 @@ public class KeyStore {
public boolean delKey(String key) {
try {
- return mBinder.del_key(key) == NO_ERROR;
+ return mBinder.del_key(key, -1) == NO_ERROR;
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
return false;