Skip to content

Commit 730aaed

Browse files
authored
Merge pull request #2093 from alex/chacha20
Expose ChaCha20 on LibreSSL
2 parents f89c20b + 5989092 commit 730aaed

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
@@ -370,7 +370,7 @@ extern "C" {
370370
pub fn EVP_aes_256_wrap() -> *const EVP_CIPHER;
371371
#[cfg(ossl110)]
372372
pub fn EVP_aes_256_wrap_pad() -> *const EVP_CIPHER;
373-
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
373+
#[cfg(all(any(ossl110, libressl310), not(osslconf = "OPENSSL_NO_CHACHA")))]
374374
pub fn EVP_chacha20() -> *const EVP_CIPHER;
375375
#[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
376376
pub fn EVP_chacha20_poly1305() -> *const EVP_CIPHER;

openssl/src/cipher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ impl Cipher {
453453
unsafe { CipherRef::from_ptr(ffi::EVP_idea_cbc() as *mut _) }
454454
}
455455

456-
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
456+
#[cfg(all(any(ossl110, libressl310), not(osslconf = "OPENSSL_NO_CHACHA")))]
457457
pub fn chacha20() -> &'static CipherRef {
458458
unsafe { CipherRef::from_ptr(ffi::EVP_chacha20() as *mut _) }
459459
}

openssl/src/symm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl Cipher {
383383
}
384384

385385
/// Requires OpenSSL 1.1.0 or newer.
386-
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
386+
#[cfg(all(any(ossl110, libressl310), not(osslconf = "OPENSSL_NO_CHACHA")))]
387387
pub fn chacha20() -> Cipher {
388388
unsafe { Cipher(ffi::EVP_chacha20()) }
389389
}
@@ -1592,7 +1592,7 @@ mod tests {
15921592
}
15931593

15941594
#[test]
1595-
#[cfg(ossl110)]
1595+
#[cfg(any(ossl110, libressl310))]
15961596
fn test_chacha20() {
15971597
let key = "0000000000000000000000000000000000000000000000000000000000000000";
15981598
let iv = "00000000000000000000000000000000";

0 commit comments

Comments
 (0)