From 8c004b3241bbac7c7132177508166939742a4be8 Mon Sep 17 00:00:00 2001 From: Micheal X Date: Tue, 26 Sep 2023 00:21:03 +1300 Subject: [PATCH] 5.7.6 fix seley bug. --- code/default/x_tunnel/local/seley_front/rc4_wrap.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/default/x_tunnel/local/seley_front/rc4_wrap.py b/code/default/x_tunnel/local/seley_front/rc4_wrap.py index 13ca3e72e7..e89d6d05a0 100644 --- a/code/default/x_tunnel/local/seley_front/rc4_wrap.py +++ b/code/default/x_tunnel/local/seley_front/rc4_wrap.py @@ -3,7 +3,11 @@ import struct import json -from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes +try: + from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes +except: + algorithms = None + import utils @@ -21,6 +25,9 @@ def __init__(self, sock, ip_str=None, sni=None, on_close=None): self.running = True self.h2 = False + if not algorithms: + raise socket.error('no cryptography') + algorithm = algorithms.AES(self.sni) iv = b'\x00' * 16 self.cipher = Cipher(algorithm, mode=modes.CFB(iv))