summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Maurer <mmaurer@google.com>2019-03-29 17:50:14 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-03-29 17:50:14 -0700
commit6848291870cbec392e0333d1fdfff24d68696a22 (patch)
tree849a47c7af12c4a1193795f028be7b3d7d53497a
parent4fc50d37c6a65f8a57006920602f603a3ac9776f (diff)
parent135c773309c3fe53caa02f29834c9d628fb7d7d8 (diff)
downloadandroid_system_keymaster-6848291870cbec392e0333d1fdfff24d68696a22.tar.gz
android_system_keymaster-6848291870cbec392e0333d1fdfff24d68696a22.tar.bz2
android_system_keymaster-6848291870cbec392e0333d1fdfff24d68696a22.zip
Fix ImportWrappedKeyRequest Serialization am: 4516ca7cc0 am: d33899190f
am: 135c773309 Change-Id: Ib31a55dd5fab5299a9d4f750a7856133d23d41d0
-rw-r--r--android_keymaster/android_keymaster_messages.cpp9
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);