From 2de4e5beb6728b911c5666ca8b3cd2cad0198196 Mon Sep 17 00:00:00 2001 From: Jakub Wlostowski Date: Wed, 23 Apr 2025 12:11:56 +0200 Subject: [PATCH] Fix unwrap concatenated Change-Id: Ia4774163f4870488be9c0427a9a7aa70da62dad5 --- src/hal-backend-security-keys-api.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hal-backend-security-keys-api.cpp b/src/hal-backend-security-keys-api.cpp index 664f08d..30a0883 100644 --- a/src/hal-backend-security-keys-api.cpp +++ b/src/hal-backend-security-keys-api.cpp @@ -1098,12 +1098,11 @@ int security_keys_unwrap_concatenated_data(const hal_security_keys_context_s con s_in.Serialize(in_memory); TZSerializer s_out; - uint32_t out_memory_size = KM_RSA_BLOCK_SIZE; + s_out.Push(new TZSerializableBinary(KM_RSA_BLOCK_SIZE, false)); bool with_pwd = !key_pwd.password.buffer ? 0 : 1; if (with_pwd) - out_memory_size += Params::DEFAULT_AES_GCM_TAG_LEN_BYTES; + s_out.Push(new TZSerializableBinary(Params::DEFAULT_AES_GCM_TAG_LEN_BYTES)); - s_out.Push(new TZSerializableBinary(out_memory_size, false)); TrustZoneMemory out_memory(*tz_context, s_out.GetSize(), TEEC_MEM_OUTPUT); s_out.Serialize(out_memory); -- 2.34.1