Procházet zdrojové kódy

More python3 compatibility

* disable __str__ of NewTag, it causes
a bug in CryptoEngine
oz123 před 10 roky
rodič
revize
ced04a2842
2 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 3 3
      pwman/data/tags.py
  2. 1 1
      pwman/util/crypto.py

+ 3 - 3
pwman/data/tags.py

@@ -35,9 +35,9 @@ class TagNew(object):
         else:
             return False
 
-    def __str__(self):
-        enc = CryptoEngine.get()
-        return enc.decrypt(self._name)
+    #def __str__(self):
+    #    enc = CryptoEngine.get()
+    #    return enc.decrypt(self._name)
 
     @property
     def name(self):

+ 1 - 1
pwman/util/crypto.py

@@ -203,7 +203,7 @@ class CryptoEngine(object):
         If key is bad, a CryptoBadKeyException is raised
         Can also raise a CryptoException and CryptoUnsupportedException"""
         cipher = self._getcipher()
-        ciphertext = str(ciphertext).decode('base64')
+        ciphertext = base64.b64decode(str(ciphertext))
         plaintext = cipher.decrypt(ciphertext)
         return self._retrievedata(plaintext)