diff options
Diffstat (limited to 'src/_cffi_src')
-rw-r--r-- | src/_cffi_src/build_constant_time.py | 6 | ||||
-rw-r--r-- | src/_cffi_src/build_openssl.py | 7 | ||||
-rw-r--r-- | src/_cffi_src/build_padding.py | 6 | ||||
-rw-r--r-- | src/_cffi_src/openssl/x509.py | 16 | ||||
-rw-r--r-- | src/_cffi_src/openssl/x509_vfy.py | 6 | ||||
-rw-r--r-- | src/_cffi_src/utils.py | 9 |
6 files changed, 34 insertions, 16 deletions
diff --git a/src/_cffi_src/build_constant_time.py b/src/_cffi_src/build_constant_time.py index eae0f21a..6d9a8f54 100644 --- a/src/_cffi_src/build_constant_time.py +++ b/src/_cffi_src/build_constant_time.py @@ -5,8 +5,9 @@ from __future__ import absolute_import, division, print_function import os +import sys -from _cffi_src.utils import build_ffi +from _cffi_src.utils import build_ffi, extra_link_args with open(os.path.join( @@ -22,5 +23,6 @@ with open(os.path.join( ffi = build_ffi( module_name="_constant_time", cdef_source=types, - verify_source=functions + verify_source=functions, + extra_link_args=extra_link_args(sys.platform), ) diff --git a/src/_cffi_src/build_openssl.py b/src/_cffi_src/build_openssl.py index 4c30fe48..1ebadccb 100644 --- a/src/_cffi_src/build_openssl.py +++ b/src/_cffi_src/build_openssl.py @@ -7,9 +7,7 @@ from __future__ import absolute_import, division, print_function import os import sys -from _cffi_src.utils import ( - build_ffi_for_binding -) +from _cffi_src.utils import build_ffi_for_binding, extra_link_args def _get_openssl_libraries(platform): @@ -94,5 +92,6 @@ ffi = build_ffi_for_binding( ], pre_include=_OSX_PRE_INCLUDE, post_include=_OSX_POST_INCLUDE, - libraries=_get_openssl_libraries(sys.platform) + libraries=_get_openssl_libraries(sys.platform), + extra_link_args=extra_link_args(sys.platform), ) diff --git a/src/_cffi_src/build_padding.py b/src/_cffi_src/build_padding.py index 3eeac2e2..5df93d80 100644 --- a/src/_cffi_src/build_padding.py +++ b/src/_cffi_src/build_padding.py @@ -5,8 +5,9 @@ from __future__ import absolute_import, division, print_function import os +import sys -from _cffi_src.utils import build_ffi +from _cffi_src.utils import build_ffi, extra_link_args with open(os.path.join( @@ -22,5 +23,6 @@ with open(os.path.join( ffi = build_ffi( module_name="_padding", cdef_source=types, - verify_source=functions + verify_source=functions, + extra_link_args=extra_link_args(sys.platform), ) diff --git a/src/_cffi_src/openssl/x509.py b/src/_cffi_src/openssl/x509.py index 534f5b08..6bd117b0 100644 --- a/src/_cffi_src/openssl/x509.py +++ b/src/_cffi_src/openssl/x509.py @@ -182,19 +182,21 @@ X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *, int); int X509_REVOKED_add_ext(X509_REVOKED *, X509_EXTENSION*, int); int X509_REVOKED_add1_ext_i2d(X509_REVOKED *, int, void *, int, unsigned long); -X509_CRL *d2i_X509_CRL_bio(BIO *, X509_CRL **); X509_CRL *X509_CRL_new(void); -void X509_CRL_free(X509_CRL *); +X509_CRL *d2i_X509_CRL_bio(BIO *, X509_CRL **); +X509_EXTENSION *X509_CRL_get_ext(X509_CRL *, int); int X509_CRL_add0_revoked(X509_CRL *, X509_REVOKED *); -int i2d_X509_CRL_bio(BIO *, X509_CRL *); +int X509_CRL_add_ext(X509_CRL *, X509_EXTENSION *, int); +int X509_CRL_cmp(const X509_CRL *, const X509_CRL *); +int X509_CRL_get_ext_count(X509_CRL *); int X509_CRL_print(BIO *, X509_CRL *); int X509_CRL_set_issuer_name(X509_CRL *, X509_NAME *); +int X509_CRL_set_version(X509_CRL *, long); int X509_CRL_sign(X509_CRL *, EVP_PKEY *, const EVP_MD *); +int X509_CRL_sort(X509_CRL *); int X509_CRL_verify(X509_CRL *, EVP_PKEY *); -int X509_CRL_get_ext_count(X509_CRL *); -X509_EXTENSION *X509_CRL_get_ext(X509_CRL *, int); -int X509_CRL_add_ext(X509_CRL *, X509_EXTENSION *, int); -int X509_CRL_cmp(const X509_CRL *, const X509_CRL *); +int i2d_X509_CRL_bio(BIO *, X509_CRL *); +void X509_CRL_free(X509_CRL *); int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *, EVP_PKEY *); int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *, EVP_PKEY *, const EVP_MD *); diff --git a/src/_cffi_src/openssl/x509_vfy.py b/src/_cffi_src/openssl/x509_vfy.py index 02631409..23ac8483 100644 --- a/src/_cffi_src/openssl/x509_vfy.py +++ b/src/_cffi_src/openssl/x509_vfy.py @@ -143,10 +143,14 @@ int X509_verify_cert(X509_STORE_CTX *); /* X509_STORE */ X509_STORE *X509_STORE_new(void); -void X509_STORE_free(X509_STORE *); int X509_STORE_add_cert(X509_STORE *, X509 *); +int X509_STORE_add_crl(X509_STORE *, X509_CRL *); int X509_STORE_load_locations(X509_STORE *, const char *, const char *); +int X509_STORE_set1_param(X509_STORE *, X509_VERIFY_PARAM *); int X509_STORE_set_default_paths(X509_STORE *); +int X509_STORE_set_flags(X509_STORE *, unsigned long); +void X509_STORE_free(X509_STORE *); + /* X509_STORE_CTX */ X509_STORE_CTX *X509_STORE_CTX_new(void); diff --git a/src/_cffi_src/utils.py b/src/_cffi_src/utils.py index b1ad74d4..65f9f120 100644 --- a/src/_cffi_src/utils.py +++ b/src/_cffi_src/utils.py @@ -80,3 +80,12 @@ def build_ffi(module_name, cdef_source, verify_source, libraries=[], extra_link_args=extra_link_args, ) return ffi + + +def extra_link_args(platform): + if platform != "win32": + return [] + else: + # Enable NX and ASLR for Windows builds. These are enabled by default + # on Python 3.3+ but not on 2.x. + return ["/NXCOMPAT", "/DYNAMICBASE"] |