summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/SmoozedCom.py
diff options
context:
space:
mode:
authorGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-10 17:57:40 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-10 17:57:40 +0200
commit71c997e75ee6b8d7ae638dd8612d7b805e4eb523 (patch)
treea84c90aaeade98794199e2049837f74a7fba3789 /module/plugins/accounts/SmoozedCom.py
parentSpare code cosmetics (diff)
downloadpyload-71c997e75ee6b8d7ae638dd8612d7b805e4eb523.tar.xz
Fix OboomCom and SmoozedCom with beaker >= v1.7.x
Diffstat (limited to 'module/plugins/accounts/SmoozedCom.py')
-rw-r--r--module/plugins/accounts/SmoozedCom.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py
index 87efb89b3..3c8226704 100644
--- a/module/plugins/accounts/SmoozedCom.py
+++ b/module/plugins/accounts/SmoozedCom.py
@@ -3,7 +3,20 @@
import hashlib
import time
-from beaker.crypto.pbkdf2 import PBKDF2
+try:
+ from beaker.crypto.pbkdf2 import PBKDF2
+
+except ImportError:
+ from beaker.crypto.pbkdf2 import pbkdf2
+ from binascii import b2a_hex
+ class PBKDF2(object):
+ def __init__(self, passphrase, salt, iterations=1000):
+ self.passphrase = passphrase
+ self.salt = salt
+ self.iterations = iterations
+
+ def hexread(self, octets):
+ return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets))
from module.common.json_layer import json_loads
from module.plugins.Account import Account
@@ -12,7 +25,7 @@ from module.plugins.Account import Account
class SmoozedCom(Account):
__name__ = "SmoozedCom"
__type__ = "account"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """Smoozed.com account plugin"""
__license__ = "GPLv3"