summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/OboomCom.py17
-rw-r--r--module/plugins/accounts/SmoozedCom.py17
2 files changed, 30 insertions, 4 deletions
diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py
index 0acacbb2a..a9068f1df 100644
--- a/module/plugins/accounts/OboomCom.py
+++ b/module/plugins/accounts/OboomCom.py
@@ -2,7 +2,20 @@
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
@@ -11,7 +24,7 @@ from module.plugins.Account import Account
class OboomCom(Account):
__name__ = "OboomCom"
__type__ = "account"
- __version__ = "0.23"
+ __version__ = "0.24"
__description__ = """Oboom.com account plugin"""
__license__ = "GPLv3"
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"