Struct puffin::trace::TraceContext
source · pub struct TraceContext<PB: ProtocolBehavior> {
pub knowledge_store: KnowledgeStore<PB>,
agents: Vec<Agent<PB>>,
claims: GlobalClaimList<<PB as ProtocolBehavior>::Claim>,
put_registry: PutRegistry<PB>,
deterministic_put: bool,
default_put_options: PutOptions,
non_default_put_descriptors: HashMap<AgentName, PutDescriptor>,
phantom: PhantomData<PB>,
}
Expand description
The TraceContext
contains a list of VariableData
, which is known as the knowledge
of the attacker. VariableData
can contain data of various types like for example
client and server extensions, cipher suits or session ID It also holds the concrete
references to the Agent
s and the underlying streams, which contain the messages
which have need exchanged and are not yet processed by an output step.
Fields§
§knowledge_store: KnowledgeStore<PB>
The knowledge of the attacker
agents: Vec<Agent<PB>>
§claims: GlobalClaimList<<PB as ProtocolBehavior>::Claim>
§put_registry: PutRegistry<PB>
§deterministic_put: bool
§default_put_options: PutOptions
§non_default_put_descriptors: HashMap<AgentName, PutDescriptor>
§phantom: PhantomData<PB>
Implementations§
source§impl<PB: ProtocolBehavior> TraceContext<PB>
impl<PB: ProtocolBehavior> TraceContext<PB>
pub fn new(
put_registry: &PutRegistry<PB>,
default_put_options: PutOptions
) -> Self
pub fn put_registry(&self) -> &PutRegistry<PB>
pub fn claims(&self) -> &GlobalClaimList<PB::Claim>
pub fn verify_security_violations(&self) -> Result<(), Error>
sourcepub fn number_matching_message_with_source(
&self,
source: Source,
type_id: TypeId,
tls_message_type: &Option<PB::Matcher>
) -> usize
pub fn number_matching_message_with_source(
&self,
source: Source,
type_id: TypeId,
tls_message_type: &Option<PB::Matcher>
) -> usize
Count the number of sub-messages of type type_id
with the correct source
sourcepub fn number_matching_message(
&self,
type_id: TypeId,
tls_message_type: &Option<PB::Matcher>
) -> usize
pub fn number_matching_message(
&self,
type_id: TypeId,
tls_message_type: &Option<PB::Matcher>
) -> usize
Count the number of sub-messages of type type_id
in the output message.
pub fn find_claim(
&self,
agent_name: AgentName,
query_type_shape: TypeShape
) -> Option<Box<dyn Any>>
sourcepub fn find_variable(
&self,
query_type_shape: TypeShape,
query: &Query<PB::Matcher>
) -> Option<&dyn VariableData>
pub fn find_variable(
&self,
query_type_shape: TypeShape,
query: &Query<PB::Matcher>
) -> Option<&dyn VariableData>
Returns the variable which matches best -> highest specificity If we want a variable with lower specificity, then we can just query less specific
sourcepub fn add_to_inbound(
&mut self,
agent_name: AgentName,
message_flight: &PB::OpaqueProtocolMessageFlight
) -> Result<(), Error>
pub fn add_to_inbound(
&mut self,
agent_name: AgentName,
message_flight: &PB::OpaqueProtocolMessageFlight
) -> Result<(), Error>
pub fn next_state(&mut self, agent_name: AgentName) -> Result<(), Error>
sourcepub fn take_message_from_outbound(
&mut self,
agent_name: AgentName
) -> Result<Option<PB::OpaqueProtocolMessageFlight>, Error>
pub fn take_message_from_outbound(
&mut self,
agent_name: AgentName
) -> Result<Option<PB::OpaqueProtocolMessageFlight>, Error>
Takes data from the outbound Channel
of the Agent
referenced by the parameter “agent”.
See crate::stream::Stream::take_message_from_outbound
fn add_agent(&mut self, agent: Agent<PB>) -> AgentName
pub fn new_agent(
&mut self,
descriptor: &AgentDescriptor
) -> Result<AgentName, Error>
pub fn find_agent_mut(
&mut self,
name: AgentName
) -> Result<&mut Agent<PB>, Error>
pub fn find_agent(&self, name: AgentName) -> Result<&Agent<PB>, Error>
sourcepub fn put_descriptor(&self, agent_descriptor: &AgentDescriptor) -> PutDescriptor
pub fn put_descriptor(&self, agent_descriptor: &AgentDescriptor) -> PutDescriptor
Gets the PUT descriptor which should be used for all agents
fn default_put_descriptor(&self) -> PutDescriptor
sourcepub fn set_non_default_put(
&mut self,
agent_name: AgentName,
put_descriptor: PutDescriptor
)
pub fn set_non_default_put(
&mut self,
agent_name: AgentName,
put_descriptor: PutDescriptor
)
Makes agents use the non-default PUT
pub fn set_non_default_puts(
&mut self,
descriptors: &[(AgentName, PutDescriptor)]
)
pub fn reset_agents(&mut self) -> Result<(), Error>
pub fn agents_successful(&self) -> bool
pub fn set_deterministic(&mut self, deterministic: bool)
Trait Implementations§
source§impl<PB: Debug + ProtocolBehavior> Debug for TraceContext<PB>
impl<PB: Debug + ProtocolBehavior> Debug for TraceContext<PB>
source§impl<PB: ProtocolBehavior> Display for TraceContext<PB>
impl<PB: ProtocolBehavior> Display for TraceContext<PB>
source§impl<PB: ProtocolBehavior + PartialEq> PartialEq<TraceContext<PB>> for TraceContext<PB>
impl<PB: ProtocolBehavior + PartialEq> PartialEq<TraceContext<PB>> for TraceContext<PB>
Auto Trait Implementations§
impl<PB> !RefUnwindSafe for TraceContext<PB>
impl<PB> !Send for TraceContext<PB>
impl<PB> !Sync for TraceContext<PB>
impl<PB> Unpin for TraceContext<PB>where
PB: Unpin,
<PB as ProtocolBehavior>::Matcher: Unpin,
impl<PB> !UnwindSafe for TraceContext<PB>
Blanket Implementations§
§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
TupleList
], of an [Prepend::prepend()
] call,
including the prepended entry.