Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not avoid hash modules with OpenSSL on Windows. #34

Merged
merged 1 commit into from
Apr 2, 2014

Conversation

thewtex
Copy link
Contributor

@thewtex thewtex commented Mar 24, 2014

OpenSSL does not appear to provide them (at least in a usable way),
so build the md5 and sha modules if requested.

OpenSSL does not appear to provide them (at least in a usable way),
so build the md5 and sha modules if requested.
jcfr added a commit that referenced this pull request Apr 2, 2014
Do not avoid hash modules with OpenSSL on Windows.

Tested topic `win-hashes` on VS2010 64-bit. And `test_hashlib` test now pass.

With topic  `win-hashes`: http://open.cdash.org/testDetails.php?test=245162026&build=3277295
```
== CPython 2.7.3 (default, Apr 2 2014, 11:19:29) [MSC v.1600 64 bit (AMD64)]
==   Windows-7-6.1.7601-SP1 little-endian
==   c:\users\kitware\appdata\local\temp\test_python_5032
Testing with flags: sys.flags(debug=0, py3k_warning=1, division_warning=1, division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, tabcheck=2, verbose=0, unicode=0, bytes_warning=0, hash_randomization=0)
test_hash
test_coerced_floats (test.test_hash.HashEqualityTestCase) ... ok
test_coerced_integers (test.test_hash.HashEqualityTestCase) ... ok
test_numeric_literals (test.test_hash.HashEqualityTestCase) ... ok
test_default_hash (test.test_hash.HashInheritanceTestCase) ... ok
test_error_hash (test.test_hash.HashInheritanceTestCase) ... ok
test_fixed_hash (test.test_hash.HashInheritanceTestCase) ... ok
test_hashable (test.test_hash.HashInheritanceTestCase) ... ok
test_not_hashable (test.test_hash.HashInheritanceTestCase) ... ok
test_hashes (test.test_hash.HashBuiltinsTestCase) ... ok
test_empty_string (test.test_hash.StrHashRandomizationTests) ... ok
test_fixed_hash (test.test_hash.StrHashRandomizationTests) ... ok
test_null_hash (test.test_hash.StrHashRandomizationTests) ... ok
test_randomized_hash (test.test_hash.StrHashRandomizationTests) ... ok
test_empty_string (test.test_hash.UnicodeHashRandomizationTests) ... ok
test_fixed_hash (test.test_hash.UnicodeHashRandomizationTests) ... ok
test_null_hash (test.test_hash.UnicodeHashRandomizationTests) ... ok
test_randomized_hash (test.test_hash.UnicodeHashRandomizationTests) ... ok
test_empty_string (test.test_hash.BufferHashRandomizationTests) ... ok
test_fixed_hash (test.test_hash.BufferHashRandomizationTests) ... ok
test_null_hash (test.test_hash.BufferHashRandomizationTests) ... ok
test_randomized_hash (test.test_hash.BufferHashRandomizationTests) ... ok
test_randomized_hash (test.test_hash.DatetimeDateTests) ... ok
test_randomized_hash (test.test_hash.DatetimeDatetimeTests) ... ok
test_randomized_hash (test.test_hash.DatetimeTimeTests) ... ok
```

Without topic  `win-hashes`: http://open.cdash.org/testDetails.php?test=245016329&build=3276479
```
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\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 "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\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 "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\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 "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\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 "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha512
== CPython 2.7.3 (default, Apr 1 2014, 23:10:54) [MSC v.1600 64 bit (AMD64)]
==   Windows-7-6.1.7601-SP1 little-endian
==   C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin
Testing with flags: sys.flags(debug=0, py3k_warning=1, division_warning=1, division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, tabcheck=2, verbose=0, unicode=0, bytes_warning=0, hash_randomization=0)
test_hashlib
C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\test\regrtest.py:1542: RuntimeWarning: tests may fail, unable to change the CWD to c:\users\kitware\appdata\local\temp\test_python_3552
  with test_support.temp_cwd(TESTCWD, quiet=True):
test test_hashlib crashed -- <type 'exceptions.AttributeError'>: 'module' object has no attribute 'sha1'
Traceback (most recent call last):
  File "C:/D/W/CPython-64-VS2010/Nightly/CPython-64-cl-VS2010-Win64-bin/Lib/test/regrtest.py", line 877, in runtest_inner
    indirect_test()
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\test\test_hashlib.py", line 358, in test_main
    test_support.run_unittest(HashLibTestCase)
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\test\test_support.py", line 1093, in run_unittest
    suite.addTest(unittest.makeSuite(cls))
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\unittest\loader.py", line 310, in makeSuite
    return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase(testCaseClass)
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\unittest\loader.py", line 56, in loadTestsFromTestCase
    loaded_suite = self.suiteClass(map(testCaseClass, testCaseNames))
  File "C:\D\W\CPython-64-VS2010\Nightly\CPython-64-cl-VS2010-Win64-bin\Lib\test\test_hashlib.py", line 63, in __init__
    constructors.add(getattr(hashlib, algorithm))
AttributeError: 'module' object has no attribute 'sha1'
1 test failed:
    test_hashlib
```
@jcfr jcfr merged commit 3c5864f into python-cmake-buildsystem:master Apr 2, 2014
@jcfr
Copy link
Contributor

jcfr commented Apr 2, 2014

Thanks for your contribution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants