summaryrefslogtreecommitdiff
path: root/lang/rust/files/patch-vendor_openssl-sys_src_crypto.rs
blob: 0a4f3adbf70522eed4f4ce15962d7fd536cf1232 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- vendor/openssl-sys/src/crypto.rs.orig	2019-05-13 21:50:35 UTC
+++ vendor/openssl-sys/src/crypto.rs
@@ -15,7 +15,13 @@ cfg_if! {
     if #[cfg(ossl110)] {
         pub const CRYPTO_EX_INDEX_SSL: c_int = 0;
         pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 1;
-
+    } else if #[cfg(libressl)] {
+        pub const CRYPTO_EX_INDEX_SSL: c_int = 1;
+        pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 2;
+    }
+}
+cfg_if! {
+    if #[cfg(any(ossl110, libressl271))] {
         extern "C" {
             pub fn OpenSSL_version_num() -> c_ulong;
             pub fn OpenSSL_version(key: c_int) -> *const c_char;
@@ -64,7 +70,7 @@ pub type CRYPTO_EX_free = unsafe extern "C" fn(
     argp: *mut c_void,
 );
 extern "C" {
-    #[cfg(ossl110)]
+    #[cfg(any(ossl110, libressl))]
     pub fn CRYPTO_get_ex_new_index(
         class_index: c_int,
         argl: c_long,