Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
82ef486d
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
82ef486d
编写于
3月 28, 2022
作者:
W
wade zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TS-1368: Rename MD5 related names which conflict with names in system library
上级
c682aa85
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
31 addition
and
31 deletion
+31
-31
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+4
-4
src/plugins/http/src/httpUtil.c
src/plugins/http/src/httpUtil.c
+4
-4
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+6
-6
src/util/inc/tmd5.h
src/util/inc/tmd5.h
+4
-4
src/util/inc/tutil.h
src/util/inc/tutil.h
+4
-4
src/util/src/tmd5.c
src/util/src/tmd5.c
+5
-5
src/util/src/tutil.c
src/util/src/tutil.c
+4
-4
未找到文件。
src/client/src/tscParseLineProtocol.c
浏览文件 @
82ef486d
...
@@ -177,10 +177,10 @@ static int32_t getSmlMd5ChildTableName(TAOS_SML_DATA_POINT* point, char* tableNa
...
@@ -177,10 +177,10 @@ static int32_t getSmlMd5ChildTableName(TAOS_SML_DATA_POINT* point, char* tableNa
}
}
size_t
len
=
0
;
size_t
len
=
0
;
char
*
keyJoined
=
taosStringBuilderGetResult
(
&
sb
,
&
len
);
char
*
keyJoined
=
taosStringBuilderGetResult
(
&
sb
,
&
len
);
MD5_CTX
context
;
TAOS_
MD5_CTX
context
;
MD5Init
(
&
context
);
taos_
MD5Init
(
&
context
);
MD5Update
(
&
context
,
(
uint8_t
*
)
keyJoined
,
(
uint32_t
)
len
);
taos_
MD5Update
(
&
context
,
(
uint8_t
*
)
keyJoined
,
(
uint32_t
)
len
);
MD5Final
(
&
context
);
taos_
MD5Final
(
&
context
);
uint64_t
digest1
=
*
(
uint64_t
*
)(
context
.
digest
);
uint64_t
digest1
=
*
(
uint64_t
*
)(
context
.
digest
);
uint64_t
digest2
=
*
(
uint64_t
*
)(
context
.
digest
+
8
);
uint64_t
digest2
=
*
(
uint64_t
*
)(
context
.
digest
+
8
);
*
tableNameLen
=
snprintf
(
tableName
,
*
tableNameLen
,
*
tableNameLen
=
snprintf
(
tableName
,
*
tableNameLen
,
...
...
src/plugins/http/src/httpUtil.c
浏览文件 @
82ef486d
...
@@ -350,10 +350,10 @@ int32_t httpShrinkTableName(HttpContext *pContext, int32_t pos, char *name) {
...
@@ -350,10 +350,10 @@ int32_t httpShrinkTableName(HttpContext *pContext, int32_t pos, char *name) {
return
pos
;
return
pos
;
}
}
MD5_CTX
context
;
TAOS_
MD5_CTX
context
;
MD5Init
(
&
context
);
taos_
MD5Init
(
&
context
);
MD5Update
(
&
context
,
(
uint8_t
*
)
name
,
(
uint32_t
)
len
);
taos_
MD5Update
(
&
context
,
(
uint8_t
*
)
name
,
(
uint32_t
)
len
);
MD5Final
(
&
context
);
taos_
MD5Final
(
&
context
);
int32_t
table_name
=
httpAddToSqlCmdBuffer
(
int32_t
table_name
=
httpAddToSqlCmdBuffer
(
pContext
,
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
,
context
.
digest
[
0
],
pContext
,
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
,
context
.
digest
[
0
],
...
...
src/rpc/src/rpcMain.c
浏览文件 @
82ef486d
...
@@ -1541,14 +1541,14 @@ static SRpcHead *rpcDecompressRpcMsg(SRpcHead *pHead) {
...
@@ -1541,14 +1541,14 @@ static SRpcHead *rpcDecompressRpcMsg(SRpcHead *pHead) {
}
}
static
int
rpcAuthenticateMsg
(
void
*
pMsg
,
int
msgLen
,
void
*
pAuth
,
void
*
pKey
)
{
static
int
rpcAuthenticateMsg
(
void
*
pMsg
,
int
msgLen
,
void
*
pAuth
,
void
*
pKey
)
{
MD5_CTX
context
;
TAOS_
MD5_CTX
context
;
int
ret
=
-
1
;
int
ret
=
-
1
;
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
);
if
(
memcmp
(
context
.
digest
,
pAuth
,
sizeof
(
context
.
digest
))
==
0
)
ret
=
0
;
if
(
memcmp
(
context
.
digest
,
pAuth
,
sizeof
(
context
.
digest
))
==
0
)
ret
=
0
;
...
...
src/util/inc/tmd5.h
浏览文件 @
82ef486d
...
@@ -32,10 +32,10 @@ typedef struct {
...
@@ -32,10 +32,10 @@ typedef struct {
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 MD5Final call */
}
MD5_CTX
;
}
TAOS_
MD5_CTX
;
void
MD5Init
(
MD5_CTX
*
mdContext
);
void
taos_
MD5Init
(
MD5_CTX
*
mdContext
);
void
MD5Update
(
MD5_CTX
*
mdContext
,
uint8_t
*
inBuf
,
unsigned
int
inLen
);
void
taos_
MD5Update
(
MD5_CTX
*
mdContext
,
uint8_t
*
inBuf
,
unsigned
int
inLen
);
void
MD5Final
(
MD5_CTX
*
mdContext
);
void
taos_
MD5Final
(
MD5_CTX
*
mdContext
);
#endif
#endif
src/util/inc/tutil.h
浏览文件 @
82ef486d
...
@@ -47,10 +47,10 @@ void jsonKeyMd5(void *pMsg, int msgLen, void *pKey);
...
@@ -47,10 +47,10 @@ void jsonKeyMd5(void *pMsg, int msgLen, void *pKey);
bool
isValidateTag
(
char
*
input
);
bool
isValidateTag
(
char
*
input
);
static
FORCE_INLINE
void
taosEncryptPass
(
uint8_t
*
inBuf
,
size_t
inLen
,
char
*
target
)
{
static
FORCE_INLINE
void
taosEncryptPass
(
uint8_t
*
inBuf
,
size_t
inLen
,
char
*
target
)
{
MD5_CTX
context
;
TAOS_
MD5_CTX
context
;
MD5Init
(
&
context
);
taos_
MD5Init
(
&
context
);
MD5Update
(
&
context
,
inBuf
,
(
unsigned
int
)
inLen
);
taos_
MD5Update
(
&
context
,
inBuf
,
(
unsigned
int
)
inLen
);
MD5Final
(
&
context
);
taos_
MD5Final
(
&
context
);
memcpy
(
target
,
context
.
digest
,
TSDB_KEY_LEN
);
memcpy
(
target
,
context
.
digest
,
TSDB_KEY_LEN
);
}
}
...
...
src/util/src/tmd5.c
浏览文件 @
82ef486d
...
@@ -85,8 +85,8 @@ static uint8_t PADDING[64] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x
...
@@ -85,8 +85,8 @@ static uint8_t PADDING[64] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x
/* The routine MD5Init initializes the message-digest context
/* The routine MD5Init initializes the message-digest context
mdContext. All fields are set to zero.
mdContext. All fields are set to zero.
*/
*/
void
MD5Init
(
MD5_CTX
*
mdContext
)
{
void
taos_MD5Init
(
TAOS_
MD5_CTX
*
mdContext
)
{
memset
(
mdContext
,
0
,
sizeof
(
MD5_CTX
));
memset
(
mdContext
,
0
,
sizeof
(
TAOS_
MD5_CTX
));
/* Load magic initialization constants. */
/* Load magic initialization constants. */
mdContext
->
buf
[
0
]
=
(
uint32_t
)
0x67452301
;
mdContext
->
buf
[
0
]
=
(
uint32_t
)
0x67452301
;
...
@@ -99,7 +99,7 @@ void MD5Init(MD5_CTX *mdContext) {
...
@@ -99,7 +99,7 @@ void MD5Init(MD5_CTX *mdContext) {
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.
*/
*/
void
MD5Update
(
MD5_CTX
*
mdContext
,
uint8_t
*
inBuf
,
unsigned
int
inLen
)
{
void
taos_MD5Update
(
TAOS_
MD5_CTX
*
mdContext
,
uint8_t
*
inBuf
,
unsigned
int
inLen
)
{
uint32_t
in
[
16
];
uint32_t
in
[
16
];
int
mdi
;
int
mdi
;
unsigned
int
i
,
ii
;
unsigned
int
i
,
ii
;
...
@@ -130,7 +130,7 @@ void MD5Update(MD5_CTX *mdContext, uint8_t *inBuf, unsigned int inLen) {
...
@@ -130,7 +130,7 @@ void MD5Update(MD5_CTX *mdContext, uint8_t *inBuf, unsigned int inLen) {
/* The routine MD5Final terminates the message-digest computation and
/* The routine 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
MD5Final
(
MD5_CTX
*
mdContext
)
{
void
taos_MD5Final
(
TAOS_
MD5_CTX
*
mdContext
)
{
uint32_t
in
[
16
];
uint32_t
in
[
16
];
int
mdi
;
int
mdi
;
unsigned
int
i
,
ii
;
unsigned
int
i
,
ii
;
...
@@ -145,7 +145,7 @@ void MD5Final(MD5_CTX *mdContext) {
...
@@ -145,7 +145,7 @@ void MD5Final(MD5_CTX *mdContext) {
/* pad out to 56 mod 64 */
/* pad out to 56 mod 64 */
padLen
=
(
mdi
<
56
)
?
(
56
-
mdi
)
:
(
120
-
mdi
);
padLen
=
(
mdi
<
56
)
?
(
56
-
mdi
)
:
(
120
-
mdi
);
MD5Update
(
mdContext
,
PADDING
,
padLen
);
taos_
MD5Update
(
mdContext
,
PADDING
,
padLen
);
/* append length in bits and transform */
/* append length in bits and transform */
for
(
i
=
0
,
ii
=
0
;
i
<
14
;
i
++
,
ii
+=
4
)
for
(
i
=
0
,
ii
=
0
;
i
<
14
;
i
++
,
ii
+=
4
)
...
...
src/util/src/tutil.c
浏览文件 @
82ef486d
...
@@ -455,11 +455,11 @@ char *taosIpStr(uint32_t ipInt) {
...
@@ -455,11 +455,11 @@ char *taosIpStr(uint32_t ipInt) {
}
}
void
jsonKeyMd5
(
void
*
pMsg
,
int
msgLen
,
void
*
pKey
)
{
void
jsonKeyMd5
(
void
*
pMsg
,
int
msgLen
,
void
*
pKey
)
{
MD5_CTX
context
;
TAOS_
MD5_CTX
context
;
MD5Init
(
&
context
);
taos_
MD5Init
(
&
context
);
MD5Update
(
&
context
,
(
uint8_t
*
)
pMsg
,
msgLen
);
taos_
MD5Update
(
&
context
,
(
uint8_t
*
)
pMsg
,
msgLen
);
MD5Final
(
&
context
);
taos_
MD5Final
(
&
context
);
memcpy
(
pKey
,
context
.
digest
,
sizeof
(
context
.
digest
));
memcpy
(
pKey
,
context
.
digest
,
sizeof
(
context
.
digest
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录