Thursday, 22 August 2013

python 2.7 hashlib sha1 not found on ARM

python 2.7 hashlib sha1 not found on ARM

I'm trying to use openssl in python that is cross compiled to run on ARM.
For some reason the sha hashing methods are not found. In the python
console, I type:
import hashlib
ERROR:root:code for hash sha1 was not found. Traceback (most recent call
last): File "/usr/lib/python2.7/hashlib.py", line 139, in <module>
globals()[__func_name] = __get_hash(__func_name) File
"/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name) ValueError:
unsupported hash type sha1 ERROR:root:code for hash sha224 was not
found. Traceback (most recent call last): File
"/usr/lib/python2.7/hashlib.py", line 139, in <module>
globals()[__func_name] = __get_hash(__func_name) File
"/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name) ValueError:
unsupported hash type sha224 ERROR:root:code for hash sha256 was not
found. Traceback (most recent call last): File
"/usr/lib/python2.7/hashlib.py", line 139, in <module>
globals()[__func_name] = __get_hash(__func_name) File
"/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name) ValueError:
unsupported hash type sha256 ERROR:root:code for hash sha384 was not
found. Traceback (most recent call last): File
"/usr/lib/python2.7/hashlib.py", line 139, in <module>
globals()[__func_name] = __get_hash(__func_name) File
"/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name) ValueError:
unsupported hash type sha384 ERROR:root:code for hash sha512 was not
found. Traceback (most recent call last): File
"/usr/lib/python2.7/hashlib.py", line 139, in <module>
globals()[__func_name] = __get_hash(__func_name) File
"/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name) ValueError:
unsupported hash type sha512
and if I type it again, I do not get any error message. That is one issue.
But the more significant problem is that when I type:
from hashlib import sha1 as sha
I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name sha1
Any ideas or hints as to where sha is supposed to be implemented? Even
sha.py is trying to import sha1 from hashlib.
Another piece of information: When I type "dir(hashlib)" I get
['__all__', '__builtins__', '__doc__', '__file__',
'__get_builtin_constructor', '__name__', '__package__', 'algorithms',
'logging', 'md5', 'new']

No comments:

Post a Comment