Blame SOURCES/opencryptoki-3.16.0-d929fe8470e99f4dcbbd889e7aa87e147d0d5b48.patch

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