Commit 37dc8e4c authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Rename setting

Rename ENCRYPTION_KEY to SECRET_ENCRYPTION_KEY to prevent from being
displayed at django debug traces.
parent 9ad51df0
......@@ -30,7 +30,7 @@ NEW FEATURES:
* Replaced GANETI_MAX_LINK_NUMBER with PRIVATE_PHYSICAL_VLAN_MAX_NUMBER
* Replaced PRIVATE_MAC_FILTERED_BRIDGE
* Add setting ENABLED_NETWORKS
* Add setting ENCRYPTION_KEY
* Add setting SECRET_ENCRYPTION_KEY
* Add settings for configuring each network type
......
......@@ -146,4 +146,4 @@ ASTAKOS_URL = 'https://astakos.okeanos.grnet.gr/im/authenticate'
# Key for password encryption-decryption. After changing this setting, synnefo
# will be unable to decrypt all existing Backend passwords. You will need to
# store again the new password by using 'snf-manage backend-modify'
ENCRYPTION_KEY= "Password Encryption Key"
SECRET_ENCRYPTION_KEY= "Password Encryption Key"
......@@ -2,7 +2,7 @@ from binascii import b2a_base64, a2b_base64
from Crypto.Cipher import AES
from random import choice
from string import letters, digits
from synnefo.settings import ENCRYPTION_KEY
from synnefo.settings import SECRET_ENCRYPTION_KEY
DB_ENCRYPTED_FIELD_PREFIX = 'encrypted'
......@@ -16,12 +16,12 @@ def _pad_secret(secret, blocksize=32, padding='}'):
def encrypt(s):
obj = AES.new(_pad_secret(ENCRYPTION_KEY), AES.MODE_CFB)
obj = AES.new(_pad_secret(SECRET_ENCRYPTION_KEY), AES.MODE_CFB)
return obj.encrypt(s)
def decrypt(s):
obj = AES.new(_pad_secret(ENCRYPTION_KEY), AES.MODE_CFB)
obj = AES.new(_pad_secret(SECRET_ENCRYPTION_KEY), AES.MODE_CFB)
return obj.decrypt(s)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment