Fix AAD param init on x86_64 build 17/315617/2
authorJakub Wlostowski <j.wlostowski@samsung.com>
Tue, 3 Dec 2024 15:16:54 +0000 (16:16 +0100)
committerJakub Wlostowski <j.wlostowski@samsung.com>
Thu, 12 Dec 2024 10:20:53 +0000 (11:20 +0100)
Change-Id: I66d70747fd23ff698863ea051df860cea2babca5

ta/include/cipher_ctx_list.h
ta/src/cipher_ctx_list.c

index d47311eb3af82730205fb605cf2f5e70507ecb7a..3c0ca14a0d611c8d899804061fdfc8f50a850bd6 100644 (file)
@@ -4,7 +4,7 @@
 typedef struct listNode
 {
     struct listNode *next;
-    uintptr_t id; // random value
+    uint32_t id; // random value
     uint32_t last_access; // System Time in second
     TEE_OperationHandle oper;
     uint32_t tag_len_bits;
@@ -12,6 +12,6 @@ typedef struct listNode
 
 #define MAX_CTX_TIMEOUT 600 // 10 minutes
 
-listNode *ctxl_read_node_id(uintptr_t id);
+listNode *ctxl_read_node_id(uint32_t id);
 listNode *ctxl_add_last_node(TEE_OperationHandle oper, uint32_t tag_len_bits);
-void ctxl_delete_node_id(uintptr_t id);
+void ctxl_delete_node_id(uint32_t id);
index 1d3c19eb6699e8cf1dea86fed7e3f1d5d7f38434..65b1775aa63879dcc85e6ee4084243b43acbcff6 100644 (file)
@@ -1,3 +1,4 @@
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -57,7 +58,7 @@ static listNode *find_end_remove_expired()
     return (prev);
 }
 
-listNode *ctxl_read_node_id(uintptr_t id)
+listNode *ctxl_read_node_id(uint32_t id)
 {
     listNode *cur;
     cur = head.next; // skip head node
@@ -82,7 +83,7 @@ listNode *ctxl_add_last_node(TEE_OperationHandle oper, uint32_t tag_len_bits)
     end = find_end_remove_expired();
     listNode *newNode;
     newNode = (listNode *) TEE_Malloc(sizeof(listNode), 0);
-    newNode->id = (uintptr_t) oper; // Use the pointer of operation.
+    newNode->id = (uint32_t)((ptrdiff_t)oper); // Use the pointer of operation.
     newNode->oper = oper;
     newNode->tag_len_bits = tag_len_bits;
     newNode->next = NULL;
@@ -94,7 +95,7 @@ listNode *ctxl_add_last_node(TEE_OperationHandle oper, uint32_t tag_len_bits)
     return (newNode);
 }
 
-void ctxl_delete_node_id(uintptr_t id)
+void ctxl_delete_node_id(uint32_t id)
 {
     listNode *prev, *cur;