diff options
author | olegts <olegts@yandex-team.ru> | 2022-02-10 16:48:22 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:22 +0300 |
commit | 30983fb2586f6904aaf6a5d6ef2b445cbaec1f44 (patch) | |
tree | 3e86334ffd140d7ccfa0aa79386a6cf51b5b1e46 /contrib/python/cryptography/_cffi_src/build_openssl.py | |
parent | 9525b12aeec0b37aae9be1712d3d1031a235118f (diff) | |
download | ydb-30983fb2586f6904aaf6a5d6ef2b445cbaec1f44.tar.gz |
Restoring authorship annotation for <olegts@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/cryptography/_cffi_src/build_openssl.py')
-rw-r--r-- | contrib/python/cryptography/_cffi_src/build_openssl.py | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/contrib/python/cryptography/_cffi_src/build_openssl.py b/contrib/python/cryptography/_cffi_src/build_openssl.py index 4380c33969..fab9119077 100644 --- a/contrib/python/cryptography/_cffi_src/build_openssl.py +++ b/contrib/python/cryptography/_cffi_src/build_openssl.py @@ -1,26 +1,26 @@ -# This file is dual licensed under the terms of the Apache License, Version -# 2.0, and the BSD License. See the LICENSE file in the root of this repository -# for complete details. - -from __future__ import absolute_import, division, print_function - -import os -import sys +# This file is dual licensed under the terms of the Apache License, Version +# 2.0, and the BSD License. See the LICENSE file in the root of this repository +# for complete details. + +from __future__ import absolute_import, division, print_function + +import os +import sys from distutils import dist from distutils.ccompiler import get_default_compiler from distutils.command.config import config - -from _cffi_src.utils import ( + +from _cffi_src.utils import ( build_ffi_for_binding, compiler_type, extra_link_args, -) - - -def _get_openssl_libraries(platform): +) + + +def _get_openssl_libraries(platform): if os.environ.get("CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS", None): return [] - # OpenSSL goes by a different library name on different operating systems. + # OpenSSL goes by a different library name on different operating systems. if platform == "win32" and compiler_type() == "msvc": return [ "libssl", @@ -31,11 +31,11 @@ def _get_openssl_libraries(platform): "user32", "ws2_32", ] - else: + else: # darwin, linux, mingw all use this path - # In some circumstances, the order in which these libs are - # specified on the linker command-line is significant; - # libssl must come before libcrypto + # In some circumstances, the order in which these libs are + # specified on the linker command-line is significant; + # libssl must come before libcrypto # (https://marc.info/?l=openssl-users&m=135361825921871) # -lpthread required due to usage of pthread an potential # existance of a static part containing e.g. pthread_atfork @@ -44,8 +44,8 @@ def _get_openssl_libraries(platform): return ["ssl", "crypto"] else: return ["ssl", "crypto", "pthread"] - - + + def _extra_compile_args(platform): """ We set -Wconversion args here so that we only do Wconversion checks on the @@ -71,51 +71,51 @@ def _extra_compile_args(platform): ): return ["-Wconversion", "-Wno-error=sign-conversion"] else: - return [] - - -ffi = build_ffi_for_binding( - module_name="_openssl", - module_prefix="_cffi_src.openssl.", - modules=[ - # This goes first so we can define some cryptography-wide symbols. - "cryptography", - "aes", - "asn1", - "bignum", - "bio", - "cmac", - "conf", - "crypto", + return [] + + +ffi = build_ffi_for_binding( + module_name="_openssl", + module_prefix="_cffi_src.openssl.", + modules=[ + # This goes first so we can define some cryptography-wide symbols. + "cryptography", + "aes", + "asn1", + "bignum", + "bio", + "cmac", + "conf", + "crypto", "ct", - "dh", - "dsa", - "ec", - "ecdh", - "ecdsa", - "engine", - "err", - "evp", + "dh", + "dsa", + "ec", + "ecdh", + "ecdsa", + "engine", + "err", + "evp", "fips", - "hmac", - "nid", - "objects", - "ocsp", - "opensslv", + "hmac", + "nid", + "objects", + "ocsp", + "opensslv", "osrandom_engine", - "pem", - "pkcs12", - "rand", - "rsa", - "ssl", - "x509", - "x509name", - "x509v3", - "x509_vfy", - "pkcs7", - "callbacks", - ], - libraries=_get_openssl_libraries(sys.platform), + "pem", + "pkcs12", + "rand", + "rsa", + "ssl", + "x509", + "x509name", + "x509v3", + "x509_vfy", + "pkcs7", + "callbacks", + ], + libraries=_get_openssl_libraries(sys.platform), extra_compile_args=_extra_compile_args(sys.platform), - extra_link_args=extra_link_args(compiler_type()), -) + extra_link_args=extra_link_args(compiler_type()), +) |