2011-12-14 02:30:32 |
Garrett Holmstrom |
description |
When the encryption code in euca-bundle-image generates a key and IV to use when encrypting the image, the random number generating algorithm occasionally yields a value that causes an exception when that value is handed to unhexlify:
Traceback (most recent call last):
File "/usr/bin/euca-bundle-image", line 231, in <module>
main()
File "/usr/bin/euca-bundle-image", line 209, in main
encrypted_file, key, iv, bundled_size = euca.encrypt_image(tgz_file)
File "/usr/lib/python2.6/dist-packages/euca2ools/__init__.py", line 610, in encrypt_image
k=EVP.Cipher(alg='aes_128_cbc', key=unhexlify(key), iv=unhexlify(iv), op=1)
TypeError: Odd-length string
Currently, when this occurs, the program terminates unsuccessfully. Because this happens very rarely, I will change this behavior to print a short warning that contains the unusable key and IV, ask the user to report those values in this bug, and then retry encryption with a new key and IV so the command can return successfully.
Future users: if you see a message such as the following when you run euca-bundle-image, please report the "k" and "iv" values it indicates in a comment on this bug:
WARNING: retrying encryption to work around a rare RNG bug
Please report the following values to Eucalyptus Systems at
https://bugs.launchpad.net/bugs/<number> to help diagnose
this issue.
k: 0x9680c0e4f42daa742eed12fabdbf52598dL
iv: 0xe8fe9e11b31baa00434394c1f2fff2ed39L |
When the encryption code in euca-bundle-image generates a key and IV to use when encrypting the image, the random number generating algorithm occasionally yields a value that causes an exception when that value is handed to unhexlify:
Traceback (most recent call last):
File "/usr/bin/euca-bundle-image", line 231, in <module>
main()
File "/usr/bin/euca-bundle-image", line 209, in main
encrypted_file, key, iv, bundled_size = euca.encrypt_image(tgz_file)
File "/usr/lib/python2.6/dist-packages/euca2ools/__init__.py", line 610, in encrypt_image
k=EVP.Cipher(alg='aes_128_cbc', key=unhexlify(key), iv=unhexlify(iv), op=1)
TypeError: Odd-length string
Currently, when this occurs, the program terminates unsuccessfully. Because this happens very rarely, I will change this behavior to print a short warning that contains the unusable key and IV, ask the user to report those values in this bug, and then retry encryption with a new key and IV so the command can return successfully.
Future users: if you see a message such as the following when you run euca-bundle-image, please report the "k" and "iv" values it indicates in a comment on this bug:
WARNING: retrying encryption to work around a rare RNG bug
Please report the following values to Eucalyptus Systems at
https://bugs.launchpad.net/bugs/904062 to help diagnose
this issue.
k: 0x9680c0e4f42daa742eed12fabdbf52598dL
iv: 0xe8fe9e11b31baa00434394c1f2fff2ed39L |
|