summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-03-20 21:34:54 -0300
committerdrebs <drebs@leap.se>2017-04-04 18:27:36 +0200
commit3e3c78b01a872fdb445a76250145c6e1a31056e2 (patch)
tree096bdbedb2709f294713d0e94fac1edc7bfb48d5 /client
parent10c1ad72f1b6ea3feea6e731c426c2957bbce03f (diff)
[feature] improve error messages on preamble check
Diffstat (limited to 'client')
-rw-r--r--client/src/leap/soledad/client/_crypto.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/client/src/leap/soledad/client/_crypto.py b/client/src/leap/soledad/client/_crypto.py
index 66b26521..7d9b3a05 100644
--- a/client/src/leap/soledad/client/_crypto.py
+++ b/client/src/leap/soledad/client/_crypto.py
@@ -386,13 +386,16 @@ class BlobDecryptor(object):
# we can refuse to process something that is in the future or
# too far in the past (1984 would be nice, hehe)
if sch != ENC_SCHEME.symkey:
- raise InvalidBlob('invalid scheme')
+ raise InvalidBlob('Invalid scheme: %s' % sch)
if meth != ENC_METHOD.aes_256_gcm:
- raise InvalidBlob('invalid encryption scheme')
+ raise InvalidBlob('Invalid encryption scheme: %s' % meth)
if rev != self.rev:
- raise InvalidBlob('invalid revision')
+ msg = 'Invalid revision. Expected: %s, was: %s' % (self.rev, rev)
+ raise InvalidBlob(msg)
if doc_id != self.doc_id:
- raise InvalidBlob('invalid doc id')
+ msg = 'Invalid doc_id. '
+ + 'Expected: %s, was: %s' % (self.doc_id, doc_id)
+ raise InvalidBlob(msg)
return preamble, iv