wbond / oscrypto

Compiler-free Python crypto library backed by the OS, supporting CPython and PyPy
MIT License
320 stars 70 forks source link

High Siearra Openssl Issue #22

Closed cah-sachin closed 6 years ago

cah-sachin commented 6 years ago

We are facing issue with Mac OS High Sierra 10.13.2 (17C88).

We are using oscrypto library which internally uses openssl of OS. While accessing it we are receiving following error.

We don't receive below error in sierra operating system of MAC

Traceback (most recent call last):
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/cli.py", line 413, in main
    environments=options.environments, tasks=arguments)
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/reactor.py", line 128, in build
    return self.build_execution_plan(tasks, execution_plan)
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/reactor.py", line 166, in build_execution_plan
    reactor=self)
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/execution.py", line 351, in execute_execution_plan
    summaries.append(self.execute_task(task, **keyword_arguments))
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/execution.py", line 298, in execute_task
    task.execute(self.logger, keyword_arguments)
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/execution.py", line 169, in execute
    executable.execute(argument_dict)
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/execution.py", line 100, in execute
    self.callable(*arguments)
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/plugins/python/unittest_plugin.py", line 61, in run_unit_tests
    run_tests(project, logger, "unittest", "unit tests")
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/plugins/python/unittest_plugin.py", line 71, in run_tests
    project, logger, execution_prefix, execution_name))
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/utils.py", line 323, in fork_process
    raise_exception(result[1], result[2])
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/utils.py", line 305, in instrumented_target
    send_value = (target(*args, **kwargs), None, None)
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/plugins/python/unittest_plugin.py", line 101, in do_run_tests
    test_method_prefix)
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/pybuilder/plugins/python/unittest_plugin.py", line 136, in execute_tests_matching
    tests = loader.loadTestsFromNames(test_modules)
  File "/Users/rodrigo.velez/.pyenv/versions/2.7.14/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/Users/rodrigo.velez/.pyenv/versions/2.7.14/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/src/unittest/python/services/test_certificate_service.py", line 13, in <module>
    from deeplaser.certificate.crypto.standard import TokenGeneratorOsCrypto
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/src/main/python/deeplaser/certificate/crypto/standard.py", line 11, in <module>
    from oscrypto import asymmetric
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/oscrypto/asymmetric.py", line 15, in <module>
    from .kdf import pbkdf2, pbkdf2_iteration_calculator
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/oscrypto/kdf.py", line 9, in <module>
    from .util import rand_bytes
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/oscrypto/util.py", line 10, in <module>
    from ._osx.util import rand_bytes
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/oscrypto/_osx/util.py", line 208, in <module>
    from .._openssl._libcrypto import libcrypto
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/oscrypto/_openssl/_libcrypto.py", line 14, in <module>
    from ._libcrypto_ctypes import (
  File "/Users/rodrigo.velez/First_steps/deeplaser-core/deeplaser-core-env/lib/python2.7/site-packages/oscrypto/_openssl/_libcrypto_ctypes.py", line 668, in <module>
    raise FFIEngineError('Error initializing ctypes')
FFIEngineError: Error initializing ctypes
------------------------------------------------------------
BUILD FAILED - Error initializing ctypes
------------------------------------------------------------
wbond commented 6 years ago

Thanks for the bug report! I haven't installed High Sierra yet, but it seems I should probably get a VM running to get this fixed.

cah-sachin commented 6 years ago

Thanks for the update, looking forward to it.

cah-sachin commented 6 years ago

Is there any update on this issue ?

wbond commented 6 years ago

Yes, it was fixed with 83e2a06085b5b09ee5cd6c28a2ae1c52352c9e53 and will be part of the next release

jbarlow-mcafee commented 5 years ago

@wbond Thanks so much for looking into and resolving this issue. Do you have a date in mind for when you might be able to roll this fix into a new release that is published to PyPI?

wbond commented 5 years ago

The blocker on this is that I need to resolve https://github.com/wbond/asn1crypto/issues/100, by dropping the public key calc from asn1crypto, and then make possible to do here. After that I am planning on cutting a release of both.

The downside is that we just had our fifth child, and I am busy at work, so I don't have much time to squeeze in open source stuff. It may take a few weeks to get it all done.

jbarlow-mcafee commented 5 years ago

Ok, that makes sense and thanks for the quick update. Definitely understand the need to spend as much time as possible with a new family member. Congrats on that. 😄

wbond commented 4 years ago

Version 1.0.0 is out on PyPi now at https://pypi.org/project/oscrypto/