mirror of
https://github.com/ansible/awx.git
synced 2026-03-31 07:45:08 -02:30
Put the utf8 encoding in the right place for the cipher
This commit is contained in:
@@ -104,6 +104,7 @@ def encrypt_field(instance, field_name, ask=False):
|
||||
value = getattr(instance, field_name)
|
||||
if not value or value.startswith('$encrypted$') or (ask and value == 'ASK'):
|
||||
return value
|
||||
value = value.encode('utf-8')
|
||||
key = get_encryption_key(instance, field_name)
|
||||
cipher = AES.new(key, AES.MODE_ECB)
|
||||
while len(value) % cipher.block_size != 0:
|
||||
|
||||
Reference in New Issue
Block a user