Skip to content

Commit

Permalink
Fix SecAuthenticationType endianness
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jan 16, 2025
1 parent c7e89fd commit 0332bc6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
1 change: 0 additions & 1 deletion crates/header-translator/configs/builtin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ class.ABNewPersonViewController.methods.newPersonViewDelegate.skipped = true

# Dependent on target endianness
typedef.WideChar.skipped = true # union+typedef in CoreServices
enum.SecAuthenticationType.skipped = true # in Security
7 changes: 7 additions & 0 deletions framework-crates/objc2-security/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,10 @@ unsafe impl Encode for cssm_list_element {
unsafe impl RefEncode for cssm_list_element {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// Used by `SecAuthenticationType` for endianness-dependent constants.
#[cfg(feature = "SecKeychain")]
#[allow(non_snake_case)]
pub(crate) const fn AUTH_TYPE_FIX_(code: FourCharCode) -> FourCharCode {
FourCharCode::from_be(code)
}
6 changes: 0 additions & 6 deletions framework-crates/objc2-security/translation-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ static.oidSubjectAltName.skipped = true
static.oidSubjectInfoAccess.skipped = true
static.oidSubjectKeyIdentifier.skipped = true

# `AUTH_TYPE_FIX_` macro in definition
enum.SecAuthenticationType.use-value = true
enum.anonymous.constants.CSSM_EVIDENCE_FORM_APPLE_HEADER.use-value = true
enum.anonymous.constants.CSSM_EVIDENCE_FORM_APPLE_CERTGROUP.use-value = true
enum.anonymous.constants.CSSM_EVIDENCE_FORM_APPLE_CERT_INFO.use-value = true

# References parent enum SecuritySessionId, which is hard to handle
enum.anonymous.constants.callerSecuritySession.use-value = true

Expand Down
2 changes: 1 addition & 1 deletion generated

0 comments on commit 0332bc6

Please sign in to comment.