Fix ECDH key object populate for x86_64 build 14/315614/1
authorJakub Wlostowski <j.wlostowski@samsung.com>
Tue, 3 Dec 2024 14:10:28 +0000 (15:10 +0100)
committerJakub Wlostowski <j.wlostowski@samsung.com>
Tue, 3 Dec 2024 14:10:28 +0000 (15:10 +0100)
Some security tests were crashing and some failing
as we tried to change objectSize also for value attribute.

Change-Id: Ia4fd6c08352491660ac61fab8a0fed8e82325815

ssflib/src/ssf_storage.cpp

index 8cb9bedcfb86bfbff1e10247daefb712270b7513..01d4cce87ef12ecfc22b3b4f26aa0b5d46ad933f 100644 (file)
@@ -1514,9 +1514,11 @@ TEE_Result TEE_PopulateTransientObject(TEE_ObjectHandle object,
                }
                copy_attribute(&curr_attr[i], (TEE_Attribute*)&attrs[i]);
                tr->attr.attr_number++;
-               tr->info.objectSize =
-                   tr->info.objectSize > attrs[i].content.ref.length * 8 ?
-                       tr->info.objectSize : attrs[i].content.ref.length * 8;
+               if (!isValueAttr(attrs[i].attributeID)) {
+                       tr->info.objectSize =
+                                       tr->info.objectSize > attrs[i].content.ref.length * 8 ?
+                                                       tr->info.objectSize : attrs[i].content.ref.length * 8;
+               }
        }
 
        switch (tr->info.objectType) {