aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-11-14 14:34:16 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-11-14 14:34:16 -0800
commit5ee8ce0e4d4480a0c6b9823f9909cd1c17b53ec7 (patch)
tree8226cf7d723b126ae1c0874eff6c45265044944d /src
parentaf3d95fdf57e42a1bacb4cd66b58b5b5701d094c (diff)
parentc4bbc8b84eadaef703af642c1c7ba13e21ec8086 (diff)
downloadcryptography-5ee8ce0e4d4480a0c6b9823f9909cd1c17b53ec7.tar.gz
cryptography-5ee8ce0e4d4480a0c6b9823f9909cd1c17b53ec7.tar.bz2
cryptography-5ee8ce0e4d4480a0c6b9823f9909cd1c17b53ec7.zip
Merge pull request #1474 from dstufft/disable-implicit-compile
Monkeypatch the CFFI Verifier to prevent the implicit compile
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/bindings/utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/bindings/utils.py b/src/cryptography/hazmat/bindings/utils.py
index 55b61292..ca2d91ae 100644
--- a/src/cryptography/hazmat/bindings/utils.py
+++ b/src/cryptography/hazmat/bindings/utils.py
@@ -124,9 +124,20 @@ def build_ffi(cdef_source, verify_source, libraries=[], extra_compile_args=[],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)
+
+ ffi.verifier.compile_module = _compile_module
+ ffi.verifier._compile_module = _compile_module
+
return ffi
+def _compile_module(*args, **kwargs):
+ raise RuntimeError(
+ "Attempted implicit compile of a cffi module. All cffi modules should "
+ "be pre-compiled at installation time."
+ )
+
+
def _create_modulename(cdef_sources, source, sys_version):
"""
cffi creates a modulename internally that incorporates the cffi version.