Struct kernel::process_checker::basic::AppCheckerSha256
source · pub struct AppCheckerSha256 { /* private fields */ }
Expand description
A Credentials Checking Policy that only runs Userspace Binaries which have a unique SHA256 credential. A Userspace Binary without a SHA256 credential fails checking, and only one Userspace Binary with a particular SHA256 hash runs at any time.
Implementations§
source§impl AppCheckerSha256
impl AppCheckerSha256
pub fn new( hash: &'static dyn Sha256Verifier<'static>, buffer: &'static mut [u8; 32] ) -> AppCheckerSha256
Trait Implementations§
source§impl AppCredentialsChecker<'static> for AppCheckerSha256
impl AppCredentialsChecker<'static> for AppCheckerSha256
fn require_credentials(&self) -> bool
fn check_credentials( &self, credentials: TbfFooterV2Credentials, binary: &'static [u8] ) -> Result<(), (ErrorCode, TbfFooterV2Credentials, &'static [u8])>
fn set_client(&self, client: &'static dyn Client<'static>)
source§impl AppUniqueness for AppCheckerSha256
impl AppUniqueness for AppCheckerSha256
source§impl ClientData<32> for AppCheckerSha256
impl ClientData<32> for AppCheckerSha256
source§fn add_mut_data_done(
&self,
_result: Result<(), ErrorCode>,
_data: SubSliceMut<'static, u8>
)
fn add_mut_data_done( &self, _result: Result<(), ErrorCode>, _data: SubSliceMut<'static, u8> )
Called when the data has been added to the digest.
data
is
the SubSliceMut
passed in the call to
add_mut_data
, whose active slice contains the data that was
not added. On Ok
, data
has an active slice of size zero
(all data was added). Valid ErrorCode
values are: Read moresource§fn add_data_done(
&self,
result: Result<(), ErrorCode>,
data: SubSlice<'static, u8>
)
fn add_data_done( &self, result: Result<(), ErrorCode>, data: SubSlice<'static, u8> )
Called when the data has been added to the digest.
data
is
the SubSlice
passed in the call to add_data
, whose
active slice contains the data that was not added. On Ok
,
data
has an active slice of size zero (all data was added).
Valid ErrorCode
values are: Read moresource§impl ClientHash<32> for AppCheckerSha256
impl ClientHash<32> for AppCheckerSha256
source§fn hash_done(
&self,
_result: Result<(), ErrorCode>,
_digest: &'static mut [u8; 32]
)
fn hash_done( &self, _result: Result<(), ErrorCode>, _digest: &'static mut [u8; 32] )
Called when a digest is computed.
digest
is the same
reference passed to run()
to store the hash value. If
result
is Ok
, digest
stores the computed hash. If
result
is Err
, the data stored in digest
is undefined
and may have any value. Valid ErrorCode
values are: Read moresource§impl ClientVerify<32> for AppCheckerSha256
impl ClientVerify<32> for AppCheckerSha256
source§fn verification_done(
&self,
result: Result<bool, ErrorCode>,
compare: &'static mut [u8; 32]
)
fn verification_done( &self, result: Result<bool, ErrorCode>, compare: &'static mut [u8; 32] )
Called when a verification is computed.
compare
is the
reference supplied to verify()
and the data stored in
compare
is unchanged. On Ok
the bool
indicates if the
computed hash matches the value in compare
. Valid
ErrorCode
values are: Read moresource§impl Compress for AppCheckerSha256
impl Compress for AppCheckerSha256
fn to_short_id(&self, credentials: &TbfFooterV2Credentials) -> ShortID
Auto Trait Implementations§
impl !RefUnwindSafe for AppCheckerSha256
impl !Send for AppCheckerSha256
impl !Sync for AppCheckerSha256
impl Unpin for AppCheckerSha256
impl !UnwindSafe for AppCheckerSha256
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more