Merge branch 'master' into setup-install-extension

Conflicts:
	setup.py
diff --git a/cryptography/hazmat/bindings/openssl/binding.py b/cryptography/hazmat/bindings/openssl/binding.py
index 8b5e344..ccda368 100644
--- a/cryptography/hazmat/bindings/openssl/binding.py
+++ b/cryptography/hazmat/bindings/openssl/binding.py
@@ -135,6 +135,7 @@
                 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 6502803..e88a0d9 100644
--- a/cryptography/hazmat/primitives/constant_time.py
+++ b/cryptography/hazmat/primitives/constant_time.py
@@ -23,7 +23,8 @@
 uint8_t Cryptography_constant_time_bytes_eq(uint8_t *, size_t, uint8_t *,
                                             size_t);
 """)
-_lib = _ffi.verify("""
+_lib = _ffi.verify(
+    """
 uint8_t Cryptography_constant_time_bytes_eq(uint8_t *a, size_t len_a,
                                             uint8_t *b, size_t len_b) {
     size_t i = 0;
@@ -42,7 +43,9 @@
     /* 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 e517dee..ddb2c63 100644
--- a/cryptography/hazmat/primitives/padding.py
+++ b/cryptography/hazmat/primitives/padding.py
@@ -23,7 +23,8 @@
 _ffi.cdef("""
 uint8_t Cryptography_check_pkcs7_padding(const uint8_t *, uint8_t);
 """)
-_lib = _ffi.verify("""
+_lib = _ffi.verify(
+    """
 /* Returns the value of the input with the most-significant-bit copied to all
    of the bits. */
 static uint8_t Cryptography_DUPLICATE_MSB_TO_ALL(uint8_t a) {
@@ -59,7 +60,9 @@
     /* Now check the low bit to see if it's set */
     return (mismatch & 1) == 0;
 }
-""")
+""",
+    ext_package="cryptography",
+)
 
 
 class PKCS7(object):
diff --git a/setup.py b/setup.py
index 3202f84..fe37d9f 100644
--- a/setup.py
+++ b/setup.py
@@ -11,6 +11,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 import os
+from distutils.command.build import build
 
 from setuptools import setup, find_packages
 
@@ -25,14 +26,24 @@
 CFFI_DEPENDENCY = "cffi>=0.6"
 SIX_DEPENDENCY = "six>=1.4.1"
 
-install_requires = [
+requirements = [
     CFFI_DEPENDENCY,
     SIX_DEPENDENCY
 ]
 
-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)
+
 
 with open(os.path.join(base_dir, "README.rst")) as f:
     long_description = f.read()
@@ -74,9 +85,13 @@
 
     packages=find_packages(exclude=["tests", "tests.*"]),
 
-    install_requires=install_requires,
-    setup_requires=setup_requires,
+    install_requires=requirements,
+    setup_requires=requirements,
 
     # for cffi
     zip_safe=False,
+    ext_package="cryptography",
+    cmdclass={
+        "build": cffi_build,
+    }
 )