Blame SOURCES/opencryptoki-3.16.0-d929fe8470e99f4dcbbd889e7aa87e147d0d5b48.patch

8520e9
commit d929fe8470e99f4dcbbd889e7aa87e147d0d5b48
8520e9
Author: Ingo Franzki <ifranzki@linux.ibm.com>
8520e9
Date:   Fri Feb 12 11:25:21 2021 +0100
8520e9
8520e9
    Externalize linked list functions
8520e9
    
8520e9
    Externalize the linked list functions (dlist_xxx), so that they
8520e9
    can also be used on pkcsslotd.
8520e9
    
8520e9
    Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
8520e9
8520e9
diff --git a/usr/lib/cca_stdll/cca_stdll.mk b/usr/lib/cca_stdll/cca_stdll.mk
8520e9
index bd230b9f..c5e86fa7 100644
8520e9
--- a/usr/lib/cca_stdll/cca_stdll.mk
8520e9
+++ b/usr/lib/cca_stdll/cca_stdll.mk
8520e9
@@ -35,7 +35,8 @@ opencryptoki_stdll_libpkcs11_cca_la_SOURCES =				\
8520e9
 	usr/lib/common/mech_ssl3.c usr/lib/common/verify_mgr.c		\
8520e9
 	usr/lib/common/p11util.c usr/lib/common/sw_crypt.c		\
8520e9
 	usr/lib/common/shared_memory.c usr/lib/common/profile_obj.c	\
8520e9
-	usr/lib/cca_stdll/cca_specific.c usr/lib/common/attributes.c
8520e9
+	usr/lib/cca_stdll/cca_specific.c usr/lib/common/attributes.c	\
8520e9
+	usr/lib/common/dlist.c
8520e9
 
8520e9
 if ENABLE_LOCKS
8520e9
 opencryptoki_stdll_libpkcs11_cca_la_SOURCES +=				\
