summaryrefslogtreecommitdiff
path: root/src/leap/soledad/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/soledad/__init__.py')
-rw-r--r--src/leap/soledad/__init__.py28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index 6bb88094..b847364f 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -71,27 +71,7 @@ Path to the certificate file used to certify the SSL connection between
Soledad client and server.
"""
-
-#
-# Exceptions
-#
-
-class KeyDoesNotExist(Exception):
- """
- Soledad attempted to find a key that does not exist locally.
- """
-
-
-class KeyAlreadyExists(Exception):
- """
- Soledad attempted to create a key that already exists locally.
- """
-
-
-class NotADirectory(Exception):
- """
- Expected a path for a directory but got some other thing.
- """
+SECRETS_DOC_ID_HASH_PREFIX = 'uuid-'
#
@@ -374,7 +354,6 @@ class Soledad(object):
# recover the initial value and ciphertext
iv, ciphertext = self._secrets[self._secret_id][self.SECRET_KEY].split(
self.IV_SEPARATOR, 1)
- iv = int(iv)
ciphertext = binascii.a2b_base64(ciphertext)
return self._crypto.decrypt_sym(ciphertext, key, iv=iv)
@@ -523,7 +502,10 @@ class Soledad(object):
@return: the hash
@rtype: str
"""
- return sha256('uuid-%s' % self._uuid).hexdigest()
+ return sha256(
+ '%s%s' % (
+ SECRETS_DOC_ID_HASH_PREFIX,
+ self._uuid)).hexdigest()
def _shared_db(self):
"""