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

Segmentation fault: 11 under python included paramiko. OpenSSL 1.1.1k #336

Open
djmarsel opened this issue Jun 18, 2021 · 7 comments
Open

Comments

@djmarsel
Copy link

Hi.
I am facing a strange problem when using dynamic link libraries (gost.dylib)

MacOS BigSur 11.4
Installed OpenSSL 1.1.1k
and extension engine gost-1.1.dylib

From the command line, everything works fine - both encryption and signature.

The problem occurs in python when the paramiko library is included:

python -v -c "import paramiko"

Gives an error message:

zsh: segmentation fault

Fragment of the crash log:

Process:               python3.8 [22413]
Path:                  /Users/USER/*/python3.8
Identifier:            python3.8
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        zsh [845]
Responsible:           Terminal [752]
User ID:               501

Date/Time:             2021-06-15 16:51:22.554 +0300
OS Version:            macOS 11.4 (20F71)
Report Version:        12
Bridge OS Version:     5.4 (18P4663)
Anonymous UUID:        6DEE2862-1A98-BCEC-679A-AA18D28D88C6

Sleep/Wake UUID:       8827DC35-0A37-4A9F-97E4-70552CC6A9A1

Time Awake Since Boot: 31000 seconds
Time Since Wake:       1600 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [22413]

VM Regions Near 0:
--> 
    __TEXT                      10e820000-10ea6c000    [ 2352K] r-x/r-x SM=COW  /Users/*/*.8

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_pthread.dylib             0x00007fff203adb7b pthread_rwlock_wrlock + 0
1   libcrypto.1.1.dylib                 0x000000010f09ddc9 CRYPTO_THREAD_write_lock + 9
2   libcrypto.1.1.dylib                 0x000000010f01d9ac engine_table_register + 52
3   libcrypto.1.1.dylib                 0x000000010f01e260 ENGINE_register_ciphers + 75
4   gost.1.1.dylib                      0x000000010fe086f4 bind_gost + 471 (gost_eng.c:348) [inlined]
5   gost.1.1.dylib                      0x000000010fe086f4 bind_engine + 580 (gost_eng.c:376)
6   _openssl.abi3.so                    0x000000010fa5d3c8 dynamic_load + 728
7   _openssl.abi3.so                    0x000000010fa5ce22 dynamic_ctrl + 658
8   _openssl.abi3.so                    0x000000010fa5bf86 ENGINE_ctrl + 502
9   _openssl.abi3.so                    0x000000010fa5c6f7 ENGINE_ctrl_cmd_string + 503
10  _openssl.abi3.so                    0x000000010fa5b9b3 int_engine_configure + 451
11  _openssl.abi3.so                    0x000000010fa5b706 int_engine_module_init + 182
12  _openssl.abi3.so                    0x000000010f9ca95d module_init + 237
13  _openssl.abi3.so                    0x000000010f9c9aaf module_run + 223
14  _openssl.abi3.so                    0x000000010f9c9927 CONF_modules_load + 295
15  _openssl.abi3.so                    0x000000010f9c9c70 CONF_modules_load_file + 224
16  _openssl.abi3.so                    0x000000010f9cac7f openssl_config_int + 223
17  _openssl.abi3.so                    0x000000010fa97b34 ossl_init_config + 20
18  _openssl.abi3.so                    0x000000010fa97749 ossl_init_config_ossl_ + 9
19  libsystem_pthread.dylib             0x00007fff203ad1e1 __pthread_once_handler + 65
20  libsystem_platform.dylib            0x00007fff203f35c6 _os_once_callout + 18
21  libsystem_pthread.dylib             0x00007fff203ad18f pthread_once + 74
22  _openssl.abi3.so                    0x000000010fb2334d CRYPTO_THREAD_run_once + 29
23  _openssl.abi3.so                    0x000000010fa9723a OPENSSL_init_crypto + 1210
24  _openssl.abi3.so                    0x000000010fb8a6fe OPENSSL_init_ssl + 158
...

Python debug (last lines):

