diff options
author | Matthew Maurer <mmaurer@google.com> | 2019-03-29 16:56:12 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-03-29 16:56:12 -0700 |
commit | d33899190facf946d4efce3fb04dbfd495141c11 (patch) | |
tree | 849a47c7af12c4a1193795f028be7b3d7d53497a | |
parent | f92a593e7fd5c69f815599526952b32ff89fda43 (diff) | |
parent | 4516ca7cc0b2650d67455d6443da60cd42631c0a (diff) | |
download | android_system_keymaster-d33899190facf946d4efce3fb04dbfd495141c11.tar.gz android_system_keymaster-d33899190facf946d4efce3fb04dbfd495141c11.tar.bz2 android_system_keymaster-d33899190facf946d4efce3fb04dbfd495141c11.zip |
Fix ImportWrappedKeyRequest Serialization
am: 4516ca7cc0
Change-Id: I13920ecf0b7903d8ccd7fd208019ed2d5cb250c9
-rw-r--r-- | android_keymaster/android_keymaster_messages.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/android_keymaster/android_keymaster_messages.cpp b/android_keymaster/android_keymaster_messages.cpp index 1c5695e..6eb6a5f 100644 --- a/android_keymaster/android_keymaster_messages.cpp +++ b/android_keymaster/android_keymaster_messages.cpp @@ -635,13 +635,14 @@ size_t ImportWrappedKeyRequest::SerializedSize() const { return sizeof(uint32_t) /* wrapped_key_data_length */ + wrapped_key.key_material_size + sizeof(uint32_t) /* wrapping_key_data_length */ + wrapping_key.key_material_size + sizeof(uint32_t) /* masking_key_data_length */ + masking_key.key_material_size + - additional_params.SerializedSize(); + additional_params.SerializedSize() + sizeof(uint64_t) /* password_sid */ + + sizeof(uint64_t) /* biometric_sid */; } uint8_t* ImportWrappedKeyRequest::Serialize(uint8_t* buf, const uint8_t* end) const { - serialize_key_blob(wrapped_key, buf, end); - serialize_key_blob(wrapping_key, buf, end); - serialize_key_blob(masking_key, buf, end); + buf = serialize_key_blob(wrapped_key, buf, end); + buf = serialize_key_blob(wrapping_key, buf, end); + buf = serialize_key_blob(masking_key, buf, end); buf = additional_params.Serialize(buf, end); buf = append_uint64_to_buf(buf, end, password_sid); return append_uint64_to_buf(buf, end, biometric_sid); |