8520e9
diff --git a/usr/lib/common/dlist.c b/usr/lib/common/dlist.c
8520e9
new file mode 100644
8520e9
index 00000000..1fee1ea9
8520e9
--- /dev/null
8520e9
+++ b/usr/lib/common/dlist.c
8520e9
@@ -0,0 +1,218 @@
8520e9
+/*
8520e9
+ * COPYRIGHT (c) International Business Machines Corp. 2021
8520e9
+ *
8520e9
+ * This program is provided under the terms of the Common Public License,
8520e9
+ * version 1.0 (CPL-1.0). Any use, reproduction or distribution for this
8520e9
+ * software constitutes recipient's acceptance of CPL-1.0 terms which can be
8520e9
+ * found in the file LICENSE file or at
8520e9
+ * https://opensource.org/licenses/cpl1.0.php
8520e9
+ */
8520e9
+
8520e9
+#include <stdio.h>
8520e9
+#include <stdlib.h>
8520e9
+#include <string.h>
8520e9
+#include <unistd.h>
8520e9
+#include <sys/types.h>
8520e9
+#include <errno.h>
8520e9
+
8520e9
+#include "dlist.h"
8520e9
+#include "host_defs.h"
8520e9
+#include "h_extern.h"
8520e9
+
8520e9
+
8520e9
+// Function:  dlist_add_as_first()
8520e9
+//
8520e9
+// Adds the specified node to the start of the list
8520e9
+//
8520e9
+// Returns:  pointer to the start of the list
8520e9
+//
8520e9
+DL_NODE *dlist_add_as_first(DL_NODE *list, void *data)
8520e9
+{
8520e9
+    DL_NODE *node = NULL;
8520e9
+
8520e9
+    if (!data)
8520e9
+        return list;
8520e9
+
8520e9
+    node = (DL_NODE *) malloc(sizeof(DL_NODE));
8520e9
+    if (!node)
8520e9
+        return NULL;
8520e9
+
8520e9
+    node->data = data;
8520e9
+    node->prev = NULL;
8520e9
+    node->next = list;
8520e9
+    if (list)
8520e9
+        list->prev = node;
8520e9
+
8520e9
+    return node;
8520e9
+}
8520e9
+
8520e9
+// Function:  dlist_add_as_last()
8520e9
+//
8520e9
+// Adds the specified node to the end of the list
8520e9
+//
8520e9
+// Returns:  pointer to the start of the list
8520e9
+//
8520e9
+DL_NODE *dlist_add_as_last(DL_NODE *list, void *data)
8520e9
+{
8520e9
+    DL_NODE *node = NULL;
8520e9
+
8520e9
+    if (!data)
8520e9
+        return list;
8520e9
+
8520e9
+    node = (DL_NODE *) malloc(sizeof(DL_NODE));
8520e9
+    if (!node)
8520e9
+        return NULL;
8520e9
+
8520e9
+    node->data = data;
8520e9
+    node->next = NULL;
8520e9
+
8520e9
+    if (!list) {
8520e9
+        node->prev = NULL;
8520e9
+        return node;
8520e9
+    } else {
8520e9
+        DL_NODE *temp = dlist_get_last(list);
8520e9
+        temp->next = node;
8520e9
+        node->prev = temp;
8520e9
+
8520e9
+        return list;
8520e9
+    }
8520e9
+}
8520e9
+
8520e9
+// Function:  dlist_find()
8520e9
+//
8520e9
+DL_NODE *dlist_find(DL_NODE *list, void *data)
8520e9
+{
8520e9
+    DL_NODE *node = list;
8520e9
+
8520e9
+    while (node && node->data != data)
8520e9
+        node = node->next;
8520e9
+
8520e9
+    return node;
8520e9
+}
8520e9
+
8520e9
+// Function:  dlist_get_first()
8520e9
+//
8520e9
+// Returns the last node in the list or NULL if list is empty
8520e9
+//
8520e9
+DL_NODE *dlist_get_first(DL_NODE *list)
8520e9
+{
8520e9
+    DL_NODE *temp = list;
8520e9
+
8520e9
+    if (!list)
8520e9
+        return NULL;
8520e9
+
8520e9
+    while (temp->prev != NULL)
8520e9
+        temp = temp->prev;
8520e9
+
8520e9
+    return temp;
8520e9
+}
8520e9
+
8520e9
+// Function:  dlist_get_last()
8520e9
+//
8520e9
+// Returns the last node in the list or NULL if list is empty
8520e9
+//
8520e9
+DL_NODE *dlist_get_last(DL_NODE *list)
8520e9
+{
8520e9
+    DL_NODE *temp = list;
8520e9
+
8520e9
+    if (!list)
8520e9
+        return NULL;
8520e9
+
8520e9
+    while (temp->next != NULL)
8520e9
+        temp = temp->next;
8520e9
+
8520e9
+    return temp;
8520e9
+}
8520e9
+
8520e9
+//
8520e9
+//
8520e9
+CK_ULONG dlist_length(DL_NODE *list)
8520e9
+{
8520e9
+    DL_NODE *temp = list;
8520e9
+    CK_ULONG len = 0;
8520e9
+
8520e9
+    while (temp) {
8520e9
+        len++;
8520e9
+        temp = temp->next;
8520e9
+    }
8520e9
+
8520e9
+    return len;
8520e9
+}
8520e9
+
8520e9
+//
8520e9
+//
8520e9
+DL_NODE *dlist_next(DL_NODE *node)
8520e9
+{
8520e9
+    if (!node)
8520e9
+        return NULL;
8520e9
+
8520e9
+    return node->next;
8520e9
+}
8520e9
+
8520e9
+//
8520e9
+//
8520e9
+DL_NODE *dlist_prev(DL_NODE *node)
8520e9
+{
8520e9
+    if (!node)
8520e9
+        return NULL;
8520e9
+
8520e9
+    return node->prev;
8520e9
+}
8520e9
+
8520e9
+//
8520e9
+//
8520e9
+void dlist_purge(DL_NODE *list)
8520e9
+{
8520e9
+    DL_NODE *node;
8520e9
+
8520e9
+    if (!list)
8520e9
+        return;
8520e9
+
8520e9
+    do {
8520e9
+        node = list->next;
8520e9
+        free(list);
8520e9
+        list = node;
8520e9
+    } while (list);
8520e9
+}
8520e9
+
8520e9
+// Function:  dlist_remove_node()
8520e9
+//
8520e9
+// Attempts to remove the specified node from the list.  The caller is
8520e9
+// responsible for freeing the data associated with the node prior to
8520e9
+// calling this routine
8520e9
+//
8520e9
+DL_NODE *dlist_remove_node(DL_NODE *list, DL_NODE *node)
8520e9
+{
8520e9
+    DL_NODE *temp = list;
8520e9
+
8520e9
+    if (!list || !node)
8520e9
+        return NULL;
8520e9
+
8520e9
+    // special case:  removing head of the list
8520e9
+    //
8520e9
+    if (list == node) {
8520e9
+        temp = list->next;
8520e9
+        if (temp)
8520e9
+            temp->prev = NULL;
8520e9
+
8520e9
+        free(list);
8520e9
+        return temp;
8520e9
+    }
8520e9
+    // we have no guarantee that the node is in the list
8520e9
+    // so search through the list to find it
8520e9
+    //
8520e9
+    while ((temp != NULL) && (temp->next != node))
8520e9
+        temp = temp->next;
8520e9
+
8520e9
+    if (temp != NULL) {
8520e9
+        DL_NODE *next = node->next;
8520e9
+
8520e9
+        temp->next = next;
8520e9
+        if (next)
8520e9
+            next->prev = temp;
8520e9
+
8520e9
+        free(node);
8520e9
+    }
8520e9
+
8520e9
+    return list;
8520e9
+}
8520e9
diff --git a/usr/lib/common/dlist.h b/usr/lib/common/dlist.h
8520e9
new file mode 100644
8520e9
index 00000000..eda4af9c
8520e9
--- /dev/null
8520e9
+++ b/usr/lib/common/dlist.h
8520e9
@@ -0,0 +1,32 @@
8520e9
+/*
8520e9
+ * COPYRIGHT (c) International Business Machines Corp. 2021
8520e9
+ *
8520e9
+ * This program is provided under the terms of the Common Public License,
8520e9
+ * version 1.0 (CPL-1.0). Any use, reproduction or distribution for this
8520e9
+ * software constitutes recipient's acceptance of CPL-1.0 terms which can be
8520e9
+ * found in the file LICENSE file or at
8520e9
+ * https://opensource.org/licenses/cpl1.0.php
8520e9
+ */
8520e9
+
8520e9
+
8520e9
+
8520e9
+#ifndef _DLIST_H_
8520e9
+#define _DLIST_H_
8520e9
+
8520e9
+#include "pkcs11types.h"
8520e9
+#include "defs.h"
8520e9
+
8520e9
+// linked-list routines
8520e9
+//
8520e9
+DL_NODE *dlist_add_as_first(DL_NODE *list, void *data);
8520e9
+DL_NODE *dlist_add_as_last(DL_NODE *list, void *data);
8520e9
+DL_NODE *dlist_find(DL_NODE *list, void *data);
8520e9
+DL_NODE *dlist_get_first(DL_NODE *list);
8520e9
+DL_NODE *dlist_get_last(DL_NODE *list);
8520e9
+CK_ULONG dlist_length(DL_NODE *list);
8520e9
+DL_NODE *dlist_next(DL_NODE *list);
8520e9
+DL_NODE *dlist_prev(DL_NODE *list);
8520e9
+void dlist_purge(DL_NODE *list);
8520e9
+DL_NODE *dlist_remove_node(DL_NODE *list, DL_NODE *node);
8520e9
+
8520e9
+#endif
8520e9
diff --git a/usr/lib/common/h_extern.h b/usr/lib/common/h_extern.h
8520e9
index 63aff79f..5e251d95 100644
8520e9
--- a/usr/lib/common/h_extern.h
8520e9
+++ b/usr/lib/common/h_extern.h
8520e9
@@ -24,6 +24,7 @@
8520e9
 #define _H_EXTERN_H
