Support 32 bytes session key
[ Merge of http://go/wvgerrit/149849 ] With ECC based DRM cert, the session key is expected to be 32, as compared to 16 bytes in RSA case. This CL adds supports for 32 bytes session key. Bug: 236317198 Test: oemcrypto_test Change-Id: I657fdd92d17736a23375ddcd457f83efa6ca6d1f
This commit is contained in:
@@ -62,7 +62,7 @@ class KeyDeriver : public Encryptor {
|
||||
KeyDeriver& operator=(const KeyDeriver&) = default;
|
||||
|
||||
// Generate mac and enc keys give the master key.
|
||||
void DeriveKeys(const uint8_t* master_key,
|
||||
void DeriveKeys(const uint8_t* master_key, size_t master_key_size,
|
||||
const std::vector<uint8_t>& mac_key_context,
|
||||
const std::vector<uint8_t>& enc_key_context);
|
||||
// Sign the buffer with server's mac key.
|
||||
@@ -80,9 +80,11 @@ class KeyDeriver : public Encryptor {
|
||||
void set_mac_keys(const uint8_t* mac_keys);
|
||||
|
||||
private:
|
||||
// Internal utility function to derive key using CMAC-128
|
||||
void DeriveKey(const uint8_t* key, const std::vector<uint8_t>& context,
|
||||
int counter, std::vector<uint8_t>* out);
|
||||
// Internal utility function to derive key using CMAC-128 or CMAC-256 based on
|
||||
// master_key_size.
|
||||
void DeriveKey(const uint8_t* key, size_t master_key_size,
|
||||
const std::vector<uint8_t>& context, int counter,
|
||||
std::vector<uint8_t>* out);
|
||||
|
||||
std::vector<uint8_t> mac_key_server_;
|
||||
std::vector<uint8_t> mac_key_client_;
|
||||
|
||||
Reference in New Issue
Block a user