diff --git a/otpkpolicy.py b/otpkpolicy.py deleted file mode 100644 index 4c232a5..0000000 --- a/otpkpolicy.py +++ /dev/null @@ -1,15 +0,0 @@ -""" - Slixmpp: The Slick XMPP Library - - Shamelessly inspired from Syndace's python-omemo examples. -""" - -import omemo - - -class KeepingOTPKPolicy(omemo.OTPKPolicy): - @staticmethod - def decideOTPK(preKeyMessages): - # Always keep the OTPK. - # This is the unsafest behaviour possible and should be avoided at all costs. - return True diff --git a/plugin.py b/plugin.py index 48da101..0bd0597 100644 --- a/plugin.py +++ b/plugin.py @@ -28,12 +28,11 @@ log = logging.getLogger(__name__) HAS_OMEMO = True try: import omemo.exceptions - from omemo import SessionManager, ExtendedPublicBundle + from omemo import SessionManager, ExtendedPublicBundle, DefaultOTPKPolicy from omemo.util import generateDeviceID from omemo.backends import Backend from omemo_backend_signal import BACKEND as SignalBackend from omemo.implementation import JSONFileStorage - from slixmpp.plugins.xep_0384.otpkpolicy import KeepingOTPKPolicy except (ImportError,): HAS_OMEMO = False @@ -132,7 +131,7 @@ class XEP_0384(BasePlugin): default_config = { 'data_dir': None, 'storage_backend': JSONFileStorage, - 'otpk_policy': KeepingOTPKPolicy, + 'otpk_policy': DefaultOTPKPolicy, 'omemo_backend': SignalBackend, }