deny insecure parameters by default
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Thu, 16 Apr 2020 13:43:36 +0000 (15:43 +0200)
committerPhilipp Gesang <philipp.gesang@intra2net.com>
Thu, 16 Apr 2020 14:32:43 +0000 (16:32 +0200)
commit6110ef14e6db8c83576eb15344772bafac0a6b1c
tree805fa288d6f712f7cd147ed53ed9df1e8dcb9cdc
parenta2dd68b9575c3eefe36fe7eae5847bb99bc64f55
deny insecure parameters by default

Address Deltatar audit item 2.1: Violating data integrity using
passthrough mode.

The ciphertext is assumed attacker controlled. This allows a
downgrade to plaintext by setting the parameter version to
plaintext passthrough on an encrypted object, bypassing integrity
protection. Reduce the susceptibility to this attack by refusing
to continue if such a header is encountered in the input.
Passthrough mode is still available if the *insecure* flag is
passed to the constructors of the encryption / decryption
handles.
deltatar/crypto.py
testing/test_crypto.py