pub struct CodeDirectoryBlob<'a> {
Show 25 fields pub version: u32, pub flags: CodeSignatureFlags, pub code_limit: u32, pub digest_size: u8, pub digest_type: DigestType, pub platform: u8, pub page_size: u32, pub spare2: u32, pub scatter_offset: Option<u32>, pub spare3: Option<u32>, pub code_limit_64: Option<u64>, pub exec_seg_base: Option<u64>, pub exec_seg_limit: Option<u64>, pub exec_seg_flags: Option<ExecutableSegmentFlags>, pub runtime: Option<u32>, pub pre_encrypt_offset: Option<u32>, pub linkage_hash_type: Option<u8>, pub linkage_truncated: Option<u8>, pub spare4: Option<u16>, pub linkage_offset: Option<u32>, pub linkage_size: Option<u32>, pub ident: Cow<'a, str>, pub team_name: Option<Cow<'a, str>>, pub code_digests: Vec<Digest<'a>>, pub special_digests: HashMap<CodeSigningSlot, Digest<'a>>,
}
Expand description

Represents a code directory blob entry.

This struct is versioned and has been extended over time.

The struct here represents a superset of all fields in all versions.

The parser will set Option<T> fields to None for instances where the version is lower than the version that field was introduced in.

Fields

version: u32

Compatibility version.

flags: CodeSignatureFlags

Setup and mode flags.

code_limit: u32

Limit to main image signature range.

This is the file-level offset to stop digesting code data at. It likely corresponds to the file-offset offset where the embedded signature data starts in the __LINKEDIT segment.

digest_size: u8

Size of each slot/code digest in bytes.

digest_type: DigestType

Type of content digest being used.

platform: u8

Platform identifier. 0 if not platform binary.

page_size: u32

Page size in bytes. (stored as log u8)

spare2: u32

Unused (must be 0).

scatter_offset: Option<u32>

Offset of optional scatter vector.

spare3: Option<u32>

Unused (must be 0).

code_limit_64: Option<u64>

Limit to main image signature range, 64 bits.

exec_seg_base: Option<u64>

Offset of executable segment.

exec_seg_limit: Option<u64>

Limit of executable segment.

exec_seg_flags: Option<ExecutableSegmentFlags>

Executable segment flags.

runtime: Option<u32>pre_encrypt_offset: Option<u32>linkage_hash_type: Option<u8>linkage_truncated: Option<u8>spare4: Option<u16>linkage_offset: Option<u32>linkage_size: Option<u32>ident: Cow<'a, str>team_name: Option<Cow<'a, str>>code_digests: Vec<Digest<'a>>special_digests: HashMap<CodeSigningSlot, Digest<'a>>

Implementations

Obtain the mapping of slots to digests.

Obtain the recorded digest for a given CodeSigningSlot.

Set the digest for a given slot.

Adjust the version of the data structure according to what fields are set.

Returns the old version.

Clears optional fields that are newer than the current version.

The C structure is versioned and our Rust struct is a superset of all versions. While our serializer should omit too new fields for a given version, it is possible for some optional fields to be set when they wouldn’t get serialized.

Calling this function will set fields not present in the current version to None.

Trait Implementations

The header magic that identifies this format.

Attempt to construct an instance by parsing a bytes slice. Read more

Serialize the payload of this blob to bytes. Read more

Serialize this blob to bytes. Read more

Obtain the digest of the blob using the specified hasher. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts to this type from the input type.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted. Read more

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted. Read more

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Formats each item in a sequence. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Should always be Self

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more