diff options
author | Chad Brubaker <cbrubaker@google.com> | 2015-08-12 13:40:31 -0700 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-10-18 22:58:08 +0200 |
commit | 3fd46c800768e463508edda867af8ecbd49d2411 (patch) | |
tree | 7ba5f8eeaec3d30fc3ae4bb4cfb8b97e0d8843f8 /keystore/keystore.cpp | |
parent | af1ba9c30acccc199f1cfa9356916c34c52ba17f (diff) | |
download | system_security-master.tar.gz system_security-master.tar.bz2 system_security-master.zip |
sizeof(mBlob.value) is incorrect because writeBlob pads up to the next
AES_BLOCK_SIZE
Bug:22802399
Change-Id: I377edca2c7ea2cf4455f22f5f927fdad79893729
Tested-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Diffstat (limited to 'keystore/keystore.cpp')
-rw-r--r-- | keystore/keystore.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp index 884b737..6b07c94 100644 --- a/keystore/keystore.cpp +++ b/keystore/keystore.cpp @@ -299,12 +299,12 @@ class Blob { public: Blob(const uint8_t* value, size_t valueLength, const uint8_t* info, uint8_t infoLength, BlobType type) { - if (valueLength > sizeof(mBlob.value)) { - valueLength = sizeof(mBlob.value); + if (valueLength > VALUE_SIZE) { + valueLength = VALUE_SIZE; ALOGW("Provided blob length too large"); } - if (infoLength + valueLength > sizeof(mBlob.value)) { - infoLength = sizeof(mBlob.value) - valueLength; + if (infoLength + valueLength > VALUE_SIZE) { + infoLength = VALUE_SIZE - valueLength; ALOGW("Provided info length too large"); } mBlob.length = valueLength; |