Added stacktrace support with --enable-stack-trace option.
[silc.git] / lib / silccrypt / silchmac.c
index 970cc6001d1736c90d0909d835910e2322fbc390..1cce72cd2d4d3e175ba69c308abc4db812f4bac9 100644 (file)
@@ -130,6 +130,8 @@ bool silc_hmac_unregister(SilcHmacObject *hmac)
   while ((entry = silc_dlist_get(silc_hmac_list)) != SILC_LIST_END) {
     if (hmac == SILC_ALL_HMACS || entry == hmac) {
       silc_dlist_del(silc_hmac_list, entry);
+      silc_free(entry->name);
+      silc_free(entry);
 
       if (silc_dlist_count(silc_hmac_list) == 0) {
        silc_dlist_uninit(silc_hmac_list);
@@ -160,6 +162,24 @@ bool silc_hmac_register_default(void)
   return TRUE;
 }
 
+bool silc_hmac_unregister_all(void)
+{
+#ifndef SILC_EPOC
+  SilcHmacObject *entry;
+
+  if (!silc_hmac_list)
+    return FALSE;
+
+  silc_dlist_start(silc_hmac_list);
+  while ((entry = silc_dlist_get(silc_hmac_list)) != SILC_LIST_END) {
+    silc_hmac_unregister(entry);
+    if (!silc_hmac_list)
+      break;
+  }
+#endif /* SILC_EPOC */
+  return TRUE;
+}
+
 /* Allocates a new SilcHmac object of name of `name'.  The `hash' may
    be provided as argument.  If provided it is used as the hash function
    of the HMAC.  If it is NULL then the hash function is allocated and