import 'cryptography.hazmat.primitives.asymmetric.x448' # <_frozen_importlib_external.SourceFileLoader object at 0x10f8ecb20>
import 'cryptography.hazmat.backends.openssl.x448' # <_frozen_importlib_external.SourceFileLoader object at 0x10f8ec8b0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/__pycache__/__init__.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/__init__.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/__pycache__/__init__.cpython-38.pyc'
import 'cryptography.hazmat.bindings' # <_frozen_importlib_external.SourceFileLoader object at 0x10f8eceb0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/__init__.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__init__.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/__init__.cpython-38.pyc'
import 'cryptography.hazmat.bindings.openssl' # <_frozen_importlib_external.SourceFileLoader object at 0x10f8ece50>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/binding.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/binding.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/binding.cpython-38.pyc'
# extension module 'cryptography.hazmat.bindings._openssl' loaded from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so'
# extension module 'cryptography.hazmat.bindings._openssl' executed from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so'
import 'cryptography.hazmat.bindings._openssl' # <_frozen_importlib_external.ExtensionFileLoader object at 0x10f8fe4c0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/_conditional.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/_conditional.cpython-38.pyc'
import 'cryptography.hazmat.bindings.openssl._conditional' # <_frozen_importlib_external.SourceFileLoader object at 0x10f8fe580>
@beldmit
Copy link
Contributor

beldmit commented Jun 18, 2021

It looks like the problem is not in the engine but in the openssl when registering ciphers.

@djmarsel
Copy link
Author

djmarsel commented Jun 18, 2021

It looks like the problem is not in the engine but in the openssl when registering ciphers.

Encryption and signature by gost works fine from the command line.

@beldmit
Copy link
Contributor

beldmit commented Jun 18, 2021

Are you able to get a more detailed stack trace?

@djmarsel
Copy link
Author

