Commit 33d605f5 authored by Maxime Buquet's avatar Maxime Buquet

xep_0384: Use DefaultOTPKPolicy from the lib. Remove stuff implementation

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent 7ccd6c89
"""
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
......@@ -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,
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment