Skip to content

Commit

Permalink
missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
aviramha committed Jul 11, 2024
1 parent cc085af commit 7062633
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions mirrord/layer/src/tls.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use libc::c_void;
use mirrord_layer_macro::hook_guard_fn;

use crate::{hooks::HookManager, replace};

// https://developer.apple.com/documentation/security/2980705-sectrustevaluatewitherror
#[hook_guard_fn]
pub(crate) unsafe extern "C" fn sec_trust_evaluate_with_error_detour(
trust: *const c_void,
error: *const c_void,
) -> bool {
tracing::trace!("sec_trust_evaluate_with_error_detour called");
true
}

pub(crate) unsafe fn enable_tls_hooks(hook_manager: &mut HookManager) {
replace!(
hook_manager,
"SecTrustEvaluateWithError",
sec_trust_evaluate_with_error_detour,
FnSec_trust_evaluate_with_error,
FN_SEC_TRUST_EVALUATE_WITH_ERROR
);
}

0 comments on commit 7062633

Please sign in to comment.