diff options
| author | Andrew Roetker <[email protected]> | 2017-04-11 15:42:05 -0700 |
|---|---|---|
| committer | Andrew Roetker <[email protected]> | 2017-04-11 15:42:05 -0700 |
| commit | b21046375a0071717f22ea4a81ce37bfdd46da1d (patch) | |
| tree | ceec24e04e0c02d4e6d66c8b49f314270f32ac05 | |
| parent | Merge pull request #613 from aosmond/add_evp_pkey_derive (diff) | |
| download | rust-openssl-b21046375a0071717f22ea4a81ce37bfdd46da1d.tar.xz rust-openssl-b21046375a0071717f22ea4a81ce37bfdd46da1d.zip | |
(issues-600) Avoid compiling ec2m code against no-ec2m openssl
This commit avoids defining code that leads to undefined references when
compiling against an openssl built with no-ec2m.
| -rw-r--r-- | openssl-sys/build.rs | 1 | ||||
| -rw-r--r-- | openssl-sys/src/lib.rs | 3 | ||||
| -rw-r--r-- | openssl/src/ec.rs | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/openssl-sys/build.rs b/openssl-sys/build.rs index 340faf08..5448d48e 100644 --- a/openssl-sys/build.rs +++ b/openssl-sys/build.rs @@ -15,6 +15,7 @@ const DEFINES: &'static [&'static str] = &[ "OPENSSL_NO_BUF_FREELISTS", "OPENSSL_NO_COMP", "OPENSSL_NO_EC", + "OPENSSL_NO_EC2M", "OPENSSL_NO_ENGINE", "OPENSSL_NO_KRB5", "OPENSSL_NO_NEXTPROTONEG", diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index f7c50822..a01e33fe 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -1521,13 +1521,16 @@ extern { pub fn EC_KEY_check_key(key: *const EC_KEY) -> c_int; pub fn EC_KEY_free(key: *mut EC_KEY); + #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))] pub fn EC_GF2m_simple_method() -> *const EC_METHOD; pub fn EC_GROUP_new(meth: *const EC_METHOD) -> *mut EC_GROUP; pub fn EC_GROUP_new_curve_GFp(p: *const BIGNUM, a: *const BIGNUM, b: *const BIGNUM, ctx: *mut BN_CTX) -> *mut EC_GROUP; + #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))] pub fn EC_GROUP_new_curve_GF2m(p: *const BIGNUM, a: *const BIGNUM, b: *const BIGNUM, ctx: *mut BN_CTX) -> *mut EC_GROUP; pub fn EC_GROUP_new_by_curve_name(nid: c_int) -> *mut EC_GROUP; pub fn EC_GROUP_get_curve_GFp(group: *const EC_GROUP, p: *mut BIGNUM, a: *mut BIGNUM, b: *mut BIGNUM, ctx: *mut BN_CTX) -> c_int; + #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))] pub fn EC_GROUP_get_curve_GF2m(group: *const EC_GROUP, p: *mut BIGNUM, a: *mut BIGNUM, b: *mut BIGNUM, ctx: *mut BN_CTX) -> c_int; pub fn EC_GROUP_get_degree(group: *const EC_GROUP) -> c_int; pub fn EC_GROUP_get_order(group: *const EC_GROUP, order: *mut BIGNUM, ctx: *mut BN_CTX) -> c_int; diff --git a/openssl/src/ec.rs b/openssl/src/ec.rs index 33c15569..122dd7f2 100644 --- a/openssl/src/ec.rs +++ b/openssl/src/ec.rs @@ -66,6 +66,7 @@ impl EcGroupRef { } /// Places the components of a curve over a binary field in the provided `BigNum`s. + #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))] pub fn components_gf2m(&self, p: &mut BigNumRef, a: &mut BigNumRef, |