From 89ec6e2fa393bd82fc0bb1f4987b8036d132d74d Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 7 Aug 2017 15:37:19 +0200 Subject: [PATCH] extend crypto.py exception descriptions --- deltatar/crypto.py | 33 ++++++++++++++++++++++++++------- 1 files changed, 26 insertions(+), 7 deletions(-) diff --git a/deltatar/crypto.py b/deltatar/crypto.py index 1c03742..92c0d8b 100755 --- a/deltatar/crypto.py +++ b/deltatar/crypto.py @@ -193,27 +193,43 @@ class InvalidGCMTag (Exception): class InvalidIVFixedPart (Exception): - """IV fixed part not in supplied list.""" + """ + IV fixed part not in supplied list: either the backup is corrupt or the + current object does not belong to it. + """ pass class IVFixedPartError (Exception): - """Error creating a unique IV fixed part.""" + """ + Error creating a unique IV fixed part: repeated calls to system RNG yielded + the same sequence of bytes as the last IV used. + """ pass class InvalidFileCounter (Exception): - """File counter out of range.""" + """ + When encrypting, an attempted reuse of a dedicated counter (info file, + index file) was caught. + """ pass class DuplicateIV (Exception): - """IV reused.""" + """ + During encryption, the current IV fixed part is identical to an already + existing IV (same prefix and file counter). This indicates tampering or + programmer error and cannot be recovered from. + """ pass class NonConsecutiveIV (Exception): - """IVs not numbered consecutively (not necessarily an error).""" + """ + IVs not numbered consecutively. This is a hard error with strict IV + checking. Precludes random access to the encrypted objects. + """ pass @@ -223,12 +239,15 @@ class FormatError (Exception): class DecryptionError (Exception): - """Error during decryption.""" + """Error during decryption with ``crypto.py`` on the command line.""" pass class Unreachable (Exception): - """Makeshift __builtin_unreachable().""" + """ + Makeshift __builtin_unreachable(); always a programmer error if + thrown. + """ pass -- 1.7.1