From bacc89f789c28ce16b47a2a456d25ddeb74b75a3 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 8 Jul 2007 17:25:17 +0000 Subject: [PATCH] Moved public key hash table util functions to crypto library. --- lib/silcutil/silcutil.c | 28 ---------------------------- lib/silcutil/silcutil.h | 31 +------------------------------ 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/lib/silcutil/silcutil.c b/lib/silcutil/silcutil.c index a63efa9f..12315f7f 100644 --- a/lib/silcutil/silcutil.c +++ b/lib/silcutil/silcutil.c @@ -380,25 +380,6 @@ SilcUInt32 silc_hash_data(void *key, void *user_context) return h; } -/* Hash public key of any type. */ - -SilcUInt32 silc_hash_public_key(void *key, void *user_context) -{ - SilcPublicKey public_key = key; - unsigned char *pk; - SilcUInt32 pk_len; - SilcUInt32 hash = 0; - - pk = silc_pkcs_public_key_encode(public_key, &pk_len); - if (!pk) - return hash; - - hash = silc_hash_data(pk, SILC_32_TO_PTR(pk_len)); - silc_free(pk); - - return hash; -} - /* Compares two strings. It may be used as SilcHashTable comparison function. */ @@ -454,15 +435,6 @@ SilcBool silc_hash_utf8_compare(void *key1, void *key2, void *user_context) return !memcmp(key1, key2, l2); } -/* Compares two SILC Public keys. It may be used as SilcHashTable - comparison function. */ - -SilcBool silc_hash_public_key_compare(void *key1, void *key2, - void *user_context) -{ - return silc_pkcs_public_key_compare(key1, key2); -} - /* Creates fingerprint from data, usually used with SHA1 digests */ char *silc_fingerprint(const unsigned char *data, SilcUInt32 data_len) diff --git a/lib/silcutil/silcutil.h b/lib/silcutil/silcutil.h index 142297c0..f645569f 100644 --- a/lib/silcutil/silcutil.h +++ b/lib/silcutil/silcutil.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2006 Pekka Riikonen + Copyright (C) 1997 - 2007 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -242,19 +242,6 @@ SilcUInt32 silc_hash_client_id_hash(void *key, void *user_context); ***/ SilcUInt32 silc_hash_data(void *key, void *user_context); -/****f* silcutil/SilcUtilAPI/silc_hash_public_key - * - * SYNOPSIS - * - * SilcUInt32 silc_hash_public_key(void *key, void *user_context); - * - * DESCRIPTION - * - * Hash public key of any type. - * - ***/ -SilcUInt32 silc_hash_public_key(void *key, void *user_context); - /****f* silcutil/SilcUtilAPI/silc_hash_string_compare * * SYNOPSIS @@ -346,22 +333,6 @@ SilcBool silc_hash_data_compare(void *key1, void *key2, void *user_context); ***/ SilcBool silc_hash_utf8_compare(void *key1, void *key2, void *user_context); -/****f* silcutil/SilcUtilAPI/silc_hash_public_key_compare - * - * SYNOPSIS - * - * SilcBool silc_hash_public_key_compare(void *key1, void *key2, - * void *user_context); - * - * DESCRIPTION - * - * Compares two SILC Public keys. It may be used as SilcHashTable - * comparison function. - * - ***/ -SilcBool silc_hash_public_key_compare(void *key1, void *key2, - void *user_context); - /****f* silcutil/SilcUtilAPI/silc_fingerprint * * SYNOPSIS -- 2.24.0