summaryrefslogtreecommitdiff
path: root/src/leap/soledad
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-04-29 17:06:27 -0300
committerdrebs <drebs@leap.se>2013-04-29 17:06:27 -0300
commit8abc5d01b600a32c4612907894c7cc59ae10a1b2 (patch)
tree4ffbc7d368f87cd28ed8cab79bf727ed117212ba /src/leap/soledad
parent058993485b6e10bbc07144252f2f4db9dd667b75 (diff)
Cleanup _gen_symkey error raising.
Diffstat (limited to 'src/leap/soledad')
-rw-r--r--src/leap/soledad/__init__.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index 96b05628..5b2f5fc1 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -324,15 +324,11 @@ class Soledad(object):
if not self._has_symkey():
raise KeyDoesNotExist("Tried to load key for symmetric "
"encryption but it does not exist on disk.")
- try:
- with open(self._config.get_secret_path()) as f:
- self._symkey = \
- self._crypto.decrypt_sym(
- f.read(), passphrase=self._passphrase)
- self._crypto.symkey = self._symkey
- except IOError:
- raise IOError('Failed to open secret file %s.' %
- self._config.get_secret_path())
+ with open(self._config.get_secret_path()) as f:
+ self._symkey = \
+ self._crypto.decrypt_sym(
+ f.read(), passphrase=self._passphrase)
+ self._crypto.symkey = self._symkey
def _gen_symkey(self):
"""