From d2f9467163a34876bc235f11689828b1441ed626 Mon Sep 17 00:00:00 2001 From: Srar Date: Wed, 16 May 2018 01:18:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E7=A6=81=E7=94=A8OpenVPN?= =?UTF-8?q?=E9=A9=B1=E5=8A=A8=E8=87=AA=E5=8A=A8=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test/test.ts b/test/test.ts index e0f206b..1536d31 100644 --- a/test/test.ts +++ b/test/test.ts @@ -115,16 +115,18 @@ async function main() { /* 设置OpenVPN网卡 */ if(!TAPControl.checkAdapterIsInstalled()) { - console.log("Installing driver..."); - const result = TAPControl.installAdapter(path.join(process.cwd(), "driver/tapinstall.exe")); - if(result !== 0) { - console.error(`Driver was not successfully installed. Exit code: ${result}.`); - if(result === 2) { - console.log(`Please run as administrator.`); - } - process.exit(-1); - } - console.log("Install driver successfully."); + // console.log("Installing driver..."); + // const result = TAPControl.installAdapter(path.join(process.cwd(), "driver/tapinstall.exe")); + // if(result !== 0) { + // console.error(`Driver was not successfully installed. Exit code: ${result}.`); + // if(result === 2) { + // console.log(`Please run as administrator.`); + // } + // process.exit(-1); + // } + // console.log("Install driver successfully."); + console.error("Please install openvpn tap driver."); + process.exit(-1); } const tapControl: TAPControl = TAPControl.init(); const tapInfo = tapControl.getAdapterInfo(); From fc7ad0e4f8a7f5a2f6a8d55b35ef84f380b16598 Mon Sep 17 00:00:00 2001 From: Srar Date: Thu, 17 May 2018 02:03:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/shadowsocks/crypto/CryptoTools.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/shadowsocks/crypto/CryptoTools.ts b/test/shadowsocks/crypto/CryptoTools.ts index e0afdd4..7633117 100644 --- a/test/shadowsocks/crypto/CryptoTools.ts +++ b/test/shadowsocks/crypto/CryptoTools.ts @@ -4,7 +4,7 @@ import ICryptoKeyIV from "./ICryptoKeyIV"; export default class CryptoTools { public static generateKeyIVByPassword(passwordStr: string, keyLength: number, ivLength: number): ICryptoKeyIV { - var password: Buffer = new Buffer(passwordStr, "binary"); + var password: Buffer = new Buffer(passwordStr.toString(), "binary"); var hashBuffers: Array = []; for (var dataCount = 0, loopCount = 0; dataCount < keyLength + ivLength; loopCount++) { var data: any = password;