Module tugger_apple_codesign::code_requirement[][src]

Expand description

Code requirement language primitives.

Code signatures contain a binary encoded expression tree denoting requirements. There is a human friendly DSL that can be turned into these binary expressions using the csreq Apple tool. This module reimplements that language.

Binary Encoding

Requirement expressions consist of opcodes. An opcode is defined by a u32 where the high byte contains flags and the lower 3 bytes denote the opcode value.

Some opcodes have payloads and the payload varies by opcode. A common pattern is to length encode arbitrary data via a u32 denoting the length and N bytes to follow.

String data is not guaranteed to be terminated by a NULL. However, variable length data is padded will NULL bytes so the next opcode is always aligned on 4 byte boundaries.

Structs

Enums

Defines a code requirement expression.

An instance of a match expression in a CodeRequirementExpression.

A value in a code requirement expression.