/// `AntiReplay` is used by servers when processing 0-RTT handshakes. /// /// It limits the exposure of servers to replay attack by rejecting 0-RTT /// if it appears to be a replay. There is a false-positive rate that can be /// managed by tuning the parameters used to create the context. pubstruct AntiReplay {
ctx: AntiReplayContext,
}
impl AntiReplay { /// Make a new anti-replay context. /// See the documentation in NSS for advice on how to set these values. /// /// # Errors /// /// Returns an error if `now` is in the past relative to our baseline or /// NSS is unable to generate an anti-replay context. pubfn new(now: Instant, window: Duration, k: usize, bits: usize) -> Res<Self> { letmut ctx: *mut SSLAntiReplayContext = null_mut(); unsafe {
SSL_CreateAntiReplayContext(
Time::from(now).try_into()?,
Interval::from(window).try_into()?,
c_uint::try_from(k)?,
c_uint::try_from(bits)?,
&raw mut ctx,
)
}?;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.