Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions src/server/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,24 @@
//!
//! # The pin does not survive the process
//!
//! 0029 puts a pin in the byte store of #40 under a key built the way #41 builds
//! one, keyed by the server and the device and never by the account, and says
//! that with no store supplied the pin lives as long as the process and an
//! operator pins once per run. That last sentence is the state of this tree: the
//! register below holds its pins in memory, so what a client gets today is the
//! no-store behaviour the record already decided rather than a shortcut taken
//! here. Nothing about the account reaches any call in this module, which is how
//! that half of the key is kept: there is no parameter to pass one in.
//! 0029 puts a pin in the byte store [`crate::cache::ByteStore`] declares, under
//! a key built the way #41 builds one, keyed by the server and the device and
//! never by the account, and says that with no store supplied the pin lives as
//! long as the process and an operator pins once per run. That last sentence is
//! the state of this tree: the register below holds its pins in memory, so what a
//! client gets today is the no-store behaviour the record already decided rather
//! than a shortcut taken here. Nothing about the account reaches any call in this
//! module, which is how that half of the key is kept: there is no parameter to
//! pass one in.
//!
//! THIS FILE CALLED THAT STORE `#40` AT EVERY ONE OF ITS THREE SITES UNTIL THIS
//! EDIT, HERE AND ON [`PinnedServer`] AND [`Pins::pin`]. #40 closed as
//! completed on 2026-08-26 and the trait took its four operations four minutes
//! before it closed, while this file landed on 2026-08-30. So all three landed
//! refuted rather than going stale, which is the harder of the two states to
//! defend: the paragraph on [`PinnedServer`] links a type out of the same crate
//! two lines above the sentence that reached for the number instead. #496 is
//! where it was found.
//!
//! # The digest is chosen here and 0029 does not name it
//!
Expand Down Expand Up @@ -249,8 +259,10 @@ impl<'a> Refused<'a> {
/// IT IS AN OWNED VALUE RATHER THAN THAT TYPE, and the difference is not a
/// preference. [`crate::cache::key::ServerPart`] borrows for the length of one
/// derivation, and a register outlives every call made against it. Where a pin
/// is written to the store in #40, the value below is what a key is derived
/// from, so the two arms are the same two on purpose.
/// is written to the store [`crate::cache::ByteStore`] declares, the value below
/// is what a key is derived from, so the two arms are the same two on purpose.
/// THAT SENTENCE READ `the store in #40`, two lines under the link above it; the
/// header says what the three sites of that number were in.
///
/// Thread safety, from 0009: immutable once made.
#[derive(Debug, Clone, PartialEq, Eq)]
Expand Down Expand Up @@ -332,10 +344,12 @@ impl Pins {
///
/// IT TAKES A FINGERPRINT RATHER THAN A [`Refused`], AND THAT IS DELIBERATE.
/// Requiring the refusal would read as the stronger interface and would
/// refuse the case 0029 depends on: a pin lives in the store in #40 and is
/// read back at the start of the next run, where no refusal has happened
/// yet. What keeps a client to the record is the record and the review
/// rather than this signature.
/// refuse the case 0029 depends on: a pin lives in the store
/// [`crate::cache::ByteStore`] declares and is read back at the start of the
/// next run, where no refusal has happened yet. What keeps a client to the
/// record is the record and the review rather than this signature. THAT
/// SENTENCE READ `the store in #40`; the header says what the three sites of
/// that number were in.
pub fn pin(&self, server: PinnedServer, fingerprint: Fingerprint) -> Option<Fingerprint> {
let mut held = self.held();
if let Some(pin) = held.iter_mut().find(|pin| pin.server == server) {
Expand Down
Loading