diff options
-rw-r--r-- | cryptography/hazmat/bindings/openssl/binding.py | 1 | ||||
-rw-r--r-- | cryptography/hazmat/primitives/constant_time.py | 4 | ||||
-rw-r--r-- | cryptography/hazmat/primitives/padding.py | 4 | ||||
-rw-r--r-- | setup.py | 20 |
4 files changed, 27 insertions, 2 deletions
diff --git a/cryptography/hazmat/bindings/openssl/binding.py b/cryptography/hazmat/bindings/openssl/binding.py index 8b5e3449..ccda368e 100644 --- a/cryptography/hazmat/bindings/openssl/binding.py +++ b/cryptography/hazmat/bindings/openssl/binding.py @@ -135,6 +135,7 @@ class Binding(object): customizations ), libraries=["crypto", "ssl"], + ext_package="cryptography", ) for name in cls._modules: diff --git a/cryptography/hazmat/primitives/constant_time.py b/cryptography/hazmat/primitives/constant_time.py index 6502803e..c3d81221 100644 --- a/cryptography/hazmat/primitives/constant_time.py +++ b/cryptography/hazmat/primitives/constant_time.py @@ -42,7 +42,9 @@ uint8_t Cryptography_constant_time_bytes_eq(uint8_t *a, size_t len_a, /* Now check the low bit to see if it's set */ return (mismatch & 1) == 0; } -""") +""", + ext_package="cryptography", +) def bytes_eq(a, b): diff --git a/cryptography/hazmat/primitives/padding.py b/cryptography/hazmat/primitives/padding.py index e517dee0..7c5271cb 100644 --- a/cryptography/hazmat/primitives/padding.py +++ b/cryptography/hazmat/primitives/padding.py @@ -59,7 +59,9 @@ uint8_t Cryptography_check_pkcs7_padding(const uint8_t *data, /* Now check the low bit to see if it's set */ return (mismatch & 1) == 0; } -""") +""", + ext_package="cryptography", +) class PKCS7(object): @@ -10,6 +10,8 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. +from distutils.command.build import build + from setuptools import setup, find_packages @@ -30,6 +32,20 @@ setup_requires = [ CFFI_DEPENDENCY, ] + +class cffi_build(build): + def finalize_options(self): + from cryptography.hazmat.bindings.openssl.binding import Binding + from cryptography.hazmat.primitives import constant_time, padding + + self.distribution.ext_modules = [ + Binding().ffi.verifier.get_extension(), + constant_time._ffi.verifier.get_extension(), + padding._ffi.verifier.get_extension() + ] + build.finalize_options(self) + + setup( name=about["__title__"], version=about["__version__"], @@ -70,4 +86,8 @@ setup( # for cffi zip_safe=False, + ext_package="cryptography", + cmdclass={ + "build": cffi_build, + } ) |