projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updates.
[silc.git]
/
lib
/
silccrypt
/
silchmac.c
diff --git
a/lib/silccrypt/silchmac.c
b/lib/silccrypt/silchmac.c
index 77dce315b4693961ee662c34300b4eb7dac9f15b..1a00970e7f720f11dc8b386ef2f4353b09b209d0 100644
(file)
--- a/
lib/silccrypt/silchmac.c
+++ b/
lib/silccrypt/silchmac.c
@@
-86,6
+86,16
@@
bool silc_hmac_register(SilcHmacObject *hmac)
SILC_LOG_DEBUG(("Registering new HMAC `%s'", hmac->name));
SILC_LOG_DEBUG(("Registering new HMAC `%s'", hmac->name));
+ /* Check for existing */
+ if (silc_hmac_list) {
+ SilcHmacObject *entry;
+ silc_dlist_start(silc_hmac_list);
+ while ((entry = silc_dlist_get(silc_hmac_list)) != SILC_LIST_END) {
+ if (!strcmp(entry->name, hmac->name))
+ return FALSE;
+ }
+ }
+
new = silc_calloc(1, sizeof(*new));
new->name = strdup(hmac->name);
new->len = hmac->len;
new = silc_calloc(1, sizeof(*new));
new->name = strdup(hmac->name);
new->len = hmac->len;