Skip to content

Commit

Permalink
Works under old crypto API
Browse files Browse the repository at this point in the history
macOS before 10.7 requires to use OpenSSL because a lot of things is
missed.
  • Loading branch information
catap committed Feb 5, 2022
1 parent 4b6f77d commit b406768
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions vendor/crypto-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ license = "MIT"
repository = "https://github.com/malept/crypto-hash"
[dependencies.hex]
version = "0.3"
[target."cfg(not(any(target_os = \"windows\", target_os = \"macos\")))".dependencies.openssl]
[target."cfg(not(any(target_os = \"windows\", all(target_os = \"macos\", not(feature = \"macos_before_10_7\")))))".dependencies.openssl]
version = "0.10"
[target."cfg(target_os = \"macos\")".dependencies.commoncrypto]
[target."cfg(all(target_os = \"macos\", not(feature = \"macos_before_10_7\")))".dependencies.commoncrypto]
version = "0.2"
[target."cfg(target_os = \"windows\")".dependencies.winapi]
version = "0.3"
Expand Down
6 changes: 3 additions & 3 deletions vendor/crypto-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

#![warn(missing_docs)]

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

use std::io::Write;

#[cfg(target_os = "macos")]
#[cfg(all(target_os = "macos", not(feature = "macos_before_10_7")))]
#[path = "imp/commoncrypto.rs"]
mod imp;
#[cfg(target_os = "windows")]
#[path = "imp/cryptoapi.rs"]
mod imp;
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
#[cfg(not(any(all(target_os = "macos", not(feature = "macos_before_10_7")), target_os = "windows")))]
#[path = "imp/openssl.rs"]
mod imp;

Expand Down
2 changes: 1 addition & 1 deletion vendor/libgit2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn main() {

if windows {
features.push_str("#define GIT_WINHTTP 1\n");
} else if target.contains("apple") {
} else if target.contains("apple") && cfg!(not(feature = "macos_before_10_7")) {
features.push_str("#define GIT_SECURE_TRANSPORT 1\n");
} else {
features.push_str("#define GIT_OPENSSL 1\n");
Expand Down

0 comments on commit b406768

Please sign in to comment.