Revision 0224049a
b/snf-cyclades-app/synnefo/app_settings/default/api.py | ||
---|---|---|
145 | 145 |
|
146 | 146 |
# Key for password encryption-decryption. After changing this setting, synnefo |
147 | 147 |
# will be unable to decrypt all existing Backend passwords. You will need to |
148 |
# store again the new password by using 'snf-manage backend-modify' |
|
148 |
# store again the new password by using 'snf-manage backend-modify'. |
|
149 |
# SECRET_ENCRYPTION_KEY may up to 32 bytes. Keys bigger than 32 bytes are not |
|
150 |
# supported. |
|
149 | 151 |
SECRET_ENCRYPTION_KEY= "Password Encryption Key" |
b/snf-cyclades-app/synnefo/db/aes_encrypt.py | ||
---|---|---|
10 | 10 |
|
11 | 11 |
|
12 | 12 |
def _pad_secret(secret, blocksize=32, padding='}'): |
13 |
if not len(secret) in (16, 24, 32): |
|
13 |
len_secret = len(secret) |
|
14 |
if len_secret > 32: |
|
15 |
raise ValueError('Encryption key must be smaller than 32 bytes') |
|
16 |
if not len_secret in (16, 24, 32): |
|
14 | 17 |
return secret + (blocksize - len(secret)) * padding |
15 | 18 |
return secret |
16 | 19 |
|
Also available in: Unified diff