[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r3662 - trunk/OpenDNSSEC/libhsm/src

Jakob Schlyter jakob at kirei.se
Fri Aug 6 13:47:41 CEST 2010


Author: jakob
Date: 2010-08-06 13:47:41 +0200 (Fri, 06 Aug 2010)
New Revision: 3662

Modified:
   trunk/OpenDNSSEC/libhsm/src/libhsm.c
   trunk/OpenDNSSEC/libhsm/src/libhsm.h
Log:
more preperation for per module configuration

Modified: trunk/OpenDNSSEC/libhsm/src/libhsm.c
===================================================================
--- trunk/OpenDNSSEC/libhsm/src/libhsm.c	2010-08-06 11:35:47 UTC (rev 3661)
+++ trunk/OpenDNSSEC/libhsm/src/libhsm.c	2010-08-06 11:47:41 UTC (rev 3662)
@@ -466,6 +466,13 @@
     }
 }
 
+/*! Set default HSM configuration */
+static void
+hsm_config_default(hsm_config_t *config)
+{
+    config->privkey_only = 0;
+}
+
 /* creates a session_t structure, and automatically adds and initializes
  * a module_t struct for it
  */
@@ -1709,10 +1716,13 @@
             /*module = hsm_module_new();*/
             token_label = NULL;
             module_path = NULL;
-            module_pin = NULL;            
+            module_pin = NULL;
+            hsm_config_default(&module_config);
+                 
             curNode = xpath_obj->nodesetval->nodeTab[i]->xmlChildrenNode;
             repository = (char *) xmlGetProp(xpath_obj->nodesetval->nodeTab[i],
                                              (const xmlChar *)"name");
+
             while (curNode) {
                 if (xmlStrEqual(curNode->name, (const xmlChar *)"TokenLabel"))
                     token_label = (char *) xmlNodeGetContent(curNode);
@@ -1722,6 +1732,7 @@
                     module_pin = (char *) xmlNodeGetContent(curNode);
                 curNode = curNode->next;
             }
+
             if (repository && token_label && module_path) {
                 if (module_pin) {
                     result = hsm_attach(repository,

Modified: trunk/OpenDNSSEC/libhsm/src/libhsm.h
===================================================================
--- trunk/OpenDNSSEC/libhsm/src/libhsm.h	2010-08-06 11:35:47 UTC (rev 3661)
+++ trunk/OpenDNSSEC/libhsm/src/libhsm.h	2010-08-06 11:47:41 UTC (rev 3662)
@@ -52,8 +52,7 @@
 
 /*! HSM configuration */
 typedef struct {
-    /* Prevent build warning, remove when we have an actual member */
-    int tmp_member;
+    unsigned int privkey_only;   /*!< Use private keys only */
 } hsm_config_t;
 
 /*! Data type to describe an HSM */




More information about the Opendnssec-commits mailing list