added option to disable plaintext blocks

This commit is contained in:
Kevin Froman 2019-09-27 20:38:47 -05:00
parent 71c9337ab7
commit 60f0ef0fef
7 changed files with 43 additions and 25 deletions

View file

@ -64,6 +64,7 @@ def insert_block(data: Union[str, bytes], header: str ='txt',
if encryptType in ('asym', 'sym'):
metadata['encryptType'] = encryptType
else:
if not config.get('general.store_plaintext_blocks', True): raise onionrexceptions.InvalidMetadata("Plaintext blocks are disabled, yet a plaintext block was being inserted")
if not encryptType in ('', None):
raise onionrexceptions.InvalidMetadata('encryptType must be asym or sym, or blank')