encryptType no longer set when encryption not used
This commit is contained in:
parent
0c196e8135
commit
dd87ad8999
3 changed files with 4 additions and 7 deletions
|
@ -53,10 +53,11 @@ def insert_block(data, header='txt', sign=False, encryptType='', symKey='', asym
|
|||
|
||||
meta['type'] = str(header)
|
||||
|
||||
if encryptType in ('asym', 'sym', ''):
|
||||
if encryptType in ('asym', 'sym'):
|
||||
metadata['encryptType'] = encryptType
|
||||
else:
|
||||
raise onionrexceptions.InvalidMetadata('encryptType must be asym or sym, or blank')
|
||||
if not encryptType in ('', None):
|
||||
raise onionrexceptions.InvalidMetadata('encryptType must be asym or sym, or blank')
|
||||
|
||||
try:
|
||||
data = data.encode()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue