Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
96c2bb38
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
96c2bb38
编写于
5月 26, 2019
作者:
Y
Yuriy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
using logging level from config.xml
上级
96e3574a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
17 deletion
+9
-17
dbms/programs/server/MySQLHandler.cpp
dbms/programs/server/MySQLHandler.cpp
+1
-2
dbms/programs/server/MySQLHandlerFactory.cpp
dbms/programs/server/MySQLHandlerFactory.cpp
+4
-7
dbms/programs/server/MySQLHandlerFactory.h
dbms/programs/server/MySQLHandlerFactory.h
+2
-1
dbms/src/Common/OpenSSLHelpers.h
dbms/src/Common/OpenSSLHelpers.h
+1
-3
dbms/src/Core/MySQLProtocol.h
dbms/src/Core/MySQLProtocol.h
+0
-2
dbms/src/Formats/MySQLWireBlockOutputStream.cpp
dbms/src/Formats/MySQLWireBlockOutputStream.cpp
+1
-2
未找到文件。
dbms/programs/server/MySQLHandler.cpp
浏览文件 @
96c2bb38
...
...
@@ -40,7 +40,6 @@ MySQLHandler::MySQLHandler(IServer & server_, const Poco::Net::StreamSocket & so
,
public_key
(
public_key
)
,
private_key
(
private_key
)
{
log
->
setLevel
(
"information"
);
server_capability_flags
=
CLIENT_PROTOCOL_41
|
CLIENT_SECURE_CONNECTION
|
CLIENT_PLUGIN_AUTH
|
CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA
|
CLIENT_CONNECT_WITH_DB
|
CLIENT_DEPRECATE_EOF
;
if
(
ssl_enabled
)
server_capability_flags
|=
CLIENT_SSL
;
...
...
@@ -101,7 +100,7 @@ void MySQLHandler::run()
OK_Packet
ok_packet
(
0
,
handshake_response
.
capability_flags
,
0
,
0
,
0
);
packet_sender
->
sendPacket
(
ok_packet
,
true
);
for
(;;
)
while
(
true
)
{
packet_sender
->
resetSequenceId
();
String
payload
=
packet_sender
->
receivePacketPayload
();
...
...
dbms/programs/server/MySQLHandlerFactory.cpp
浏览文件 @
96c2bb38
...
...
@@ -89,8 +89,7 @@ void MySQLHandlerFactory::readRSAKeys()
SCOPE_EXIT
(
fclose
(
fp
));
private_key
.
reset
(
PEM_read_RSAPrivateKey
(
fp
,
nullptr
,
nullptr
,
nullptr
));
if
(
private_key
.
get
()
==
nullptr
)
if
(
!
private_key
)
throw
Exception
(
"Failed to read RSA private key from "
+
privateKeyFile
+
". Error: "
+
getOpenSSLErrors
(),
ErrorCodes
::
OPENSSL_ERROR
);
}
}
...
...
@@ -98,8 +97,8 @@ void MySQLHandlerFactory::readRSAKeys()
void
MySQLHandlerFactory
::
generateRSAKeys
()
{
LOG_INFO
(
log
,
"Generating new RSA key."
);
RSAPtr
rsa
(
RSA_new
());
if
(
rsa
==
nullptr
)
public_key
.
reset
(
RSA_new
());
if
(
!
public_key
)
throw
Exception
(
"Failed to allocate RSA key. Error: "
+
getOpenSSLErrors
(),
ErrorCodes
::
OPENSSL_ERROR
);
BIGNUM
*
e
=
BN_new
();
...
...
@@ -107,12 +106,10 @@ void MySQLHandlerFactory::generateRSAKeys()
throw
Exception
(
"Failed to allocate BIGNUM. Error: "
+
getOpenSSLErrors
(),
ErrorCodes
::
OPENSSL_ERROR
);
SCOPE_EXIT
(
BN_free
(
e
));
if
(
!
BN_set_word
(
e
,
65537
)
||
!
RSA_generate_key_ex
(
rsa
.
get
(),
2048
,
e
,
nullptr
))
if
(
!
BN_set_word
(
e
,
65537
)
||
!
RSA_generate_key_ex
(
public_key
.
get
(),
2048
,
e
,
nullptr
))
throw
Exception
(
"Failed to generate RSA key. Error: "
+
getOpenSSLErrors
(),
ErrorCodes
::
OPENSSL_ERROR
);
public_key
=
std
::
move
(
rsa
);
private_key
.
reset
(
RSAPrivateKey_dup
(
public_key
.
get
()));
if
(
!
private_key
)
throw
Exception
(
"Failed to copy RSA key. Error: "
+
getOpenSSLErrors
(),
ErrorCodes
::
OPENSSL_ERROR
);
}
...
...
dbms/programs/server/MySQLHandlerFactory.h
浏览文件 @
96c2bb38
...
...
@@ -14,7 +14,8 @@ private:
IServer
&
server
;
Poco
::
Logger
*
log
;
struct
RSADeleter
{
struct
RSADeleter
{
void
operator
()(
RSA
*
ptr
)
{
RSA_free
(
ptr
);
}
};
using
RSAPtr
=
std
::
unique_ptr
<
RSA
,
RSADeleter
>
;
...
...
dbms/src/Common/OpenSSLHelpers.h
浏览文件 @
96c2bb38
...
...
@@ -6,9 +6,7 @@
namespace
DB
{
/**
* Returns string with concatenation of the error strings for all errors that OpenSSL has recorded, emptying the error queue.
*/
/// Returns concatenation of error strings for all errors that OpenSSL has recorded, emptying the error queue.
String
getOpenSSLErrors
();
}
dbms/src/Core/MySQLProtocol.h
浏览文件 @
96c2bb38
...
...
@@ -163,7 +163,6 @@ public:
,
out
(
&
out
)
,
log
(
&
Poco
::
Logger
::
get
(
logger_name
))
{
log
->
setLevel
(
"information"
);
}
/// For writing.
...
...
@@ -173,7 +172,6 @@ public:
,
out
(
&
out
)
,
log
(
&
Poco
::
Logger
::
get
(
logger_name
))
{
log
->
setLevel
(
"information"
);
}
String
receivePacketPayload
()
...
...
dbms/src/Formats/MySQLWireBlockOutputStream.cpp
浏览文件 @
96c2bb38
...
...
@@ -26,8 +26,7 @@ void MySQLWireBlockOutputStream::writePrefix()
for
(
const
ColumnWithTypeAndName
&
column
:
header
.
getColumnsWithTypeAndName
())
{
ColumnDefinition
column_definition
(
column
.
name
,
CharacterSet
::
binary
,
std
::
numeric_limits
<
uint32_t
>::
max
(),
ColumnType
::
MYSQL_TYPE_STRING
,
0
,
0
);
ColumnDefinition
column_definition
(
column
.
name
,
CharacterSet
::
binary
,
0
,
ColumnType
::
MYSQL_TYPE_STRING
,
0
,
0
);
packet_sender
->
sendPacket
(
column_definition
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录