mport 'nacl.bindings.crypto_sign' # <_frozen_importlib_external.SourceFileLoader object at 0x102cd5430>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/bindings/__pycache__/randombytes.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/bindings/randombytes.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/bindings/__pycache__/randombytes.cpython-38.pyc'
import 'nacl.bindings.randombytes' # <_frozen_importlib_external.SourceFileLoader object at 0x102cd55b0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/bindings/__pycache__/sodium_core.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/bindings/sodium_core.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/bindings/__pycache__/sodium_core.cpython-38.pyc'
import 'nacl.bindings.sodium_core' # <_frozen_importlib_external.SourceFileLoader object at 0x102cd56d0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/bindings/__pycache__/utils.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/bindings/utils.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/bindings/__pycache__/utils.cpython-38.pyc'
import 'nacl.bindings.utils' # <_frozen_importlib_external.SourceFileLoader object at 0x102cd5820>
import 'nacl.bindings' # <_frozen_importlib_external.SourceFileLoader object at 0x102c65f70>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/__pycache__/encoding.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/encoding.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/__pycache__/encoding.cpython-38.pyc'
import 'nacl.encoding' # <_frozen_importlib_external.SourceFileLoader object at 0x102cd57c0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/__pycache__/public.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/public.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/__pycache__/public.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/__pycache__/utils.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/utils.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/nacl/__pycache__/utils.cpython-38.pyc'
import 'nacl.utils' # <_frozen_importlib_external.SourceFileLoader object at 0x102ce79a0>
import 'nacl.public' # <_frozen_importlib_external.SourceFileLoader object at 0x102cd5af0>
import 'nacl.signing' # <_frozen_importlib_external.SourceFileLoader object at 0x102c656d0>
import 'paramiko.ed25519key' # <_frozen_importlib_external.SourceFileLoader object at 0x102c65310>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_curve25519.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/kex_curve25519.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_curve25519.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/__pycache__/constant_time.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/constant_time.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/__pycache__/constant_time.cpython-38.pyc'
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/hmac.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/hmac.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/hmac.cpython-38.pyc'
import 'hmac' # <_frozen_importlib_external.SourceFileLoader object at 0x102cee2b0>
import 'cryptography.hazmat.primitives.constant_time' # <_frozen_importlib_external.SourceFileLoader object at 0x102ce7f70>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/__pycache__/x25519.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/__pycache__/x25519.cpython-38.pyc'
import 'cryptography.hazmat.primitives.asymmetric.x25519' # <_frozen_importlib_external.SourceFileLoader object at 0x102cee220>
import 'paramiko.kex_curve25519' # <_frozen_importlib_external.SourceFileLoader object at 0x102c65df0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_gex.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/kex_gex.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_gex.cpython-38.pyc'
import 'paramiko.kex_gex' # <_frozen_importlib_external.SourceFileLoader object at 0x102ceeb80>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_group1.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/kex_group1.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_group1.cpython-38.pyc'
import 'paramiko.kex_group1' # <_frozen_importlib_external.SourceFileLoader object at 0x102ceed30>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_group14.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/kex_group14.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_group14.cpython-38.pyc'
import 'paramiko.kex_group14' # <_frozen_importlib_external.SourceFileLoader object at 0x102ceef70>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_group16.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/kex_group16.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_group16.cpython-38.pyc'
import 'paramiko.kex_group16' # <_frozen_importlib_external.SourceFileLoader object at 0x102ceedc0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_ecdh_nist.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/kex_ecdh_nist.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_ecdh_nist.cpython-38.pyc'
import 'paramiko.kex_ecdh_nist' # <_frozen_importlib_external.SourceFileLoader object at 0x102e100d0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_gss.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/kex_gss.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/kex_gss.cpython-38.pyc'
import 'paramiko.kex_gss' # <_frozen_importlib_external.SourceFileLoader object at 0x102e10490>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/packet.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/packet.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/packet.cpython-38.pyc'
import 'paramiko.packet' # <_frozen_importlib_external.SourceFileLoader object at 0x102e10a00>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/primes.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/primes.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/primes.cpython-38.pyc'
import 'paramiko.primes' # <_frozen_importlib_external.SourceFileLoader object at 0x102e22370>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/rsakey.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/rsakey.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/rsakey.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/__pycache__/padding.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/__pycache__/padding.cpython-38.pyc'
import 'cryptography.hazmat.primitives.asymmetric.padding' # <_frozen_importlib_external.SourceFileLoader object at 0x102e22c40>
import 'paramiko.rsakey' # <_frozen_importlib_external.SourceFileLoader object at 0x102e22490>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/ecdsakey.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/ecdsakey.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/ecdsakey.cpython-38.pyc'
import 'paramiko.ecdsakey' # <_frozen_importlib_external.SourceFileLoader object at 0x102e22c70>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/sftp_client.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/sftp_client.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/sftp_client.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/sftp.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/sftp.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/sftp.cpython-38.pyc'
import 'paramiko.sftp' # <_frozen_importlib_external.SourceFileLoader object at 0x102e41370>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/sftp_attr.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/sftp_attr.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/sftp_attr.cpython-38.pyc'
import 'paramiko.sftp_attr' # <_frozen_importlib_external.SourceFileLoader object at 0x102e415b0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/sftp_file.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/sftp_file.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/paramiko/__pycache__/sftp_file.cpython-38.pyc'
import 'paramiko.sftp_file' # <_frozen_importlib_external.SourceFileLoader object at 0x102e418b0>
import 'paramiko.sftp_client' # <_frozen_importlib_external.SourceFileLoader object at 0x102e31a00>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/__init__.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__init__.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/__init__.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/backend.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/backend.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/__init__.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__init__.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/__init__.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/certificate_transparency.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/certificate_transparency.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/certificate_transparency.cpython-38.pyc'
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/datetime.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/datetime.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/datetime.cpython-38.pyc'
# extension module '_datetime' loaded from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/lib-dynload/_datetime.cpython-38-darwin.so'
# extension module '_datetime' executed from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/lib-dynload/_datetime.cpython-38-darwin.so'
import '_datetime' # <_frozen_importlib_external.ExtensionFileLoader object at 0x102eb2400>
import 'datetime' # <_frozen_importlib_external.SourceFileLoader object at 0x102e82100>
import 'cryptography.x509.certificate_transparency' # <_frozen_importlib_external.SourceFileLoader object at 0x102e6cca0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/base.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/base.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/base.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/extensions.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/extensions.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/extensions.cpython-38.pyc'
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/ipaddress.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/ipaddress.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/ipaddress.cpython-38.pyc'
import 'ipaddress' # <_frozen_importlib_external.SourceFileLoader object at 0x102eac970>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/general_name.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/general_name.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/general_name.cpython-38.pyc'
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/__init__.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__init__.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/__init__.cpython-38.pyc'
import 'email' # <_frozen_importlib_external.SourceFileLoader object at 0x102f1f550>
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/utils.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/utils.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/utils.cpython-38.pyc'
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/random.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/random.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/random.cpython-38.pyc'
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/bisect.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/bisect.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/bisect.cpython-38.pyc'
# extension module '_bisect' loaded from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/lib-dynload/_bisect.cpython-38-darwin.so'
# extension module '_bisect' executed from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/lib-dynload/_bisect.cpython-38-darwin.so'
import '_bisect' # <_frozen_importlib_external.ExtensionFileLoader object at 0x102f2b970>
import 'bisect' # <_frozen_importlib_external.SourceFileLoader object at 0x102f2b730>
# extension module '_sha512' loaded from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/lib-dynload/_sha512.cpython-38-darwin.so'
# extension module '_sha512' executed from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/lib-dynload/_sha512.cpython-38-darwin.so'
import '_sha512' # <_frozen_importlib_external.ExtensionFileLoader object at 0x102f2b850>
# extension module '_random' loaded from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/lib-dynload/_random.cpython-38-darwin.so'
# extension module '_random' executed from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/lib-dynload/_random.cpython-38-darwin.so'
import '_random' # <_frozen_importlib_external.ExtensionFileLoader object at 0x102f2b910>
import 'random' # <_frozen_importlib_external.SourceFileLoader object at 0x102f1fb80>
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/urllib/__pycache__/__init__.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/urllib/__init__.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/urllib/__pycache__/__init__.cpython-38.pyc'
import 'urllib' # <_frozen_importlib_external.SourceFileLoader object at 0x102f2bb20>
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/urllib/__pycache__/parse.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/urllib/parse.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/urllib/__pycache__/parse.cpython-38.pyc'
import 'urllib.parse' # <_frozen_importlib_external.SourceFileLoader object at 0x102f2ba90>
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/_parseaddr.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/_parseaddr.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/_parseaddr.cpython-38.pyc'
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/calendar.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/calendar.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/calendar.cpython-38.pyc'
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/locale.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/locale.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/locale.cpython-38.pyc'
import 'locale' # <_frozen_importlib_external.SourceFileLoader object at 0x102f60bb0>
import 'calendar' # <_frozen_importlib_external.SourceFileLoader object at 0x102f4caf0>
import 'email._parseaddr' # <_frozen_importlib_external.SourceFileLoader object at 0x102f392b0>
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/charset.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/charset.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/charset.cpython-38.pyc'
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/base64mime.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/base64mime.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/base64mime.cpython-38.pyc'
import 'email.base64mime' # <_frozen_importlib_external.SourceFileLoader object at 0x102fa49a0>
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/quoprimime.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/quoprimime.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/quoprimime.cpython-38.pyc'
import 'email.quoprimime' # <_frozen_importlib_external.SourceFileLoader object at 0x102fa4bb0>
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/errors.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/errors.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/errors.cpython-38.pyc'
import 'email.errors' # <_frozen_importlib_external.SourceFileLoader object at 0x102fca130>
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/encoders.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/encoders.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/email/__pycache__/encoders.cpython-38.pyc'
# /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/quopri.cpython-38.pyc matches /Users/mars/.pyenv/versions/3.8.5/lib/python3.8/quopri.py
# code object from '/Users/mars/.pyenv/versions/3.8.5/lib/python3.8/__pycache__/quopri.cpython-38.pyc'
import 'quopri' # <_frozen_importlib_external.SourceFileLoader object at 0x102fcae80>
import 'email.encoders' # <_frozen_importlib_external.SourceFileLoader object at 0x102fca250>
import 'email.charset' # <_frozen_importlib_external.SourceFileLoader object at 0x102f57250>
import 'email.utils' # <_frozen_importlib_external.SourceFileLoader object at 0x102f1f6a0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/name.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/name.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/name.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/oid.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/oid.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/oid.cpython-38.pyc'
import 'cryptography.x509.oid' # <_frozen_importlib_external.SourceFileLoader object at 0x102fd8d00>
import 'cryptography.x509.name' # <_frozen_importlib_external.SourceFileLoader object at 0x102fca430>
import 'cryptography.x509.general_name' # <_frozen_importlib_external.SourceFileLoader object at 0x102f1b4f0>
import 'cryptography.x509.extensions' # <_frozen_importlib_external.SourceFileLoader object at 0x102ee5100>
import 'cryptography.x509.base' # <_frozen_importlib_external.SourceFileLoader object at 0x102e822e0>
import 'cryptography.x509' # <_frozen_importlib_external.SourceFileLoader object at 0x102e6c970>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/aead.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/aead.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/aead.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.aead' # <_frozen_importlib_external.SourceFileLoader object at 0x102e9a820>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/ciphers.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/ciphers.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/ciphers.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.ciphers' # <_frozen_importlib_external.SourceFileLoader object at 0x1030119d0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/cmac.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/cmac.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/cmac.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.cmac' # <_frozen_importlib_external.SourceFileLoader object at 0x103011a90>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/decode_asn1.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/decode_asn1.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/decode_asn1.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.decode_asn1' # <_frozen_importlib_external.SourceFileLoader object at 0x103011c70>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/dh.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/dh.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/dh.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.dh' # <_frozen_importlib_external.SourceFileLoader object at 0x10302a280>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/dsa.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/dsa.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/dsa.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/utils.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/utils.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/utils.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.utils' # <_frozen_importlib_external.SourceFileLoader object at 0x10302ab80>
import 'cryptography.hazmat.backends.openssl.dsa' # <_frozen_importlib_external.SourceFileLoader object at 0x10302a6a0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/ec.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/ec.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/ec.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.ec' # <_frozen_importlib_external.SourceFileLoader object at 0x10302ad00>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/ed25519.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/ed25519.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/ed25519.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.ed25519' # <_frozen_importlib_external.SourceFileLoader object at 0x1030423d0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/ed448.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/ed448.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/ed448.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.ed448' # <_frozen_importlib_external.SourceFileLoader object at 0x1030425b0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/encode_asn1.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/encode_asn1.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/encode_asn1.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.encode_asn1' # <_frozen_importlib_external.SourceFileLoader object at 0x103042790>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/hashes.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/hashes.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/hashes.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.hashes' # <_frozen_importlib_external.SourceFileLoader object at 0x103042df0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/hmac.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/hmac.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/hmac.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.hmac' # <_frozen_importlib_external.SourceFileLoader object at 0x103042f70>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/ocsp.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/ocsp.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/ocsp.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/x509.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/x509.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/x509.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/rsa.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/rsa.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/rsa.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.rsa' # <_frozen_importlib_external.SourceFileLoader object at 0x10306a7c0>
import 'cryptography.hazmat.backends.openssl.x509' # <_frozen_importlib_external.SourceFileLoader object at 0x1030588b0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/ocsp.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/ocsp.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/x509/__pycache__/ocsp.cpython-38.pyc'
import 'cryptography.x509.ocsp' # <_frozen_importlib_external.SourceFileLoader object at 0x102e82970>
import 'cryptography.hazmat.backends.openssl.ocsp' # <_frozen_importlib_external.SourceFileLoader object at 0x103058220>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/poly1305.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/poly1305.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/poly1305.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.poly1305' # <_frozen_importlib_external.SourceFileLoader object at 0x10308b6d0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/x25519.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/x25519.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/x25519.cpython-38.pyc'
import 'cryptography.hazmat.backends.openssl.x25519' # <_frozen_importlib_external.SourceFileLoader object at 0x10308b7f0>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/x448.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/x448.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__pycache__/x448.cpython-38.pyc'
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/__pycache__/x448.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/__pycache__/x448.cpython-38.pyc'
import 'cryptography.hazmat.primitives.asymmetric.x448' # <_frozen_importlib_external.SourceFileLoader object at 0x10308bbe0>
import 'cryptography.hazmat.backends.openssl.x448' # <_frozen_importlib_external.SourceFileLoader object at 0x10308b970>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/__pycache__/__init__.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/__init__.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/__pycache__/__init__.cpython-38.pyc'
import 'cryptography.hazmat.bindings' # <_frozen_importlib_external.SourceFileLoader object at 0x10308bf70>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/__init__.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__init__.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/__init__.cpython-38.pyc'
import 'cryptography.hazmat.bindings.openssl' # <_frozen_importlib_external.SourceFileLoader object at 0x10308bf10>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/binding.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/binding.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/binding.cpython-38.pyc'
# extension module 'cryptography.hazmat.bindings._openssl' loaded from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so'
# extension module 'cryptography.hazmat.bindings._openssl' executed from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so'
import 'cryptography.hazmat.bindings._openssl' # <_frozen_importlib_external.ExtensionFileLoader object at 0x10309b580>
# /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/_conditional.cpython-38.pyc matches /Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py
# code object from '/Users/mars/www/mobi-identpg/.venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/openssl/__pycache__/_conditional.cpython-38.pyc'
import 'cryptography.hazmat.bindings.openssl._conditional' # <_frozen_importlib_external.SourceFileLoader object at 0x10309b640>
zsh: segmentation fault  poetry run python -v -c 'import paramiko'

