extend crypto.py exception descriptions
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Mon, 7 Aug 2017 13:37:19 +0000 (15:37 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 2 Apr 2018 11:34:09 +0000 (13:34 +0200)
deltatar/crypto.py

index 1c03742..92c0d8b 100755 (executable)
@@ -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