Commit 2c7f0e76 authored by Andy Gauge's avatar Andy Gauge
Browse files

Merge branch 'master' of https://github.com/sfackler/rust-openssl

parents de18ccf5 44a000f3
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -78,9 +78,9 @@ openssl_101: &OPENSSL_101
libressl_250: &LIBRESSL_250
  LIBRARY: libressl
  VERSION: 2.5.0
libressl_261: &LIBRESSL_261
libressl_261: &LIBRESSL_262
  LIBRARY: libressl
  VERSION: 2.6.1
  VERSION: 2.6.2

x86_64: &X86_64
  TARGET: x86_64-unknown-linux-gnu
@@ -139,10 +139,10 @@ jobs:
    <<: *JOB
    environment:
      <<: [*LIBRESSL_250, *X86_64, *BASE]
  x86_64-libressl-2.6.1:
  x86_64-libressl-2.6.2:
    <<: *JOB
    environment:
      <<: [*LIBRESSL_261, *X86_64, *BASE]
      <<: [*LIBRESSL_262, *X86_64, *BASE]
workflows:
  version: 2
  tests:
@@ -157,4 +157,4 @@ workflows:
    - armhf-openssl-1.0.2
    - armhf-openssl-1.0.1
    - x86_64-libressl-2.5.0
    - x86_64-libressl-2.6.1
    - x86_64-libressl-2.6.2
+10 −1
Original line number Diff line number Diff line
@@ -316,8 +316,10 @@ fn validate_headers(include_dirs: &[PathBuf]) -> Version {
#include <openssl/opensslv.h>
#include <openssl/opensslconf.h>

#if LIBRESSL_VERSION_NUMBER >= 0x20602000
#if LIBRESSL_VERSION_NUMBER >= 0x20603000
RUST_LIBRESSL_NEW
#elif LIBRESSL_VERSION_NUMBER >= 0x20602000
RUST_LIBRESSL_262
#elif LIBRESSL_VERSION_NUMBER >= 0x20601000
RUST_LIBRESSL_261
#elif LIBRESSL_VERSION_NUMBER >= 0x20600000
@@ -466,6 +468,13 @@ See rust-openssl README for more information:
        println!("cargo:libressl_version=261");
        println!("cargo:version=101");
        Version::Libressl
    } else if expanded.contains("RUST_LIBRESSL_262") {
        println!("cargo:rustc-cfg=libressl");
        println!("cargo:rustc-cfg=libressl262");
        println!("cargo:libressl=true");
        println!("cargo:libressl_version=262");
        println!("cargo:version=101");
        Version::Libressl
    } else if expanded.contains("RUST_OPENSSL_110F") {
        println!("cargo:rustc-cfg=ossl110");
        println!("cargo:rustc-cfg=ossl110f");
+4 −4
Original line number Diff line number Diff line
@@ -1250,14 +1250,14 @@ pub const SSL_VERIFY_NONE: c_int = 0;
pub const SSL_VERIFY_PEER: c_int = 1;
pub const SSL_VERIFY_FAIL_IF_NO_PEER_CERT: c_int = 2;

#[cfg(not(any(libressl261, ossl101)))]
#[cfg(not(any(libressl261, libressl262, ossl101)))]
pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x00000010;
#[cfg(libressl261)]
#[cfg(any(libressl261, libressl262))]
pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x0;
pub const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: c_ulong = 0x00000800;
#[cfg(not(libressl261))]
#[cfg(not(any(libressl261, libressl262)))]
pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x80000000;
#[cfg(libressl261)]
#[cfg(any(libressl261, libressl262))]
pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x0;
pub const SSL_OP_LEGACY_SERVER_CONNECT: c_ulong = 0x00000004;
#[cfg(not(libressl))]
+4 −4
Original line number Diff line number Diff line
@@ -345,9 +345,9 @@ pub const SSL_CTRL_OPTIONS: c_int = 32;
pub const SSL_CTRL_CLEAR_OPTIONS: c_int = 77;
pub const SSL_CTRL_SET_ECDH_AUTO: c_int = 94;

#[cfg(libressl261)]
#[cfg(any(libressl261, libressl262))]
pub const SSL_OP_ALL: c_ulong = 0x4;
#[cfg(not(libressl261))]
#[cfg(not(any(libressl261, libressl262)))]
pub const SSL_OP_ALL: c_ulong = 0x80000014;
pub const SSL_OP_CISCO_ANYCONNECT: c_ulong = 0x0;
pub const SSL_OP_NO_COMPRESSION: c_ulong = 0x0;
@@ -360,9 +360,9 @@ pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: c_ulong = 0x0;
pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: c_ulong = 0x0;
pub const SSL_OP_TLS_D5_BUG: c_ulong = 0x0;
pub const SSL_OP_TLS_BLOCK_PADDING_BUG: c_ulong = 0x0;
#[cfg(libressl261)]
#[cfg(any(libressl261, libressl262))]
pub const SSL_OP_SINGLE_ECDH_USE: c_ulong = 0x0;
#[cfg(not(libressl261))]
#[cfg(not(any(libressl261, libressl262)))]
pub const SSL_OP_SINGLE_ECDH_USE: c_ulong = 0x00080000;
pub const SSL_OP_SINGLE_DH_USE: c_ulong = 0x00100000;
pub const SSL_OP_NO_SSLv2: c_ulong = 0x0;
+7 −7
Original line number Diff line number Diff line
@@ -63,11 +63,11 @@ foreign_type! {
impl fmt::Display for Asn1GeneralizedTimeRef {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        unsafe {
            let mem_bio = try!(MemBio::new());
            try!(cvt(ffi::ASN1_GENERALIZEDTIME_print(
            let mem_bio = MemBio::new()?;
            cvt(ffi::ASN1_GENERALIZEDTIME_print(
                mem_bio.as_ptr(),
                self.as_ptr(),
            )));
            ))?;
            write!(f, "{}", str::from_utf8_unchecked(mem_bio.get_buf()))
        }
    }
@@ -96,8 +96,8 @@ foreign_type! {
impl fmt::Display for Asn1TimeRef {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        unsafe {
            let mem_bio = try!(MemBio::new());
            try!(cvt(ffi::ASN1_TIME_print(mem_bio.as_ptr(), self.as_ptr())));
            let mem_bio = MemBio::new()?;
            cvt(ffi::ASN1_TIME_print(mem_bio.as_ptr(), self.as_ptr()))?;
            write!(f, "{}", str::from_utf8_unchecked(mem_bio.get_buf()))
        }
    }
@@ -108,7 +108,7 @@ impl Asn1Time {
        ffi::init();

        unsafe {
            let handle = try!(cvt_p(ffi::X509_gmtime_adj(ptr::null_mut(), period)));
            let handle = cvt_p(ffi::X509_gmtime_adj(ptr::null_mut(), period))?;
            Ok(Asn1Time::from_ptr(handle))
        }
    }
@@ -279,7 +279,7 @@ impl fmt::Display for Asn1ObjectRef {
                self.as_ptr(),
                0,
            );
            let s = try!(str::from_utf8(&buf[..len as usize]).map_err(|_| fmt::Error));
            let s = str::from_utf8(&buf[..len as usize]).map_err(|_| fmt::Error)?;
            fmt.write_str(s)
        }
    }
Loading