提交 cd7f69a7 编写于 作者: W wade zhang

TS-1368: Rename MD5 related names which conflict with names in system library

上级 82ef486d
...@@ -1556,13 +1556,13 @@ static int rpcAuthenticateMsg(void *pMsg, int msgLen, void *pAuth, void *pKey) { ...@@ -1556,13 +1556,13 @@ static int rpcAuthenticateMsg(void *pMsg, int msgLen, void *pAuth, void *pKey) {
} }
static void rpcBuildAuthHead(void *pMsg, int msgLen, void *pAuth, void *pKey) { static void rpcBuildAuthHead(void *pMsg, int msgLen, void *pAuth, void *pKey) {
MD5_CTX context; TAOS_MD5_CTX context;
MD5Init(&context); taos_MD5Init(&context);
MD5Update(&context, (uint8_t *)pKey, TSDB_KEY_LEN); taos_MD5Update(&context, (uint8_t *)pKey, TSDB_KEY_LEN);
MD5Update(&context, (uint8_t *)pMsg, msgLen); taos_MD5Update(&context, (uint8_t *)pMsg, msgLen);
MD5Update(&context, (uint8_t *)pKey, TSDB_KEY_LEN); taos_MD5Update(&context, (uint8_t *)pKey, TSDB_KEY_LEN);
MD5Final(&context); taos_MD5Final(&context);
memcpy(pAuth, context.digest, sizeof(context.digest)); memcpy(pAuth, context.digest, sizeof(context.digest));
} }
......
...@@ -31,11 +31,11 @@ typedef struct { ...@@ -31,11 +31,11 @@ typedef struct {
uint32_t i[2]; /* number of _bits_ handled mod 2^64 */ uint32_t i[2]; /* number of _bits_ handled mod 2^64 */
uint32_t buf[4]; /* scratch buffer */ uint32_t buf[4]; /* scratch buffer */
uint8_t in[64]; /* input buffer */ uint8_t in[64]; /* input buffer */
uint8_t digest[16]; /* actual digest after MD5Final call */ uint8_t digest[16]; /* actual digest after taos_MD5Final call */
} TAOS_MD5_CTX; } TAOS_MD5_CTX;
void taos_MD5Init(MD5_CTX *mdContext); void taos_MD5Init(TAOS_MD5_CTX *mdContext);
void taos_MD5Update(MD5_CTX *mdContext, uint8_t *inBuf, unsigned int inLen); void taos_MD5Update(TAOS_MD5_CTX *mdContext, uint8_t *inBuf, unsigned int inLen);
void taos_MD5Final(MD5_CTX *mdContext); void taos_MD5Final(TAOS_MD5_CTX *mdContext);
#endif #endif
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
*********************************************************************** ***********************************************************************
** Message-digest routines: ** ** Message-digest routines: **
** To form the message digest for a message M ** ** To form the message digest for a message M **
** (1) Initialize a context buffer mdContext using MD5Init ** ** (1) Initialize a context buffer mdContext using taos_MD5Init **
** (2) Call MD5Update on mdContext and M ** ** (2) Call taos_MD5Update on mdContext and M **
** (3) Call MD5Final on mdContext ** ** (3) Call taos_MD5Final on mdContext **
** The message digest is now in mdContext->digest[0...15] ** ** The message digest is now in mdContext->digest[0...15] **
*********************************************************************** ***********************************************************************
*/ */
...@@ -82,7 +82,7 @@ static uint8_t PADDING[64] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x ...@@ -82,7 +82,7 @@ static uint8_t PADDING[64] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x
(a) += (b); \ (a) += (b); \
} }
/* The routine MD5Init initializes the message-digest context /* The routine taos_MD5Init initializes the message-digest context
mdContext. All fields are set to zero. mdContext. All fields are set to zero.
*/ */
void taos_MD5Init(TAOS_MD5_CTX *mdContext) { void taos_MD5Init(TAOS_MD5_CTX *mdContext) {
...@@ -95,7 +95,7 @@ void taos_MD5Init(TAOS_MD5_CTX *mdContext) { ...@@ -95,7 +95,7 @@ void taos_MD5Init(TAOS_MD5_CTX *mdContext) {
mdContext->buf[3] = (uint32_t)0x10325476; mdContext->buf[3] = (uint32_t)0x10325476;
} }
/* The routine MD5Update updates the message-digest context to /* The routine taos_MD5Update updates the message-digest context to
account for the presence of each of the characters inBuf[0..inLen-1] account for the presence of each of the characters inBuf[0..inLen-1]
in the message whose digest is being computed. in the message whose digest is being computed.
*/ */
...@@ -127,7 +127,7 @@ void taos_MD5Update(TAOS_MD5_CTX *mdContext, uint8_t *inBuf, unsigned int inLen) ...@@ -127,7 +127,7 @@ void taos_MD5Update(TAOS_MD5_CTX *mdContext, uint8_t *inBuf, unsigned int inLen)
} }
} }
/* The routine MD5Final terminates the message-digest computation and /* The routine taos_MD5Final terminates the message-digest computation and
ends with the desired message digest in mdContext->digest[0...15]. ends with the desired message digest in mdContext->digest[0...15].
*/ */
void taos_MD5Final(TAOS_MD5_CTX *mdContext) { void taos_MD5Final(TAOS_MD5_CTX *mdContext) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册