8520e9
 
8520e9
 #include <stdio.h>
8520e9
+#include "dlist.h"
8520e9
 
8520e9
 // global variables
8520e9
 //
8520e9
@@ -1759,19 +1760,6 @@ int ec_point_from_public_data(const CK_BYTE *data, CK_ULONG data_len,
8520e9
                               CK_BBOOL *allocated, CK_BYTE **ec_point,
8520e9
                               CK_ULONG *ec_point_len);
8520e9
 
8520e9
-// linked-list routines
8520e9
-//
8520e9
-DL_NODE *dlist_add_as_first(DL_NODE *list, void *data);
8520e9
-DL_NODE *dlist_add_as_last(DL_NODE *list, void *data);
8520e9
-DL_NODE *dlist_find(DL_NODE *list, void *data);
8520e9
-DL_NODE *dlist_get_first(DL_NODE *list);
8520e9
-DL_NODE *dlist_get_last(DL_NODE *list);
8520e9
-CK_ULONG dlist_length(DL_NODE *list);
8520e9
-DL_NODE *dlist_next(DL_NODE *list);
8520e9
-DL_NODE *dlist_prev(DL_NODE *list);
8520e9
-void dlist_purge(DL_NODE *list);
8520e9
-DL_NODE *dlist_remove_node(DL_NODE *list, DL_NODE *node);
8520e9
-
8520e9
 CK_RV attach_shm(STDLL_TokData_t *tokdata, CK_SLOT_ID slot_id);
