From 986898f69d2ad87d09cbb9ae889ca480fbe026b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Mon, 23 Apr 2018 23:47:17 +0200 Subject: [PATCH] Dont check for OpenSSL we require it on install --- gajim/common/app.py | 11 ----------- gajim/common/connection.py | 18 +++++++----------- gajim/common/connection_handlers_events.py | 4 ++-- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/gajim/common/app.py b/gajim/common/app.py index 70c5c4daa..1052cf9cf 100644 --- a/gajim/common/app.py +++ b/gajim/common/app.py @@ -200,17 +200,6 @@ else: if not test_gpg(binary='gpg'): HAVE_GPG = False -HAVE_PYOPENSSL = True -try: - import OpenSSL.SSL - import OpenSSL.crypto - ver = OpenSSL.__version__ - ver_l = [int(i) for i in ver.split('.')] - if ver_l < [0, 12]: - raise ImportError -except Exception: - HAVE_PYOPENSSL = False - HAVE_FARSTREAM = True try: if os.name == 'nt': diff --git a/gajim/common/connection.py b/gajim/common/connection.py index 571e00d30..ff2efd4d0 100644 --- a/gajim/common/connection.py +++ b/gajim/common/connection.py @@ -42,7 +42,9 @@ import locale import hmac import hashlib import json +import logging from functools import partial +from string import Template try: randomsource = random.SystemRandom() @@ -54,29 +56,23 @@ import signal if os.name != 'nt': signal.signal(signal.SIGPIPE, signal.SIG_DFL) +if os.name == 'nt': + import certifi +import OpenSSL.crypto import nbxmpp +from nbxmpp import Smacks + from gajim import common from gajim.common import helpers from gajim.common import app from gajim.common import gpg from gajim.common import passwords -from gajim.common import exceptions from gajim.common import check_X509 from gajim.common.connection_handlers import * -from gajim.common.helpers import version_condition from gajim.common.contacts import GC_Contact - from gajim.gtkgui_helpers import get_action -if app.HAVE_PYOPENSSL: - import OpenSSL.crypto -if os.name == 'nt': - import certifi - -from nbxmpp import Smacks -from string import Template -import logging log = logging.getLogger('gajim.c.connection') ssl_error = { diff --git a/gajim/common/connection_handlers_events.py b/gajim/common/connection_handlers_events.py index 875b063b9..a93f750ce 100644 --- a/gajim/common/connection_handlers_events.py +++ b/gajim/common/connection_handlers_events.py @@ -30,8 +30,10 @@ import sys import os from time import time as time_time +import OpenSSL.crypto import nbxmpp from nbxmpp.protocol import NS_CHATSTATES + from gajim.common import atom from gajim.common import nec from gajim.common import helpers @@ -45,8 +47,6 @@ from gajim.common.jingle_transport import JingleTransportSocks5 from gajim.common.file_props import FilesProp from gajim.common.nec import NetworkEvent -if app.HAVE_PYOPENSSL: - import OpenSSL.crypto log = logging.getLogger('gajim.c.connection_handlers_events')