Skip to content

Commit dbe3893

Browse files
committed
add error if string was expected in list of passwords but dict was given.
happened to me: _global: - user1: password1 - user2: password2 instead of _global: user1: password1 user2: password2
1 parent 1cbfd5b commit dbe3893

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ The content is encrypted with AES-256 in Python using PyCryptodome, and decrypte
3131
* ~~Save the generated random keys instead of passwords to session( or local) storage~~
3232
* Sign generated generated and javascript files used in encrypted pages to make it more tamper proof
3333
* ~~Add check for latin1 encoding in passwords, as it pycryptodome's implementation of PBKDF2 requires it~~
34-
*
34+
* find an equivalent way to define multiple passwords in the password inventory as global password
35+
* make it possible to define passwords in external yaml file(s)
3536
* ...to be defined
3637

3738
# Table of Contents

encryptcontent/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ def on_config(self, config, **kwargs):
385385
if isinstance(credentials, list):
386386
new_entry['store'] = []
387387
for password in credentials:
388+
if isinstance(password, dict):
389+
logger.error("Configuration error in yaml syntax of 'password_inventory': expected string at level '{level}', but found dict!".format(level=level))
390+
os._exit(1)
388391
keystore = self.__encrypt_key__(new_entry['key'], password, self.setup['kdf_iterations'])
389392
new_entry['store'].append(';'.join(keystore))
390393
elif isinstance(credentials, dict):

0 commit comments

Comments
 (0)