Skip to content

Commit b16d6e0

Browse files
committed
Works under old crypto API
macOS before 10.7 requires to use OpenSSL because a lot of things is missed.
1 parent c8524fd commit b16d6e0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

vendor/crypto-hash/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ license = "MIT"
2323
repository = "https://github.com/malept/crypto-hash"
2424
[dependencies.hex]
2525
version = "0.3"
26-
[target."cfg(not(any(target_os = \"windows\", target_os = \"macos\")))".dependencies.openssl]
26+
[target."cfg(not(any(target_os = \"windows\", all(target_os = \"macos\", not(feature = \"macos_before_10_7\")))))".dependencies.openssl]
2727
version = "0.10"
28-
[target."cfg(target_os = \"macos\")".dependencies.commoncrypto]
28+
[target."cfg(all(target_os = \"macos\", not(feature = \"macos_before_10_7\")))".dependencies.commoncrypto]
2929
version = "0.2"
3030
[target."cfg(target_os = \"windows\")".dependencies.winapi]
3131
version = "0.3"

vendor/crypto-hash/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
4444
#![warn(missing_docs)]
4545

46-
#[cfg(target_os = "macos")]
46+
#[cfg(all(target_os = "macos", not(feature = "macos_before_10_7")))]
4747
extern crate commoncrypto;
4848
extern crate hex;
4949
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
@@ -53,13 +53,13 @@ extern crate winapi;
5353

5454
use std::io::Write;
5555

56-
#[cfg(target_os = "macos")]
56+
#[cfg(all(target_os = "macos", not(feature = "macos_before_10_7")))]
5757
#[path = "imp/commoncrypto.rs"]
5858
mod imp;
5959
#[cfg(target_os = "windows")]
6060
#[path = "imp/cryptoapi.rs"]
6161
mod imp;
62-
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
62+
#[cfg(not(any(all(target_os = "macos", not(feature = "macos_before_10_7")), target_os = "windows")))]
6363
#[path = "imp/openssl.rs"]
6464
mod imp;
6565

vendor/libgit2-sys/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ fn main() {
132132

133133
if windows {
134134
features.push_str("#define GIT_WINHTTP 1\n");
135+
#[cfg(not(feature = "macos_before_10_7"))]
135136
} else if target.contains("apple") {
136137
features.push_str("#define GIT_SECURE_TRANSPORT 1\n");
137138
} else {

0 commit comments

Comments
 (0)