Skip to content

Declare SecKeyOperationType as CFIndex, matching SecKey.h - #260

Open
LucaCappelletti94 wants to merge 1 commit into
kornelski:mainfrom
LucaCappelletti94:upstream/sec-key-operation-type
Open

LucaCappelletti94 wants to merge 1 commit into
kornelski:mainfrom
LucaCappelletti94:upstream/sec-key-operation-type

Conversation

@LucaCappelletti94

Copy link
Copy Markdown

security-framework-sys declares SecKeyOperationType as u32, while Apple declares it as CF_ENUM(CFIndex, SecKeyOperationType), and CFIndex is a signed long, 8 bytes on every target the crate supports. SecKeyIsAlgorithmSupported takes it by value, so the caller writes a 32-bit value while the callee reads a 64-bit register whose upper half is everybody's guess.

Looking into the current issues, no misbehaviour has been reported, and the high-level crate never calls the function, so the risk is definitely latent and I suppose low priority.

The systest binary catches it when run on macOS 26.6.2 (bad SecKeyOperationType size: rust: 4 (0x4) != c 8 (0x8), with matching lines for alignment and signedness).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant