Use vector to pass around keys
In the future the key size for new master keys will increase.
To maintain backwards compatibility the size of the key
can no longer be assumed. To help communicate the actual
size of the key, it will be passed around in a vector.
Bug: 121272336
Test: Ran Keystore CTS tests against Walleye,
no new test failures observed
Change-Id: Ie74eaf5226398e2300eb266ddda269473593e9d4
Merged-In: I4c05acb15b77959f2bf89abbdc325904fffb497a
diff --git a/keystore/blob.h b/keystore/blob.h
index 6a52ca4..4a35842 100644
--- a/keystore/blob.h
+++ b/keystore/blob.h
@@ -24,6 +24,7 @@
#include <keystore/keymaster_types.h>
#include <keystore/keystore.h>
+#include <vector>
constexpr size_t kValueSize = 32768;
constexpr size_t kAesKeySize = 128 / 8;
@@ -120,8 +121,10 @@
keystore::SecurityLevel getSecurityLevel() const;
void setSecurityLevel(keystore::SecurityLevel);
- ResponseCode writeBlob(const std::string& filename, const uint8_t* aes_key, State state);
- ResponseCode readBlob(const std::string& filename, const uint8_t* aes_key, State state);
+ ResponseCode writeBlob(const std::string& filename, const std::vector<uint8_t>& aes_key,
+ State state);
+ ResponseCode readBlob(const std::string& filename, const std::vector<uint8_t>& aes_key,
+ State state);
private:
blobv3 mBlob;