diff options
author | James Cammarata <jimi@sngx.net> | 2015-07-02 15:04:57 -0400 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2015-07-02 15:05:28 -0400 |
commit | 051d04c8d7a01ccc0fa64c2d64395ad9b677d9a7 (patch) | |
tree | eaef46e2901947d1733cdfd8cbdc7c64fe640e4e | |
parent | c15a6cc6342663b20489c2c2dec510a35cbfc127 (diff) | |
download | ansible-051d04c8d7a01ccc0fa64c2d64395ad9b677d9a7.tar.gz |
Fix bug related to keyczar messing up encodings
Also increases default AES key size to 256 for accelerated keys.
-rw-r--r-- | lib/ansible/utils/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 476a1e28e8..a62c85529d 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -140,7 +140,7 @@ def key_for_hostname(hostname): # use new AES keys every 2 hours, which means fireball must not allow running for longer either if not os.path.exists(key_path) or (time.time() - os.path.getmtime(key_path) > 60*60*2): - key = AesKey.Generate() + key = AesKey.Generate(size=256) fd = os.open(key_path, os.O_WRONLY | os.O_CREAT, int(C.ACCELERATE_KEYS_FILE_PERMS, 8)) fh = os.fdopen(fd, 'w') fh.write(str(key)) @@ -155,7 +155,7 @@ def key_for_hostname(hostname): return key def encrypt(key, msg): - return key.Encrypt(msg) + return key.Encrypt(msg.encode('utf-8')) def decrypt(key, msg): try: |