[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r4055 - trunk/OpenDNSSEC/signer/src/signer

Matthijs Mekking matthijs at nlnetlabs.nl
Tue Oct 5 16:24:18 CEST 2010


Author: matthijs
Date: 2010-10-05 16:24:18 +0200 (Tue, 05 Oct 2010)
New Revision: 4055

Modified:
   trunk/OpenDNSSEC/signer/src/signer/se_key.c
   trunk/OpenDNSSEC/signer/src/signer/se_key.h
Log:
lookup a key in keylist by locator



Modified: trunk/OpenDNSSEC/signer/src/signer/se_key.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/se_key.c	2010-10-05 13:40:00 UTC (rev 4054)
+++ trunk/OpenDNSSEC/signer/src/signer/se_key.c	2010-10-05 14:24:18 UTC (rev 4055)
@@ -278,6 +278,30 @@
 
 
 /**
+ * Lookup a key in the key list by locator.
+ *
+ */
+key_type*
+keylist_lookup(keylist_type* list, const char* locator)
+{
+    key_type* search = NULL;
+    size_t i = 0;
+
+    if (!list || !locator) {
+        return NULL;
+    }
+
+    search = list->first_key;
+    for (i=0; i < list->count; i++) {
+        if (search && se_strcmp(search->locator, locator) == 0) {
+            return search;
+        }
+    }
+    return NULL;
+}
+
+
+/**
  * Compare two key lists.
  *
  */

Modified: trunk/OpenDNSSEC/signer/src/signer/se_key.h
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/se_key.h	2010-10-05 13:40:00 UTC (rev 4054)
+++ trunk/OpenDNSSEC/signer/src/signer/se_key.h	2010-10-05 14:24:18 UTC (rev 4055)
@@ -135,6 +135,16 @@
 int key_compare(key_type* a, key_type* b);
 
 /**
+ * Lookup a key in the key list by locator.
+ * \param[in] kl key list
+ * \param[in] locator  key locator
+ * \return key_type* key if it exists, NULL otherwise
+ *
+ */
+key_type* keylist_lookup(keylist_type* kl, const char* locator);
+
+
+/**
  * Delete a key from the keylist.
  * \param[in] kl key list
  * \param[in] key key




More information about the Opendnssec-commits mailing list