Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Jul 1, 2023
1 parent b33a1e9 commit a3032b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kitty/file_transmission.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>

import base64
import errno
import json
import os
import re
import stat
import tempfile
from base64 import b85decode
from collections import defaultdict, deque
from contextlib import suppress
from dataclasses import Field, dataclass, field, fields
Expand Down Expand Up @@ -495,8 +495,8 @@ def check_bypass(password: str, request_id: str, bypass_data: str) -> bool:
if not pubkey:
return False
ekey = get_boss().encryption_key
d = AES256GCMDecrypt(ekey.derive_secret(base64.b85decode(pubkey)), base64.b85decode(pcmd['iv']), base64.b85decode(pcmd['tag']))
data = d.add_data_to_be_decrypted(base64.b85decode(pcmd['encrypted']), True)
d = AES256GCMDecrypt(ekey.derive_secret(b85decode(pubkey)), b85decode(pcmd['iv']), b85decode(pcmd['tag']))
data = d.add_data_to_be_decrypted(b85decode(pcmd['encrypted']), True)
timestamp, sep, payload = data.decode('utf-8').partition(':')
delta = time_ns() - int(timestamp)
if abs(delta) > 5 * 60 * 1e9:
Expand Down

0 comments on commit a3032b6

Please sign in to comment.