Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions awx/main/utils/encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from cryptography.fernet import Fernet, InvalidToken
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import algorithms
from django.utils.encoding import smart_str, smart_bytes

__all__ = ['get_encryption_key', 'encrypt_field', 'decrypt_field', 'encrypt_value', 'decrypt_value', 'encrypt_dict']
Expand All @@ -30,6 +31,8 @@ def __init__(self, key, backend=None):
self._signing_key = key[:32]
self._encryption_key = key[32:]
self._backend = backend
# Required for compatibility with cryptography >= 50.0.0
self._aes = algorithms.AES(self._encryption_key)


def get_encryption_key(field_name, pk=None, secret_key=None):
Expand Down
Loading