am a680a0ca: am 57a72ec8: am 3ad91aa7: Merge "keystore-engine: comment out unused args"
* commit 'a680a0ca52d252c3a420c4e31752afe12ebbe81c':
keystore-engine: comment out unused args
diff --git a/keystore/IKeystoreService.cpp b/keystore/IKeystoreService.cpp
index f920095..df1c5dd 100644
--- a/keystore/IKeystoreService.cpp
+++ b/keystore/IKeystoreService.cpp
@@ -30,6 +30,7 @@
namespace android {
+const ssize_t MAX_GENERATE_ARGS = 3;
static keymaster_key_param_t* readParamList(const Parcel& in, size_t* length);
KeystoreArg::KeystoreArg(const void* data, size_t len)
@@ -1420,6 +1421,9 @@
int32_t argsPresent = data.readInt32();
if (argsPresent == 1) {
ssize_t numArgs = data.readInt32();
+ if (numArgs > MAX_GENERATE_ARGS) {
+ return BAD_VALUE;
+ }
if (numArgs > 0) {
for (size_t i = 0; i < (size_t) numArgs; i++) {
ssize_t inSize = data.readInt32();
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp
index 8db8dab..e3d4446 100644
--- a/keystore/keystore.cpp
+++ b/keystore/keystore.cpp
@@ -495,6 +495,7 @@
public:
Blob(const uint8_t* value, int32_t valueLength, const uint8_t* info, uint8_t infoLength,
BlobType type) {
+ memset(&mBlob, 0, sizeof(mBlob));
mBlob.length = valueLength;
memcpy(mBlob.value, value, valueLength);
@@ -515,7 +516,9 @@
mBlob = b;
}
- Blob() {}
+ Blob() {
+ memset(&mBlob, 0, sizeof(mBlob));
+ }
const uint8_t* getValue() const {
return mBlob.value;