|
6 | 6 | import datetime
|
7 | 7 | import asyncio
|
8 | 8 | import oe_common
|
9 |
| -import oe_aes_cipher |
| 9 | +import ov_aes_cipher |
10 | 10 | import ovcfg
|
11 | 11 | import json
|
12 | 12 |
|
|
16 | 16 | 'default_server_port': 888,
|
17 | 17 | 'local_ip': '0.0.0.0'
|
18 | 18 | }
|
19 |
| -cfg = ovcfg.Config(std_config=sc, file='client.json', cfg_dir_name='overengine').import_config() |
| 19 | +cfg = ovcfg.Config(std_config=sc, file='client.json', cfg_dir_name='ovtp').import_config() |
20 | 20 | # server_port = cfg['server_port']
|
21 | 21 | # server_ip = cfg['server_address']
|
22 | 22 | # local_ip = cfg['local_ip']
|
23 | 23 |
|
24 | 24 |
|
25 |
| -class OverEngineClient: |
| 25 | +class OvtpClient: |
26 | 26 | def __init__(self, server_ip, server_port=None, debug=False, verbose=False):
|
27 | 27 | self.uid = oe_common.get_rnd_string(10).lower()
|
28 | 28 | self.cr = ovcrypt.OvCrypt()
|
@@ -207,7 +207,7 @@ async def get_file(self, path_from, path_to=None):
|
207 | 207 | if not path_to:
|
208 | 208 | path_to = path_from
|
209 | 209 | await self.check_connection()
|
210 |
| - self.aes = oe_aes_cipher.AESCipher(key=oe_common.get_rnd_string(60)) |
| 210 | + self.aes = ov_aes_cipher.AESCipher(key=oe_common.get_rnd_string(60)) |
211 | 211 | self.writer.write(self._get_ov_header(
|
212 | 212 | 'get_file',
|
213 | 213 | filename=path_from,
|
@@ -265,7 +265,7 @@ async def send_file(self, path_from, path_to=None):
|
265 | 265 | path_to = path_from
|
266 | 266 | await self.check_connection()
|
267 | 267 | self._validate_input('file', path_from)
|
268 |
| - self.aes = oe_aes_cipher.AESCipher(key=oe_common.get_rnd_string(60)) |
| 268 | + self.aes = ov_aes_cipher.AESCipher(key=oe_common.get_rnd_string(60)) |
269 | 269 | with open(path_from, 'rb') as f:
|
270 | 270 | file_size = os.path.getsize(path_from)
|
271 | 271 | '''if file_size > 1024*1024*500: # 500 Mb
|
@@ -373,7 +373,7 @@ async def send_data(self, address, data=b'', data_type='message', timeout=2, ret
|
373 | 373 | # sa = []
|
374 | 374 | # self._validate_input(data_type, filename)
|
375 | 375 | rnd_key = oe_common.get_rnd_string(60)
|
376 |
| - self.aes = oe_aes_cipher.AESCipher(rnd_key) |
| 376 | + self.aes = ov_aes_cipher.AESCipher(rnd_key) |
377 | 377 | sign = None
|
378 | 378 | data_hash = None
|
379 | 379 | if data_type == 'public_key':
|
|
0 commit comments