fix message window a path errors
This commit is contained in:
@ -8,15 +8,26 @@ from subprocess import check_call
|
||||
from common_tools import LxTools
|
||||
from wp_app_config import AppConfig
|
||||
|
||||
#uname: Path = Path("/tmp/.log_user")
|
||||
|
||||
#log_name = AppConfig.USER_FILE.read_text(encoding="utf-8")
|
||||
|
||||
keyfile: Path = Path(f"/home/{AppConfig.USER_FILE.read_text(encoding="utf-8")}/.config/wire_py/pbwgk.pem")
|
||||
keyfile: Path = Path(
|
||||
f"/home/{AppConfig.USER_FILE.read_text(encoding="utf-8")}/.config/wire_py/pbwgk.pem"
|
||||
)
|
||||
|
||||
if not keyfile.is_file():
|
||||
|
||||
check_call(["openssl", "rsa", "-in", AppConfig.SYSTEM_PATHS["pkey_path"], "-out", keyfile, "-outform", "PEM", "-pubout"])
|
||||
check_call(
|
||||
[
|
||||
"openssl",
|
||||
"rsa",
|
||||
"-in",
|
||||
AppConfig.SYSTEM_PATHS["pkey_path"],
|
||||
"-out",
|
||||
keyfile,
|
||||
"-outform",
|
||||
"PEM",
|
||||
"-pubout",
|
||||
]
|
||||
)
|
||||
shutil.chown(keyfile, 1000, 1000)
|
||||
|
||||
if AppConfig.TEMP_DIR.exists():
|
||||
@ -28,8 +39,20 @@ if not keyfile.is_file():
|
||||
for tunnels in tl:
|
||||
sourcetl: str = f"{AppConfig.TEMP_DIR}/{tunnels}"
|
||||
tlname: str = f"{CRYPTFILES}{tunnels[:-5]}.dat"
|
||||
check_call(["openssl", "pkeyutl", "-encrypt", "-inkey", keyfile, "-pubin", "-in", sourcetl, "-out",
|
||||
tlname,])
|
||||
check_call(
|
||||
[
|
||||
"openssl",
|
||||
"pkeyutl",
|
||||
"-encrypt",
|
||||
"-inkey",
|
||||
keyfile,
|
||||
"-pubin",
|
||||
"-in",
|
||||
sourcetl,
|
||||
"-out",
|
||||
tlname,
|
||||
]
|
||||
)
|
||||
|
||||
else:
|
||||
|
||||
@ -42,5 +65,17 @@ else:
|
||||
for tunnels in tl:
|
||||
sourcetl: str = f"{AppConfig.TEMP_DIR}/{tunnels}"
|
||||
tlname: str = f"{CRYPTFILES}{tunnels[:-5]}.dat"
|
||||
check_call(["openssl", "pkeyutl", "-encrypt", "-inkey", keyfile, "-pubin", "-in", sourcetl, "-out",
|
||||
tlname])
|
||||
check_call(
|
||||
[
|
||||
"openssl",
|
||||
"pkeyutl",
|
||||
"-encrypt",
|
||||
"-inkey",
|
||||
keyfile,
|
||||
"-pubin",
|
||||
"-in",
|
||||
sourcetl,
|
||||
"-out",
|
||||
tlname,
|
||||
]
|
||||
)
|
||||
|
Reference in New Issue
Block a user