Blame SOURCES/opencryptoki-3.16.0-d929fe8470e99f4dcbbd889e7aa87e147d0d5b48.patch

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