Skip to content

Commit 99ea8a8

Browse files
authored
Merge pull request sfackler#2011 from alex/chacha20poly1305-libressl
Expose chacha20_poly1305 on LibreSSL
2 parents 7daab5b + ca438e2 commit 99ea8a8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

openssl-sys/src/handwritten/evp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ extern "C" {
367367
pub fn EVP_aes_256_wrap_pad() -> *const EVP_CIPHER;
368368
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
369369
pub fn EVP_chacha20() -> *const EVP_CIPHER;
370-
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
370+
#[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
371371
pub fn EVP_chacha20_poly1305() -> *const EVP_CIPHER;
372372
#[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
373373
pub fn EVP_seed_cbc() -> *const EVP_CIPHER;

openssl/src/cipher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ impl Cipher {
435435
unsafe { CipherRef::from_ptr(ffi::EVP_chacha20() as *mut _) }
436436
}
437437

438-
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
438+
#[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
439439
pub fn chacha20_poly1305() -> &'static CipherRef {
440440
unsafe { CipherRef::from_ptr(ffi::EVP_chacha20_poly1305() as *mut _) }
441441
}

openssl/src/symm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ impl Cipher {
295295
}
296296

297297
/// Requires OpenSSL 1.1.0 or newer.
298-
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
298+
#[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
299299
pub fn chacha20_poly1305() -> Cipher {
300300
unsafe { Cipher(ffi::EVP_chacha20_poly1305()) }
301301
}
@@ -1493,7 +1493,7 @@ mod tests {
14931493
}
14941494

14951495
#[test]
1496-
#[cfg(ossl110)]
1496+
#[cfg(any(ossl110, libressl360))]
14971497
fn test_chacha20_poly1305() {
14981498
let key = "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f";
14991499
let iv = "070000004041424344454647";

0 commit comments

Comments
 (0)