diff --git a/kittens/transfer/main.py b/kittens/transfer/main.py index bdd62692f..9f7792420 100644 --- a/kittens/transfer/main.py +++ b/kittens/transfer/main.py @@ -53,7 +53,7 @@ def parse_transfer_args(args: List[str]) -> Tuple[TransferCLIOptions, List[str]] ) -def read_password(loc: str) -> str: +def read_bypass(loc: str) -> str: if not loc: return '' if loc.isdigit() and int(loc) >= 0 and int(loc) < 256: @@ -72,7 +72,7 @@ def read_password(loc: str) -> str: def main(args: List[str]) -> None: cli_opts, items = parse_transfer_args(args) if cli_opts.permissions_bypass: - cli_opts.permissions_bypass = read_password(cli_opts.permissions_bypass).strip() + cli_opts.permissions_bypass = read_bypass(cli_opts.permissions_bypass).strip() if not items: raise SystemExit('Usage: kitty +kitten transfer file_or_directory ...') diff --git a/kitty/file_transmission.py b/kitty/file_transmission.py index 973bf3d2a..438027711 100644 --- a/kitty/file_transmission.py +++ b/kitty/file_transmission.py @@ -26,9 +26,9 @@ EXPIRE_TIME = 10 # minutes MAX_ACTIVE_RECEIVES = 10 -def encode_bypass(request_id: str, pw: str) -> str: +def encode_bypass(request_id: str, bypass: str) -> str: import hashlib - q = request_id + ';' + pw + q = request_id + ';' + bypass return 'sha256:' + hashlib.sha256(q.encode('utf-8', 'replace')).hexdigest()