Unverified Commit f1a564cc authored by Steven Fackler's avatar Steven Fackler Committed by GitHub
Browse files

Merge pull request #1540 from bossmc/support-no-chacha

Support OpenSSL configured with `no-chacha`
parents 8f2063d3 1581d454
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -23,6 +23,10 @@ RUST_CONF_OPENSSL_NO_BF
RUST_CONF_OPENSSL_NO_BUF_FREELISTS
#endif

#ifdef OPENSSL_NO_CHACHA
RUST_CONF_OPENSSL_NO_CHACHA
#endif

#ifdef OPENSSL_NO_CMS
RUST_CONF_OPENSSL_NO_CMS
#endif
+1 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ fn validate_headers(include_dirs: &[PathBuf]) -> Version {
    // file of OpenSSL, `opensslconf.h`, and then dump out everything it defines
    // as our own #[cfg] directives. That way the `ossl10x.rs` bindings can
    // account for compile differences and such.
    println!("cargo:rerun-if-changed=build/expando.c");
    let mut gcc = cc::Build::new();
    for include_dir in include_dirs {
        gcc.include(include_dir);
+2 −2
Original line number Diff line number Diff line
@@ -359,9 +359,9 @@ extern "C" {
    pub fn EVP_aes_256_ofb() -> *const EVP_CIPHER;
    #[cfg(ossl110)]
    pub fn EVP_aes_256_ocb() -> *const EVP_CIPHER;
    #[cfg(ossl110)]
    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
    pub fn EVP_chacha20() -> *const ::EVP_CIPHER;
    #[cfg(ossl110)]
    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
    pub fn EVP_chacha20_poly1305() -> *const ::EVP_CIPHER;
    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
    pub fn EVP_seed_cbc() -> *const EVP_CIPHER;
+2 −2
Original line number Diff line number Diff line
@@ -279,13 +279,13 @@ impl Cipher {
    }

    /// Requires OpenSSL 1.1.0 or newer.
    #[cfg(any(ossl110))]
    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
    pub fn chacha20() -> Cipher {
        unsafe { Cipher(ffi::EVP_chacha20()) }
    }

    /// Requires OpenSSL 1.1.0 or newer.
    #[cfg(any(ossl110))]
    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
    pub fn chacha20_poly1305() -> Cipher {
        unsafe { Cipher(ffi::EVP_chacha20_poly1305()) }
    }