Browse code

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

Daniel-Constantin Mierla authored on 14/08/2014 09:12:43
Showing 3 changed files
... ...
@@ -7,6 +7,6 @@ BUGFIX_VER=0
7 7
 LIBS=
8 8
 
9 9
 SERLIBPATH=..
10
-SER_LIBS=$(SERLIBPATH)/srutils/srutils
10
+SER_LIBS=
11 11
 
12 12
 include ../../Makefile.libs
... ...
@@ -110,44 +110,6 @@ int unescape_common(char *dst, char *src, int src_len)
110 110
 	return j;
111 111
 }
112 112
 
113
-/*! \brief Compute MD5 checksum */
114
-void compute_md5(char *dst, char *src, int src_len)
115
-{
116
-	MD5_CTX context;
117
-	unsigned char digest[16];
118
-	MD5Init (&context);
119
-  	MD5Update (&context, src, src_len);
120
-	U_MD5Final (digest, &context);
121
-	string2hex(digest, 16, dst);
122
-}
123
-
124
-/*! \brief Compute SHA256 checksum */
125
-void compute_sha256(char *dst, u_int8_t *src, int src_len)
126
-{
127
-	SHA256_CTX ctx256;
128
-	SHA256_Init(&ctx256);
129
-	SHA256_Update(&ctx256, src, src_len);
130
-	SHA256_End(&ctx256, dst);
131
-}
132
-
133
-/*! \brief Compute SHA384 checksum */
134
-void compute_sha384(char *dst, u_int8_t *src, int src_len)
135
-{
136
-	SHA384_CTX ctx384;
137
-	SHA384_Init(&ctx384);
138
-	SHA384_Update(&ctx384, src, src_len);
139
-	SHA384_End(&ctx384, dst);
140
-}
141
-
142
-/*! \brief Compute SHA512 checksum */
143
-void compute_sha512(char *dst, u_int8_t *src, int src_len)
144
-{
145
-	SHA512_CTX ctx512;
146
-	SHA512_Init(&ctx512);
147
-	SHA512_Update(&ctx512, src, src_len);
148
-	SHA512_End(&ctx512, dst);
149
-}
150
-
151 113
 /*! \brief Unscape all printable ASCII characters */
152 114
 int unescape_user(str *sin, str *sout)
153 115
 {
... ...
@@ -29,8 +29,6 @@
29 29
 #define _STRCOMMON_H_
30 30
 
31 31
 #include "../../str.h"
32
-#include "../../md5.h"
33
-#include "../srutils/sha256.h"
34 32
 
35 33
 /*
36 34
  * add backslashes to special characters
... ...
@@ -41,14 +39,6 @@ int escape_common(char *dst, char *src, int src_len);
41 39
  */
42 40
 int unescape_common(char *dst, char *src, int src_len);
43 41
 
44
-void compute_md5(char *dst, char *src, int src_len);
45
-
46
-void compute_sha256(char *dst, u_int8_t *src, int src_len);
47
-
48
-void compute_sha384(char *dst, u_int8_t *src, int src_len);
49
-
50
-void compute_sha512(char *dst, u_int8_t *src, int src_len);
51
-
52 42
 int escape_user(str *sin, str *sout);
53 43
 
54 44
 int unescape_user(str *sin, str *sout);