Author: tjansen Date: Mon Nov 2 12:39:52 2009 New Revision: 1478 Log: Removed unused function pisa_build_digest. Modified: trunk/libpisa/util.c trunk/libpisa/util.h Modified: trunk/libpisa/util.c ============================================================================== --- trunk/libpisa/util.c Mon Nov 2 12:34:56 2009 (r1477) +++ trunk/libpisa/util.c Mon Nov 2 12:39:52 2009 (r1478) @@ -255,43 +255,6 @@ return err; } -/** - * Calculate a digest over given data - * - * @param type the type of digest, e.g. "sha1" - * @param in the beginning of the data to be digested - * @param in_len the length of data to be digested in octets - * @param out the digest - * @param out should be long enough to hold the digest. This cannot be - * checked! - * - * @return 0 on success, otherwise < 0. - */ -int pisa_build_digest(const int type, const void *in, int in_len, void *out){ - SHA_CTX sha; - MD5_CTX md5; - - switch(type) { - case PISA_DIGEST_SHA1: - SHA1_Init(&sha); - SHA1_Update(&sha, in, in_len); - SHA1_Final(out, &sha); - break; - - case PISA_DIGEST_MD5: - MD5_Init(&md5); - MD5_Update(&md5, in, in_len); - MD5_Final(out, &md5); - break; - - default: - PISA_ERROR("Unknown digest: %x\n",type); - return -EFAULT; - } - - return 0; -} - #ifndef __KERNEL__ static int pisa_convert_string_to_address_v4(const char *str, struct in_addr *ip){ int ret = 0, err = 0; Modified: trunk/libpisa/util.h ============================================================================== --- trunk/libpisa/util.h Mon Nov 2 12:34:56 2009 (r1477) +++ trunk/libpisa/util.h Mon Nov 2 12:39:52 2009 (r1478) @@ -104,10 +104,6 @@ int pisa_maxof(int num_args, ...); -#ifndef __KERNEL__ -int pisa_build_digest(const int type, const void *in, int in_len, void *out); -#endif - int pisa_make_hipd_run(void); int pisa_check_if_hipd_runs(void);