Skip to content

Commit

Permalink
Start Security.framework
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Nov 19, 2024
1 parent 24d17d2 commit a56a30d
Show file tree
Hide file tree
Showing 6 changed files with 374 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cidre/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ full = [
"nl",
"vt",
"sc",
"sec",
"mc",
"mtl",
"mtk",
Expand Down Expand Up @@ -101,6 +102,7 @@ nl = ["ns"]
vt = ["cf", "cv", "cg", "cm"]
io = ["cf"]
sn = ["ns"]
sec = ["cf"]
vn = ["ns"]
vdsp = []
nw = ["ns", "dispatch"]
Expand Down
3 changes: 3 additions & 0 deletions cidre/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ pub mod gc;
pub mod os;
pub mod sys;

#[cfg(feature = "sec")]
pub mod sec;

/// Video Toolbox
#[cfg(feature = "vt")]
pub mod vt;
Expand Down
6 changes: 3 additions & 3 deletions cidre/src/mc/peer_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ impl PeerId {
define_cls!(MC_PEER_ID);

#[inline]
pub fn with_display_name<'ear>(name: &ns::String) -> Result<arc::R<Self>, &'ear ns::Exception> {
pub fn with_display_name<'ear>(name: &ns::String) -> ns::ExResult<'ear, arc::R<Self>> {
ns::try_catch(|| unsafe { Self::alloc().init_with_display_name_throws(name) })
}

#[objc::msg_send(displayName)]
pub fn display_name(&self) -> &ns::String;
pub fn display_name(&self) -> arc::R<ns::String>;
}

#[link(name = "mc", kind = "static")]
Expand All @@ -35,7 +35,7 @@ mod tests {
fn basics() {
let name = ns::str!(c"test");
let peer = mc::PeerId::with_display_name(name).unwrap();
assert_eq!(peer.display_name(), name);
assert_eq!(&peer.display_name(), name);

let name = ns::str!(c"");
let _err = mc::PeerId::with_display_name(name).expect_err("should be err");
Expand Down
2 changes: 1 addition & 1 deletion cidre/src/mc/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pub trait Delegate: objc::Obj {

#[objc::optional]
#[objc::msg_send(session:didReceiveCertificate:fromPeer:certificateHandler:)]
fn session_did_receive_cert<'a>(
fn session_did_receive_cert(
&mut self,
session: &mc::Session,
cert: Option<&ns::Array<ns::Id>>,
Expand Down
2 changes: 2 additions & 0 deletions cidre/src/sec.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod base;
pub use base::*;
Loading

0 comments on commit a56a30d

Please sign in to comment.