@beldmit
Copy link
Contributor

beldmit commented Jun 18, 2021

The only idea I currently have is that you somehow load the gost engine twice, once via the configuration file and the 2nd one from somehow else. I believe it may cause some harm.

@levitte
Copy link
Contributor

levitte commented Sep 13, 2021

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_pthread.dylib             0x00007fff203adb7b pthread_rwlock_wrlock + 0
1   libcrypto.1.1.dylib                 0x000000010f09ddc9 CRYPTO_THREAD_write_lock + 9
2   libcrypto.1.1.dylib                 0x000000010f01d9ac engine_table_register + 52
3   libcrypto.1.1.dylib                 0x000000010f01e260 ENGINE_register_ciphers + 75
4   gost.1.1.dylib                      0x000000010fe086f4 bind_gost + 471 (gost_eng.c:348) [inlined]
5   gost.1.1.dylib                      0x000000010fe086f4 bind_engine + 580 (gost_eng.c:376)
6   _openssl.abi3.so                    0x000000010fa5d3c8 dynamic_load + 728
7   _openssl.abi3.so                    0x000000010fa5ce22 dynamic_ctrl + 658
8   _openssl.abi3.so                    0x000000010fa5bf86 ENGINE_ctrl + 502
9   _openssl.abi3.so                    0x000000010fa5c6f7 ENGINE_ctrl_cmd_string + 503
10  _openssl.abi3.so                    0x000000010fa5b9b3 int_engine_configure + 451
11  _openssl.abi3.so                    0x000000010fa5b706 int_engine_module_init + 182
12  _openssl.abi3.so                    0x000000010f9ca95d module_init + 237
13  _openssl.abi3.so                    0x000000010f9c9aaf module_run + 223
14  _openssl.abi3.so                    0x000000010f9c9927 CONF_modules_load + 295
15  _openssl.abi3.so                    0x000000010f9c9c70 CONF_modules_load_file + 224
16  _openssl.abi3.so                    0x000000010f9cac7f openssl_config_int + 223
17  _openssl.abi3.so                    0x000000010fa97b34 ossl_init_config + 20
18  _openssl.abi3.so                    0x000000010fa97749 ossl_init_config_ossl_ + 9
19  libsystem_pthread.dylib             0x00007fff203ad1e1 __pthread_once_handler + 65
20  libsystem_platform.dylib            0x00007fff203f35c6 _os_once_callout + 18
21  libsystem_pthread.dylib             0x00007fff203ad18f pthread_once + 74
22  _openssl.abi3.so                    0x000000010fb2334d CRYPTO_THREAD_run_once + 29
23  _openssl.abi3.so                    0x000000010fa9723a OPENSSL_init_crypto + 1210
24  _openssl.abi3.so                    0x000000010fb8a6fe OPENSSL_init_ssl + 158
...

Those are two different openssl. _openssl.abi3.so and libcrypto.1.1.dylib... I guess the python module is linked with one while gost is linked with the other. Among others, this means that the gost engine doesn't register itself with the calling openssl, as can be seen in this trace, and thusly stays invisible to python.

Exactly why the locking call crashes, I don't know. Probably because it's not properly initialised in libcrypto.1.1.dylib...

@levitte
Copy link
Contributor

levitte commented Sep 13, 2021

Exactly why the locking call crashes, I don't know. Probably because it's not properly initialised in libcrypto.1.1.dylib...

Yup, that's it. There's a global engine lock, which is initialized as part of initialization, and assumed to be initialized by ENGINE_register_ciphers() and the functions down from there. But since it was initialized by another OpenSSL library, it remains NULL with libcrypto.1.1.dylib, hence the crash.

However, even if that crash was fixed per se, the problem remains the same, gost is linked with a different openssl library than the one that called it, and that simply doesn't work.
(this is, incidently, one of those things that the new provider interface tries to solve)

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

No branches or pull requests

3 participants