[Bug 509562] Re: euca-bundle-image returns Odd-length string error
Scott Moser
smoser at canonical.com
Fri Sep 17 01:45:51 BST 2010
I found the what is at fault here, the following program demonstrates
the error:
#!/usr/bin/python
from M2Crypto import BN, EVP, RSA, util, Rand, m2, X509
from binascii import hexlify, unhexlify
i=0
while True:
i=i+1
try:
iv = (hex(BN.rand(16 * 8))[2:34]).replace('L', 'c')
uh = unhexlify(iv)
except:
print "found failure, i=%s, iv=%s len=(%s)\n" % (i,iv,len(iv))
raise
basically,
iv = (hex(BN.rand(16 * 8))[2:34]).replace('L', 'c')
is not guaranteed to create something that is consumable by unhexlify.
Run it, and you'll very quickly see something like:
$ /tmp/go.py
found failure, i=36, iv=3f99a2dfad8a6d936772bd181f8653c len=(31)
Traceback (most recent call last):
File "/tmp/go.py", line 11, in <module>
uh = unhexlify(iv)
TypeError: Odd-length string
** Changed in: euca2ools (Ubuntu)
Status: Incomplete => Triaged
--
euca-bundle-image returns Odd-length string error
https://bugs.launchpad.net/bugs/509562
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to eucalyptus in ubuntu.
More information about the Ubuntu-server-bugs
mailing list