Module: sip-router Branch: master Commit: 1edbdbd53d2f5df0b47c8e9e892f35852362a5bd URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1edbdbd5...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Thu Aug 14 11:12:43 2014 +0200
lib/kcore: moved wrappers around sha256 to srutils
- the sha256 functions are in srutils and these created not necessary inter-library dependency, confusing some linkers
---
lib/kcore/Makefile | 2 +- lib/kcore/strcommon.c | 38 -------------------------------------- lib/kcore/strcommon.h | 10 ---------- 3 files changed, 1 insertions(+), 49 deletions(-)
diff --git a/lib/kcore/Makefile b/lib/kcore/Makefile index b3f43e0..2ac230d 100644 --- a/lib/kcore/Makefile +++ b/lib/kcore/Makefile @@ -7,6 +7,6 @@ BUGFIX_VER=0 LIBS=
SERLIBPATH=.. -SER_LIBS=$(SERLIBPATH)/srutils/srutils +SER_LIBS=
include ../../Makefile.libs diff --git a/lib/kcore/strcommon.c b/lib/kcore/strcommon.c index e831e1f..ce27ab3 100644 --- a/lib/kcore/strcommon.c +++ b/lib/kcore/strcommon.c @@ -110,44 +110,6 @@ int unescape_common(char *dst, char *src, int src_len) return j; }
-/*! \brief Compute MD5 checksum */ -void compute_md5(char *dst, char *src, int src_len) -{ - MD5_CTX context; - unsigned char digest[16]; - MD5Init (&context); - MD5Update (&context, src, src_len); - U_MD5Final (digest, &context); - string2hex(digest, 16, dst); -} - -/*! \brief Compute SHA256 checksum */ -void compute_sha256(char *dst, u_int8_t *src, int src_len) -{ - SHA256_CTX ctx256; - SHA256_Init(&ctx256); - SHA256_Update(&ctx256, src, src_len); - SHA256_End(&ctx256, dst); -} - -/*! \brief Compute SHA384 checksum */ -void compute_sha384(char *dst, u_int8_t *src, int src_len) -{ - SHA384_CTX ctx384; - SHA384_Init(&ctx384); - SHA384_Update(&ctx384, src, src_len); - SHA384_End(&ctx384, dst); -} - -/*! \brief Compute SHA512 checksum */ -void compute_sha512(char *dst, u_int8_t *src, int src_len) -{ - SHA512_CTX ctx512; - SHA512_Init(&ctx512); - SHA512_Update(&ctx512, src, src_len); - SHA512_End(&ctx512, dst); -} - /*! \brief Unscape all printable ASCII characters */ int unescape_user(str *sin, str *sout) { diff --git a/lib/kcore/strcommon.h b/lib/kcore/strcommon.h index 80d636d..c3d0c70 100644 --- a/lib/kcore/strcommon.h +++ b/lib/kcore/strcommon.h @@ -29,8 +29,6 @@ #define _STRCOMMON_H_
#include "../../str.h" -#include "../../md5.h" -#include "../srutils/sha256.h"
/* * add backslashes to special characters @@ -41,14 +39,6 @@ int escape_common(char *dst, char *src, int src_len); */ int unescape_common(char *dst, char *src, int src_len);
-void compute_md5(char *dst, char *src, int src_len); - -void compute_sha256(char *dst, u_int8_t *src, int src_len); - -void compute_sha384(char *dst, u_int8_t *src, int src_len); - -void compute_sha512(char *dst, u_int8_t *src, int src_len); - int escape_user(str *sin, str *sout);
int unescape_user(str *sin, str *sout);