summaryrefslogtreecommitdiff
path: root/slixmpp
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-03-10 21:26:08 +0100
committermathieui <mathieui@mathieui.net>2021-03-10 21:26:08 +0100
commit1cf6393b61bc87e26c066bbd89364c1221976764 (patch)
tree4b50e680f4cae0f1fe52ab88b60f2e065b6e39e1 /slixmpp
parent7c86c43fc74dd4786ff741386484b58d1c396e8b (diff)
downloadslixmpp-1cf6393b61bc87e26c066bbd89364c1221976764.tar.gz
slixmpp-1cf6393b61bc87e26c066bbd89364c1221976764.tar.bz2
slixmpp-1cf6393b61bc87e26c066bbd89364c1221976764.tar.xz
slixmpp-1cf6393b61bc87e26c066bbd89364c1221976764.zip
XEP-0300: small fixes
- fix a typo in the default option (crash when hashing a file without providing a function) - Fix the plugin_end method (classical del_feature footgun)
Diffstat (limited to 'slixmpp')
-rw-r--r--slixmpp/plugins/xep_0300/hash.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/slixmpp/plugins/xep_0300/hash.py b/slixmpp/plugins/xep_0300/hash.py
index e3f97f1b..90491300 100644
--- a/slixmpp/plugins/xep_0300/hash.py
+++ b/slixmpp/plugins/xep_0300/hash.py
@@ -1,4 +1,3 @@
-
# Slixmpp: The Slick XMPP Library
# Copyright (C) 2017 Emmanuel Gil Peyrot
# This file is part of Slixmpp.
@@ -15,6 +14,9 @@ log = logging.getLogger(__name__)
class XEP_0300(BasePlugin):
+ """
+ XEP-0300: Use of Cryptographic Hash Functions in XMPP
+ """
name = 'xep_0300'
description = 'XEP-0300: Use of Cryptographic Hash Functions in XMPP'
@@ -22,7 +24,7 @@ class XEP_0300(BasePlugin):
stanza = stanza
default_config = {
'block_size': 1024 * 1024, # One MiB
- 'preferded': 'sha-256',
+ 'preferred': 'sha-256',
'enable_sha-1': False,
'enable_sha-256': True,
'enable_sha-512': True,
@@ -61,7 +63,7 @@ class XEP_0300(BasePlugin):
def plugin_end(self):
for namespace in self.enabled_hashes:
- self.xmpp['xep_0030'].del_feature(namespace)
+ self.xmpp['xep_0030'].del_feature(feature=namespace)
self.enabled_hashes.clear()
self.xmpp['xep_0030'].del_feature(feature=Hash.namespace)