8520e9
 CK_RV detach_shm(STDLL_TokData_t *tokdata, CK_BBOOL ignore_ref_count);
8520e9
 
8520e9
diff --git a/usr/lib/common/utility.c b/usr/lib/common/utility.c
8520e9
index 38d8d959..b2c6ee50 100644
8520e9
--- a/usr/lib/common/utility.c
8520e9
+++ b/usr/lib/common/utility.c
8520e9
@@ -40,203 +40,6 @@
8520e9
 #include <sys/file.h>
8520e9
 #include <syslog.h>
8520e9
 
8520e9
-// Function:  dlist_add_as_first()
8520e9
-//
8520e9
-// Adds the specified node to the start of the list
8520e9
-//
8520e9
-// Returns:  pointer to the start of the list
8520e9
-//
8520e9
-DL_NODE *dlist_add_as_first(DL_NODE *list, void *data)
8520e9
-{
8520e9
-    DL_NODE *node = NULL;
8520e9
-
8520e9
-    if (!data)
8520e9
-        return list;
8520e9
-
8520e9
-    node = (DL_NODE *) malloc(sizeof(DL_NODE));
8520e9
-    if (!node)
8520e9
-        return NULL;
8520e9
-
8520e9
-    node->data = data;
8520e9
-    node->prev = NULL;
8520e9
-    node->next = list;
8520e9
-    if (list)
8520e9
-        list->prev = node;
8520e9
-
8520e9
-    return node;
8520e9
-}
8520e9
-
8520e9
-// Function:  dlist_add_as_last()
8520e9
-//
8520e9
-// Adds the specified node to the end of the list
8520e9
-//
8520e9
-// Returns:  pointer to the start of the list
8520e9
-//
8520e9
-DL_NODE *dlist_add_as_last(DL_NODE *list, void *data)
8520e9
-{
8520e9
-    DL_NODE *node = NULL;
8520e9
-
8520e9
-    if (!data)
8520e9
-        return list;
8520e9
-
8520e9
-    node = (DL_NODE *) malloc(sizeof(DL_NODE));
8520e9
-    if (!node)
8520e9
-        return NULL;
8520e9
-
8520e9
-    node->data = data;
8520e9
-    node->next = NULL;
8520e9
-
8520e9
-    if (!list) {
8520e9
-        node->prev = NULL;
8520e9
-        return node;
8520e9
-    } else {
8520e9
-        DL_NODE *temp = dlist_get_last(list);
8520e9
-        temp->next = node;
8520e9
-        node->prev = temp;
8520e9
-
8520e9
-        return list;
8520e9
-    }
8520e9
-}
8520e9
-
8520e9
-// Function:  dlist_find()
8520e9
-//
8520e9
-DL_NODE *dlist_find(DL_NODE *list, void *data)
8520e9
-{
8520e9
-    DL_NODE *node = list;
8520e9
-
8520e9
-    while (node && node->data != data)
8520e9
-        node = node->next;
8520e9
-
8520e9
-    return node;
8520e9
-}
8520e9
-
8520e9
-// Function:  dlist_get_first()
8520e9
-//
8520e9
-// Returns the last node in the list or NULL if list is empty
8520e9
-//
8520e9
-DL_NODE *dlist_get_first(DL_NODE *list)
8520e9
-{
8520e9
-    DL_NODE *temp = list;
8520e9
-
8520e9
-    if (!list)
8520e9
-        return NULL;
8520e9
-
8520e9
-    while (temp->prev != NULL)
8520e9
-        temp = temp->prev;
8520e9
-
8520e9
-    return temp;
8520e9
-}
8520e9
-
8520e9
-// Function:  dlist_get_last()
8520e9
-//
8520e9
-// Returns the last node in the list or NULL if list is empty
8520e9
-//
8520e9
-DL_NODE *dlist_get_last(DL_NODE *list)
8520e9
-{
8520e9
-    DL_NODE *temp = list;
8520e9
-
8520e9
-    if (!list)
8520e9
-        return NULL;
8520e9
-
8520e9
-    while (temp->next != NULL)
8520e9
-        temp = temp->next;
8520e9
-
8520e9
-    return temp;
8520e9
-}
8520e9
-
8520e9
-//
8520e9
-//
8520e9
-CK_ULONG dlist_length(DL_NODE *list)
8520e9
-{
8520e9
-    DL_NODE *temp = list;
8520e9
-    CK_ULONG len = 0;
8520e9
-
8520e9
-    while (temp) {
8520e9
-        len++;
8520e9
-        temp = temp->next;
8520e9
-    }
8520e9
-
8520e9
-    return len;
8520e9
-}
8520e9
-
8520e9
-//
8520e9
-//
8520e9
-DL_NODE *dlist_next(DL_NODE *node)
8520e9
-{
8520e9
-    if (!node)
8520e9
-        return NULL;
8520e9
-
8520e9
-    return node->next;
8520e9
-}
8520e9
-
8520e9
-//
8520e9
-//
8520e9
-DL_NODE *dlist_prev(DL_NODE *node)
8520e9
-{
8520e9
-    if (!node)
8520e9
-        return NULL;
8520e9
-
8520e9
-    return node->prev;
8520e9
-}
8520e9
-
8520e9
-//
8520e9
-//
8520e9
-void dlist_purge(DL_NODE *list)
8520e9
-{
8520e9
-    DL_NODE *node;
8520e9
-
8520e9
-    if (!list)
8520e9
-        return;
8520e9
-
8520e9
-    do {
8520e9
-        node = list->next;
8520e9
-        free(list);
8520e9
-        list = node;
8520e9
-    } while (list);
8520e9
-}
8520e9
-
8520e9
-// Function:  dlist_remove_node()
8520e9
-//
8520e9
-// Attempts to remove the specified node from the list.  The caller is
8520e9
-// responsible for freeing the data associated with the node prior to
8520e9
-// calling this routine
8520e9
-//
8520e9
-DL_NODE *dlist_remove_node(DL_NODE *list, DL_NODE *node)
8520e9
-{
8520e9
-    DL_NODE *temp = list;
8520e9
-
8520e9
-    if (!list || !node)
8520e9
-        return NULL;
8520e9
-
8520e9
-    // special case:  removing head of the list
8520e9
-    //
8520e9
-    if (list == node) {
8520e9
-        temp = list->next;
8520e9
-        if (temp)
8520e9
-            temp->prev = NULL;
8520e9
-
8520e9
-        free(list);
8520e9
-        return temp;
8520e9
-    }
8520e9
-    // we have no guarantee that the node is in the list
8520e9
-    // so search through the list to find it
8520e9
-    //
8520e9
-    while ((temp != NULL) && (temp->next != node))
8520e9
-        temp = temp->next;
8520e9
-
8520e9
-    if (temp != NULL) {
8520e9
-        DL_NODE *next = node->next;
8520e9
-
8520e9
-        temp->next = next;
8520e9
-        if (next)
8520e9
-            next->prev = temp;
8520e9
-
8520e9
-        free(node);
8520e9
-    }
8520e9
-
8520e9
-    return list;
8520e9
-}
8520e9
-
8520e9
 CK_RV CreateXProcLock(char *tokname, STDLL_TokData_t *tokdata)
8520e9
 {
8520e9
     char lockfile[PATH_MAX];
8520e9
diff --git a/usr/lib/ep11_stdll/ep11_stdll.mk b/usr/lib/ep11_stdll/ep11_stdll.mk
8520e9
index bc617124..b5574d9e 100644
8520e9
--- a/usr/lib/ep11_stdll/ep11_stdll.mk
8520e9
+++ b/usr/lib/ep11_stdll/ep11_stdll.mk
8520e9
@@ -36,7 +36,7 @@ opencryptoki_stdll_libpkcs11_ep11_la_SOURCES =				\
8520e9
 	usr/lib/common/utility.c usr/lib/common/trace.c			\
8520e9
 	usr/lib/common/mech_list.c usr/lib/common/shared_memory.c	\
8520e9
 	usr/lib/common/attributes.c usr/lib/common/sw_crypt.c		\
8520e9
-	usr/lib/common/profile_obj.c					\
8520e9
+	usr/lib/common/profile_obj.c usr/lib/common/dlist.c		\
8520e9
 	usr/lib/common/pkey_utils.c					\
8520e9
 	usr/lib/ep11_stdll/new_host.c usr/lib/ep11_stdll/ep11_specific.c
8520e9
 
8520e9
diff --git a/usr/lib/ica_s390_stdll/ica_s390_stdll.mk b/usr/lib/ica_s390_stdll/ica_s390_stdll.mk
8520e9
index d8448486..8f467e11 100644
8520e9
--- a/usr/lib/ica_s390_stdll/ica_s390_stdll.mk
8520e9
+++ b/usr/lib/ica_s390_stdll/ica_s390_stdll.mk
8520e9
@@ -34,7 +34,7 @@ opencryptoki_stdll_libpkcs11_ica_la_SOURCES =				\
8520e9
 	usr/lib/common/verify_mgr.c usr/lib/common/trace.c		\
8520e9
 	usr/lib/common/mech_list.c usr/lib/common/shared_memory.c	\
8520e9
 	usr/lib/common/profile_obj.c usr/lib/common/attributes.c	\
8520e9
-	usr/lib/ica_s390_stdll/ica_specific.c
8520e9
+	usr/lib/ica_s390_stdll/ica_specific.c usr/lib/common/dlist.c
8520e9
 
8520e9
 if ENABLE_LOCKS
8520e9
 opencryptoki_stdll_libpkcs11_ica_la_SOURCES +=				\
8520e9
diff --git a/usr/lib/icsf_stdll/icsf_stdll.mk b/usr/lib/icsf_stdll/icsf_stdll.mk
8520e9
index 788478c2..21c64f9a 100644
8520e9
--- a/usr/lib/icsf_stdll/icsf_stdll.mk
8520e9
+++ b/usr/lib/icsf_stdll/icsf_stdll.mk
8520e9
@@ -43,7 +43,7 @@ opencryptoki_stdll_libpkcs11_icsf_la_SOURCES =				\
8520e9
 	usr/lib/common/mech_ssl3.c usr/lib/common/verify_mgr.c		\
8520e9
 	usr/lib/common/mech_list.c usr/lib/common/shared_memory.c	\
8520e9
 	usr/lib/common/attributes.c usr/lib/icsf_stdll/new_host.c	\
8520e9
-	usr/lib/common/profile_obj.c					\
8520e9
+	usr/lib/common/profile_obj.c usr/lib/common/dlist.c		\
8520e9
 	usr/lib/icsf_stdll/pbkdf.c usr/lib/icsf_stdll/icsf_specific.c	\
8520e9
 	usr/lib/icsf_stdll/icsf_config_parse.y				\
8520e9
 	usr/lib/icsf_stdll/icsf_config_lexer.l				\
8520e9
diff --git a/usr/lib/soft_stdll/soft_stdll.mk b/usr/lib/soft_stdll/soft_stdll.mk
8520e9
index cea802b5..ac401539 100644
8520e9
--- a/usr/lib/soft_stdll/soft_stdll.mk
8520e9
+++ b/usr/lib/soft_stdll/soft_stdll.mk
8520e9
@@ -32,7 +32,8 @@ opencryptoki_stdll_libpkcs11_sw_la_SOURCES =				\
8520e9
 	usr/lib/common/utility.c usr/lib/common/verify_mgr.c		\
8520e9
 	usr/lib/common/trace.c usr/lib/common/mech_list.c		\
8520e9
 	usr/lib/common/shared_memory.c usr/lib/common/profile_obj.c	\
8520e9
-	usr/lib/soft_stdll/soft_specific.c usr/lib/common/attributes.c
8520e9
+	usr/lib/soft_stdll/soft_specific.c usr/lib/common/attributes.c	\
8520e9
+	usr/lib/common/dlist.c
8520e9
 
8520e9
 if ENABLE_LOCKS
8520e9
 opencryptoki_stdll_libpkcs11_sw_la_SOURCES +=				\
8520e9
diff --git a/usr/lib/tpm_stdll/tpm_stdll.mk b/usr/lib/tpm_stdll/tpm_stdll.mk
8520e9
index f199a103..0e0eb024 100644
8520e9
--- a/usr/lib/tpm_stdll/tpm_stdll.mk
8520e9
+++ b/usr/lib/tpm_stdll/tpm_stdll.mk
8520e9
@@ -34,7 +34,8 @@ opencryptoki_stdll_libpkcs11_tpm_la_SOURCES =				\
8520e9
 	usr/lib/common/verify_mgr.c usr/lib/common/mech_list.c		\
8520e9
 	usr/lib/common/shared_memory.c usr/lib/common/profile_obj.c	\
8520e9
 	usr/lib/tpm_stdll/tpm_specific.c usr/lib/common/attributes.c	\
8520e9
-	usr/lib/tpm_stdll/tpm_openssl.c usr/lib/tpm_stdll/tpm_util.c
8520e9
+	usr/lib/tpm_stdll/tpm_openssl.c usr/lib/tpm_stdll/tpm_util.c	\
8520e9
+	usr/lib/common/dlist.c
8520e9
 
8520e9
 if ENABLE_LOCKS
8520e9
 opencryptoki_stdll_libpkcs11_tpm_la_SOURCES +=				\
8520e9
diff --git a/usr/sbin/pkcscca/pkcscca.mk b/usr/sbin/pkcscca/pkcscca.mk
8520e9
index a223265f..cc40f819 100644
8520e9
--- a/usr/sbin/pkcscca/pkcscca.mk
8520e9
+++ b/usr/sbin/pkcscca/pkcscca.mk
8520e9
@@ -36,7 +36,7 @@ usr_sbin_pkcscca_pkcscca_SOURCES =					\
8520e9
 	usr/lib/common/p11util.c usr/lib/common/sw_crypt.c		\
8520e9
 	usr/lib/common/shared_memory.c usr/lib/common/profile_obj.c	\
8520e9
 	usr/lib/common/attributes.c usr/lib/common/mech_rng.c		\
8520e9
-	usr/lib/common/pkcs_utils.c 					\
8520e9
+	usr/lib/common/pkcs_utils.c  usr/lib/common/dlist.c		\
8520e9
 	usr/sbin/pkcscca/pkcscca.c
8520e9
 	
8520e9
 	
8520e9
diff --git a/usr/sbin/pkcsslotd/pkcsslotd.mk b/usr/sbin/pkcsslotd/pkcsslotd.mk
8520e9
index 4f0e3c56..2d36b4a9 100644
8520e9
--- a/usr/sbin/pkcsslotd/pkcsslotd.mk
8520e9
+++ b/usr/sbin/pkcsslotd/pkcsslotd.mk
8520e9
@@ -21,5 +21,6 @@ usr_sbin_pkcsslotd_pkcsslotd_SOURCES =							\
8520e9
 	usr/sbin/pkcsslotd/socket_server.c
8520e9
 
8520e9
 nodist_usr_sbin_pkcsslotd_pkcsslotd_SOURCES = \
8520e9
-	usr/lib/common/parser.h usr/lib/common/parser.c	usr/lib/common/lexer.c
8520e9
+	usr/lib/common/parser.h usr/lib/common/parser.c	usr/lib/common/lexer.c		\
8520e9
+	usr/lib/common/dlist.c
8520e9
 usr/sbin/pkcsslotd/slotmgr.$(OBJEXT): usr/lib/common/parser.h