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))