mirror of https://github.com/tp4a/teleport
1. use jsoncpp c++11 interface in telnet module. 2. fix timeout when create ssh channel on libssh session.
parent
e91f057692
commit
958712745b
|
@ -231,15 +231,12 @@ class BuilderWin(BuilderBase):
|
|||
utils.unzip(os.path.join(PATH_DOWNLOAD, file_name), PATH_EXTERNAL)
|
||||
os.rename(os.path.join(PATH_EXTERNAL, 'libssh-{}'.format(env.ver_libssh)), self.LIBSSH_PATH_SRC)
|
||||
|
||||
# cc.n('fix libssh source code... ', end='')
|
||||
# utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', 'src', 'sftp.c'))
|
||||
# utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'sftp.c')
|
||||
cc.n('fix libssh source code... ', end='')
|
||||
s_name = 'libssh-{}'.format(env.ver_libssh)
|
||||
# utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'session.c'))
|
||||
utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'session.c'))
|
||||
# utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'libcrypto.c'))
|
||||
utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'libcrypto-compat.c'))
|
||||
# utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'session.c')
|
||||
utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'session.c')
|
||||
# utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'libcrypto.c')
|
||||
utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'libcrypto-compat.c')
|
||||
|
||||
|
@ -521,10 +518,10 @@ class BuilderLinux(BuilderBase):
|
|||
|
||||
cc.n('fix libssh source code... ', end='')
|
||||
s_name = 'libssh-{}'.format(env.ver_libssh)
|
||||
# utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'session.c'))
|
||||
utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'session.c'))
|
||||
# utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'libcrypto.c'))
|
||||
utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'libcrypto-compat.c'))
|
||||
# utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'session.c')
|
||||
utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'session.c')
|
||||
# utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'libcrypto.c')
|
||||
utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'libcrypto-compat.c')
|
||||
|
||||
|
@ -578,15 +575,6 @@ class BuilderLinux(BuilderBase):
|
|||
return
|
||||
cc.v('')
|
||||
|
||||
# cc.n('fix libssh source code... ', end='')
|
||||
# s_name = 'libssh-{}'.format(env.ver_libssh)
|
||||
# # utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'session.c'))
|
||||
# # utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'libcrypto.c'))
|
||||
# utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'libcrypto-compat.c'))
|
||||
# # utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'session.c')
|
||||
# # utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'libcrypto.c')
|
||||
# utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'libcrypto-compat.c')
|
||||
|
||||
build_path = os.path.join(self.ZLIB_PATH_SRC, 'build')
|
||||
|
||||
cmake_define = ' -DCMAKE_INSTALL_PREFIX={path_release}' \
|
||||
|
|
Binary file not shown.
|
@ -322,7 +322,7 @@ int HMAC_CTX_reset(HMAC_CTX *ctx)
|
|||
return 1;
|
||||
}
|
||||
|
||||
#if 0 // by Apex
|
||||
#if 0 // by apex.liu
|
||||
#ifndef HAVE_OPENSSL_EVP_CIPHER_CTX_NEW
|
||||
EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void)
|
||||
{
|
||||
|
@ -336,7 +336,7 @@ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx)
|
|||
OPENSSL_free(ctx);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // endif by apex.liu
|
||||
|
||||
void DH_get0_pqg(const DH *dh,
|
||||
const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
#include "telnet_proxy.h"
|
||||
#include "telnet_proxy.h"
|
||||
#include "tpp_env.h"
|
||||
|
||||
#include <teleport_const.h>
|
||||
|
@ -40,11 +40,17 @@ TPP_API void tpp_timer(void) {
|
|||
|
||||
|
||||
static ex_rv _set_runtime_config(const char* param) {
|
||||
Json::Value jp;
|
||||
Json::Reader jreader;
|
||||
// Json::Value jp;
|
||||
// Json::Reader jreader;
|
||||
//
|
||||
// if (!jreader.parse(param, jp))
|
||||
Json::CharReaderBuilder jcrb;
|
||||
std::unique_ptr<Json::CharReader> const jreader(jcrb.newCharReader());
|
||||
|
||||
if (!jreader.parse(param, jp))
|
||||
return TPE_JSON_FORMAT;
|
||||
ex_astr err;
|
||||
Json::Value jp;
|
||||
if (!jreader->parse(param, param + strlen(param), &jp, &err))
|
||||
return TPE_JSON_FORMAT;
|
||||
|
||||
if (!jp.isObject())
|
||||
return TPE_PARAM;
|
||||
|
@ -62,11 +68,17 @@ static ex_rv _set_runtime_config(const char* param) {
|
|||
}
|
||||
|
||||
static ex_rv _kill_sessions(const char* param) {
|
||||
Json::Value jp;
|
||||
Json::Reader jreader;
|
||||
// Json::Value jp;
|
||||
// Json::Reader jreader;
|
||||
//
|
||||
// if (!jreader.parse(param, jp))
|
||||
Json::CharReaderBuilder jcrb;
|
||||
std::unique_ptr<Json::CharReader> const jreader(jcrb.newCharReader());
|
||||
|
||||
if (!jreader.parse(param, jp))
|
||||
return TPE_JSON_FORMAT;
|
||||
ex_astr err;
|
||||
Json::Value jp;
|
||||
if (!jreader->parse(param, param + strlen(param), &jp, &err))
|
||||
return TPE_JSON_FORMAT;
|
||||
|
||||
if (!jp.isArray())
|
||||
return TPE_PARAM;
|
||||
|
|
Loading…
Reference in New Issue