| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | | use super::*; |
| 22 | | use std::collections::{HashSet, VecDeque}; |
| 23 | |
|
| 24 | | #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] |
| 25 | | pub enum Severity { |
| 26 | | |
| 27 | | Warning, |
| 28 | | |
| 29 | | Error, |
| 30 | | } |
| 31 | |
|
| 32 | | #[derive(Clone, Debug, PartialEq, Eq)] |
| 33 | | pub struct Problem { |
| 34 | | pub severity: Severity, |
| 35 | | |
| 36 | | pub object: Option<ObjectRef>, |
| 37 | | pub what: String, |
| 38 | | } |
| 39 | |
|
| 40 | | #[derive(Clone, Debug, Default, PartialEq, Eq)] |
| 41 | | pub struct FsckReport { |
| 42 | | pub objects: usize, |
| 43 | | pub ops: usize, |
| 44 | | |
| 45 | | pub changes: usize, |
| 46 | | |
| 47 | | pub signed: usize, |
| 48 | | pub unsigned: usize, |
| 49 | | pub checkpoints: usize, |
| 50 | | pub attestations: usize, |
| 51 | | pub problems: Vec<Problem>, |
| 52 | | } |
| 53 | |
|
| 54 | | impl FsckReport { |
| 55 | 68× | pub fn errors(&self) -> usize { |
| 56 | 68× | self.problems |
| 57 | 68× | .iter() |
| 58 | 68× | .filter(|p| p.severity == Severity::Error) |
| 59 | 68× | .count() |
| 60 | 68× | } |
| 61 | |
|
| 62 | 0× | pub fn warnings(&self) -> usize { |
| 63 | 0× | self.problems |
| 64 | 0× | .iter() |
| 65 | 0× | .filter(|p| p.severity == Severity::Warning) |
| 66 | 0× | .count() |
| 67 | 0× | } |
| 68 | |
|
| 69 | 11× | fn error(&mut self, object: Option<ObjectRef>, what: impl Into<String>) { |
| 70 | 11× | self.problems.push(Problem { |
| 71 | 11× | severity: Severity::Error, |
| 72 | 11× | object, |
| 73 | 11× | what: what.into(), |
| 74 | 11× | }); |
| 75 | 11× | } |
| 76 | |
|
| 77 | 0× | fn warn(&mut self, object: Option<ObjectRef>, what: impl Into<String>) { |
| 78 | 0× | self.problems.push(Problem { |
| 79 | 0× | severity: Severity::Warning, |
| 80 | 0× | object, |
| 81 | 0× | what: what.into(), |
| 82 | 0× | }); |
| 83 | 0× | } |
| 84 | | } |
| 85 | |
|
| 86 | |
|
| 87 | 1640× | fn decodes(ty: ObjectType, body: &[u8]) -> std::result::Result<(), String> { |
| 88 | 1640× | let r = match ty { |
| 89 | 126× | ObjectType::Chunk => Ok(()), |
| 90 | 76× | ObjectType::Blob => Blob::decode(body).map(|_| ()), |
| 91 | | |
| 92 | | ObjectType::Change => { |
| 93 | 423× | Change::decode_with(body, &mut |_, _, _| Ok(crate::lines::Lines::default())).map(|_| ()) |
| 94 | | } |
| 95 | 12× | ObjectType::Checkpoint => crate::objects::Checkpoint::decode(body).map(|_| ()), |
| 96 | 466× | ObjectType::Op => match Op::decode(body) { |
| 97 | 466× | Ok(_) => Ok(()), |
| 98 | 0× | Err(e) => Op::decode_format1(body).map(|_| ()).map_err(|_| e), |
| 99 | | }, |
| 100 | 228× | ObjectType::Attest => Attest::decode(body).map(|_| ()), |
| 101 | 67× | ObjectType::Identity => Identity::decode(body).map(|_| ()), |
| 102 | 0× | ObjectType::Policy => crate::policy::Policy::decode(body).map(|_| ()), |
| 103 | 1× | ObjectType::Receipt => crate::receipt::Receipt::decode(body).map(|_| ()), |
| 104 | 241× | ObjectType::State => crate::objects::StateObject::decode(body).map(|_| ()), |
| 105 | | }; |
| 106 | 1640× | r.map_err(|e| e.to_string()) |
| 107 | 1640× | } |
| 108 | |
|
| 109 | | impl Repo { |
| 110 | | |
| 111 | 76× | pub fn fsck(&self) -> Result<FsckReport> { |
| 112 | 76× | let mut rep = FsckReport::default(); |
| 113 | 76× | let bad = { |
| 114 | 76× | let _t = crate::timing::phase("fsck: objects"); |
| 115 | 76× | self.fsck_objects(&mut rep)? |
| 116 | | }; |
| 117 | 76× | { |
| 118 | 76× | let _t = crate::timing::phase("fsck: operations"); |
| 119 | 76× | self.fsck_ops(&mut rep, &bad); |
| 120 | 76× | } |
| 121 | | { |
| 122 | 76× | let _t = crate::timing::phase("fsck: references"); |
| 123 | 76× | self.fsck_references(&mut rep, &bad)?; |
| 124 | | } |
| 125 | | { |
| 126 | 76× | let _t = crate::timing::phase("fsck: states and checkpoints"); |
| 127 | 76× | self.fsck_derived(&mut rep)?; |
| 128 | | } |
| 129 | 76× | rep.problems.sort_by_key(|p| std::cmp::Reverse(p.severity)); |
| 130 | 76× | Ok(rep) |
| 131 | 76× | } |
| 132 | |
|
| 133 | | |
| 134 | | |
| 135 | 76× | fn fsck_objects(&self, rep: &mut FsckReport) -> Result<HashSet<ObjectRef>> { |
| 136 | | use rayon::prelude::*; |
| 137 | 76× | let mut bad = HashSet::new(); |
| 138 | | |
| 139 | 76× | for refs in self.store.list()?.chunks(8192) { |
| 140 | 76× | let checked: Vec<std::result::Result<(), String>> = self |
| 141 | 76× | .store |
| 142 | 76× | .get_many(refs) |
| 143 | 76× | .into_par_iter() |
| 144 | 1641× | .map(|got| match got { |
| 145 | 1640× | Ok((ty, body)) => decodes(ty, &body) |
| 146 | 1640× | .map_err(|e| format!("{} object does not decode: {e}", ty.name())), |
| 147 | 1× | Err(e) => Err(format!("unreadable object: {e}")), |
| 148 | 1641× | }) |
| 149 | 76× | .collect(); |
| 150 | 1641× | for (r, c) in refs.iter().zip(checked) { |
| 151 | 1641× | rep.objects += 1; |
| 152 | 1641× | if let Err(e) = c { |
| 153 | 1× | rep.error(Some(*r), e); |
| 154 | 1× | bad.insert(*r); |
| 155 | 1640× | } |
| 156 | | } |
| 157 | | } |
| 158 | 76× | Ok(bad) |
| 159 | 76× | } |
| 160 | |
|
| 161 | | |
| 162 | 76× | fn fsck_ops(&self, rep: &mut FsckReport, bad: &HashSet<ObjectRef>) { |
| 163 | 76× | let head = match self.read_head() { |
| 164 | 75× | Ok((h, _)) => h, |
| 165 | 1× | Err(RepoError::Msg(m)) if m.starts_with("corrupt") => { |
| 166 | 1× | rep.error(None, ".oxy/ops/head does not hold an object reference"); |
| 167 | 1× | return; |
| 168 | | } |
| 169 | 0× | Err(e) => { |
| 170 | 0× | rep.error(None, format!("cannot read .oxy/ops/head: {e}")); |
| 171 | 0× | return; |
| 172 | | } |
| 173 | | }; |
| 174 | 75× | let mut seen = HashSet::new(); |
| 175 | 75× | let mut queue: VecDeque<(ObjectRef, Option<(ObjectRef, u64)>)> = |
| 176 | 75× | VecDeque::from([(head, None)]); |
| 177 | 526× | while let Some((r, child)) = queue.pop_front() { |
| 178 | 451× | if !seen.insert(r) { |
| 179 | 3× | continue; |
| 180 | 448× | } |
| 181 | 448× | if bad.contains(&r) { |
| 182 | 0× | continue; |
| 183 | 448× | } |
| 184 | 448× | let body = match self.store.get_typed(&r, ObjectType::Op) { |
| 185 | 448× | Ok(b) => b, |
| 186 | | Err(StoreError::NotFound(_)) => { |
| 187 | 0× | let by = child |
| 188 | 0× | .map(|(c, _)| format!(", the parent of operation {}", c.short(12))) |
| 189 | 0× | .unwrap_or_default(); |
| 190 | 0× | rep.error( |
| 191 | 0× | Some(r), |
| 192 | 0× | format!("operation missing{by}; the log is cut here"), |
| 193 | | ); |
| 194 | 0× | continue; |
| 195 | | } |
| 196 | 0× | Err(e) => { |
| 197 | 0× | rep.error(Some(r), format!("operation unreadable: {e}")); |
| 198 | 0× | continue; |
| 199 | | } |
| 200 | | }; |
| 201 | 448× | rep.ops += 1; |
| 202 | 448× | let (parents, wall_ms) = match Op::decode(&body) { |
| 203 | 448× | Ok(op) => (op.parents, op.hlc.wall_ms), |
| 204 | 0× | Err(_) => match Op::decode_format1(&body) { |
| 205 | 0× | Ok(op) => (op.parents, op.hlc.wall_ms), |
| 206 | 0× | Err(e) => { |
| 207 | 0× | rep.error(Some(r), format!("operation does not decode: {e}")); |
| 208 | 0× | continue; |
| 209 | | } |
| 210 | | }, |
| 211 | | }; |
| 212 | 448× | if let Some((c, child_ms)) = child { |
| 213 | 373× | if wall_ms > child_ms { |
| 214 | 0× | rep.warn( |
| 215 | 0× | Some(c), |
| 216 | 0× | format!( |
| 217 | 0× | "operation is timed before its parent {} (a clock was wrong)", |
| 218 | 0× | r.short(12) |
| 219 | 0× | ), |
| 220 | 0× | ); |
| 221 | 373× | } |
| 222 | 75× | } |
| 223 | 448× | queue.extend(parents.into_iter().map(|p| (p, Some((r, wall_ms))))); |
| 224 | | } |
| 225 | 76× | } |
| 226 | |
|
| 227 | | |
| 228 | 76× | fn fsck_references(&self, rep: &mut FsckReport, bad: &HashSet<ObjectRef>) -> Result<()> { |
| 229 | 76× | let view = match self.view() { |
| 230 | 75× | Ok(v) => v, |
| 231 | 1× | Err(e) => { |
| 232 | 1× | rep.error(None, format!("cannot read the current view: {e}")); |
| 233 | 1× | return Ok(()); |
| 234 | | } |
| 235 | | }; |
| 236 | 75× | let boundary = self.boundary(); |
| 237 | 75× | let partial = self.config.max_blob.is_some() || !self.config.sparse_paths.is_empty(); |
| 238 | |
|
| 239 | 75× | let mut roots: Vec<(ChangeHash, String)> = Vec::new(); |
| 240 | 75× | let mut states: Vec<(ObjectRef, String)> = Vec::new(); |
| 241 | 75× | states.extend( |
| 242 | 75× | view.bookmarks |
| 243 | 75× | .iter() |
| 244 | 76× | .map(|(n, s)| (*s, format!("bookmark {n}"))), |
| 245 | | ); |
| 246 | 75× | states.extend(view.tags.iter().map(|(n, s)| (*s, format!("tag {n}")))); |
| 247 | 75× | for (remote, bms) in &view.remotes { |
| 248 | 47× | states.extend(bms.iter().map(|(n, s)| (*s, format!("{remote}/{n}")))); |
| 249 | | } |
| 250 | 131× | for (st, what) in states { |
| 251 | 131× | match self.store.get_state(&st) { |
| 252 | 192× | Ok(s) => roots.extend(s.heads.into_iter().map(|h| (h, what.clone()))), |
| 253 | 0× | Err(e) if !bad.contains(&st) => { |
| 254 | 0× | rep.error(Some(st), format!("state of {what} unusable: {e}")) |
| 255 | | } |
| 256 | 0× | Err(_) => {} |
| 257 | | } |
| 258 | | } |
| 259 | 76× | for (ws, h) in &view.workspaces { |
| 260 | 76× | roots.push((*h, format!("workspace {}", ws.to_hex()))); |
| 261 | 76× | } |
| 262 | 75× | if let Some(p) = view.policy { |
| 263 | 0× | match self.store.get_typed(&p, ObjectType::Policy) { |
| 264 | 0× | Ok(bytes) => { |
| 265 | 0× | if let Ok(policy) = crate::policy::Policy::decode(&bytes) { |
| 266 | 0× | for id in &policy.identities { |
| 267 | 0× | if !self.store.has(&id.hash()) { |
| 268 | 0× | rep.warn( |
| 269 | 0× | Some(id.hash()), |
| 270 | 0× | "an identity the policy names is not stored", |
| 271 | 0× | ); |
| 272 | 0× | } |
| 273 | | } |
| 274 | 0× | } |
| 275 | | } |
| 276 | 0× | Err(e) if !bad.contains(&p) => { |
| 277 | 0× | rep.error(Some(p), format!("the policy is unusable: {e}")) |
| 278 | | } |
| 279 | 0× | Err(_) => {} |
| 280 | | } |
| 281 | 75× | } |
| 282 | |
|
| 283 | | |
| 284 | 75× | let working: HashSet<ChangeHash> = view.workspaces.values().copied().collect(); |
| 285 | 75× | let mut seen: HashSet<ChangeHash> = HashSet::new(); |
| 286 | 75× | let mut blobs_seen: HashSet<ObjectRef> = HashSet::new(); |
| 287 | 75× | let mut stack = roots; |
| 288 | 479× | while let Some((h, needed_by)) = stack.pop() { |
| 289 | 404× | if !seen.insert(h) { |
| 290 | 172× | continue; |
| 291 | 232× | } |
| 292 | | |
| 293 | | |
| 294 | 232× | let (c, texts) = match self.store.get_change_lazy(&h) { |
| 295 | 230× | Ok(c) => c, |
| 296 | 1× | Err(StoreError::NotFound(_)) if boundary.contains(&h) => continue, |
| 297 | | Err(StoreError::NotFound(_)) => { |
| 298 | 1× | rep.error(Some(h), format!("change missing, needed by {needed_by}")); |
| 299 | 1× | continue; |
| 300 | | } |
| 301 | 1× | Err(e) => { |
| 302 | 1× | if !bad.contains(&h) { |
| 303 | 0× | rep.error(Some(h), format!("change unusable: {e}")); |
| 304 | 1× | } |
| 305 | 1× | continue; |
| 306 | | } |
| 307 | | }; |
| 308 | 230× | rep.changes += 1; |
| 309 | 230× | let label = format!("change {}", h.short(12)); |
| 310 | 230× | stack.extend(c.deps.iter().map(|d| (*d, label.clone()))); |
| 311 | 230× | if !c.author.is_zero() && !self.store.has(&c.author) { |
| 312 | 0× | rep.warn( |
| 313 | 0× | Some(h), |
| 314 | 0× | format!("author identity {} is not stored", c.author.short(12)), |
| 315 | 0× | ); |
| 316 | 230× | } |
| 317 | 230× | for t in texts { |
| 318 | 197× | if let crate::objects::TextRef::Blob(b, _, _) = t { |
| 319 | 46× | if blobs_seen.insert(b) { |
| 320 | 46× | |
| 321 | 46× | self.fsck_blob(rep, b, &label, false, bad); |
| 322 | 46× | } |
| 323 | 151× | } |
| 324 | | } |
| 325 | 230× | for e in &c.edits { |
| 326 | 206× | let Edit::Replace { old, new, .. } = e else { |
| 327 | 200× | continue; |
| 328 | | }; |
| 329 | 6× | for b in [old, new].into_iter().flatten() { |
| 330 | 6× | if !blobs_seen.insert(*b) { |
| 331 | 0× | continue; |
| 332 | 6× | } |
| 333 | 6× | self.fsck_blob(rep, *b, &label, partial, bad); |
| 334 | | } |
| 335 | | } |
| 336 | 230× | if working.contains(&h) { |
| 337 | 76× | continue; |
| 338 | 154× | } |
| 339 | 154× | match self.authenticate_change(&h) { |
| 340 | 105× | Ok(SignatureStatus::Valid { .. }) => rep.signed += 1, |
| 341 | 49× | Ok(SignatureStatus::Unsigned) => rep.unsigned += 1, |
| 342 | 0× | Ok(SignatureStatus::Invalid(why)) => { |
| 343 | 0× | rep.error(Some(h), format!("bad signature: {why}")) |
| 344 | | } |
| 345 | 0× | Err(e) => rep.error(Some(h), format!("cannot check signatures: {e}")), |
| 346 | | } |
| 347 | | } |
| 348 | 75× | Ok(()) |
| 349 | 76× | } |
| 350 | |
|
| 351 | 52× | fn fsck_blob( |
| 352 | 52× | &self, |
| 353 | 52× | rep: &mut FsckReport, |
| 354 | 52× | b: ObjectRef, |
| 355 | 52× | used_by: &str, |
| 356 | 52× | partial: bool, |
| 357 | 52× | bad: &HashSet<ObjectRef>, |
| 358 | 52× | ) { |
| 359 | 52× | match self.store.get_typed(&b, ObjectType::Blob) { |
| 360 | 50× | Ok(bytes) => { |
| 361 | 50× | let Ok(blob) = Blob::decode(&bytes) else { |
| 362 | 0× | return; |
| 363 | | }; |
| 364 | 89× | for ch in blob.chunks { |
| 365 | 89× | if !self.store.has(&ch) { |
| 366 | 0× | rep.error( |
| 367 | 0× | Some(ch), |
| 368 | 0× | format!("chunk missing from blob {} ({used_by})", b.short(12)), |
| 369 | 0× | ); |
| 370 | 89× | } |
| 371 | | } |
| 372 | | } |
| 373 | 0× | Err(StoreError::NotFound(_)) if partial => rep.warn( |
| 374 | 0× | Some(b), |
| 375 | 0× | format!("blob not fetched ({used_by}); expected in a partial clone"), |
| 376 | | ), |
| 377 | 2× | Err(StoreError::NotFound(_)) => rep.error(Some(b), format!("blob missing ({used_by})")), |
| 378 | 0× | Err(e) if !bad.contains(&b) => { |
| 379 | 0× | rep.error(Some(b), format!("blob unusable ({used_by}): {e}")) |
| 380 | | } |
| 381 | 0× | Err(_) => {} |
| 382 | | } |
| 383 | 52× | } |
| 384 | |
|
| 385 | | |
| 386 | | |
| 387 | | |
| 388 | 76× | fn check_state(&self, heads: &[ChangeHash]) -> Result<()> { |
| 389 | 76× | let mut st = self.load_state_history(heads)?; |
| 390 | 76× | let nodes = st.unbuilt_nodes(); |
| 391 | 76× | for batch in nodes.chunks(2048) { |
| 392 | 75× | self.load_graphs_of(&mut st, batch)?; |
| 393 | 73× | st.drop_graphs(batch); |
| 394 | | } |
| 395 | 74× | Ok(()) |
| 396 | 76× | } |
| 397 | |
|
| 398 | | |
| 399 | 76× | fn fsck_derived(&self, rep: &mut FsckReport) -> Result<()> { |
| 400 | 76× | let Ok(view) = self.view() else { return Ok(()) }; |
| 401 | 75× | let shallow = self.is_shallow(); |
| 402 | 75× | if !shallow { |
| 403 | 75× | let mut checked: HashSet<ObjectRef> = HashSet::new(); |
| 404 | 76× | for (name, st) in &view.bookmarks { |
| 405 | 76× | if !checked.insert(*st) { |
| 406 | 0× | continue; |
| 407 | 76× | } |
| 408 | 76× | let Ok(s) = self.store.get_state(st) else { |
| 409 | 0× | continue; |
| 410 | | }; |
| 411 | 76× | if let Err(e) = self.check_state(&s.heads) { |
| 412 | 2× | rep.error( |
| 413 | 2× | Some(*st), |
| 414 | 2× | format!("bookmark {name} does not form a valid state: {e}"), |
| 415 | 2× | ); |
| 416 | 74× | } |
| 417 | | } |
| 418 | 0× | } |
| 419 | 75× | for r in self.checkpoint_refs()? { |
| 420 | 9× | rep.checkpoints += 1; |
| 421 | 9× | let cp = match self.store.get_typed(&r, ObjectType::Checkpoint) { |
| 422 | 9× | Ok(b) => match crate::objects::Checkpoint::decode(&b) { |
| 423 | 9× | Ok(cp) => cp, |
| 424 | 0× | Err(_) => continue, |
| 425 | | }, |
| 426 | | Err(StoreError::NotFound(_)) => { |
| 427 | 0× | rep.warn( |
| 428 | 0× | Some(r), |
| 429 | | "checkpoint pointer names a missing checkpoint; it will be rewritten", |
| 430 | | ); |
| 431 | 0× | continue; |
| 432 | | } |
| 433 | 0× | Err(_) => continue, |
| 434 | | }; |
| 435 | 9× | let payload = match self.read_blob(&cp.payload) { |
| 436 | 9× | Ok(p) => p, |
| 437 | 0× | Err(e) => { |
| 438 | 0× | rep.error(Some(r), format!("checkpoint payload unreadable: {e}")); |
| 439 | 0× | continue; |
| 440 | | } |
| 441 | | }; |
| 442 | 9× | if let Err(e) = self.state_from_checkpoint(&payload) { |
| 443 | 1× | rep.error(Some(r), format!("checkpoint payload does not decode: {e}")); |
| 444 | 1× | continue; |
| 445 | 8× | } |
| 446 | | |
| 447 | 8× | let version = crate::cbor::decode(&payload).ok().and_then(|v| { |
| 448 | 8× | crate::objects::map(&v, "payload").ok().and_then(|m| { |
| 449 | 8× | m.get(&0) |
| 450 | 8× | .and_then(|x| crate::objects::uint(x, "version").ok()) |
| 451 | 8× | }) |
| 452 | 8× | }); |
| 453 | 8× | let expected = |full: &State| { |
| 454 | 6× | if version == Some(crate::state::CHECKPOINT_INDEX_VERSION) { |
| 455 | 5× | full.checkpoint_index(&full.checkpoint_file_graphs(), Repo::blob_ref) |
| 456 | | } else { |
| 457 | 1× | full.checkpoint_payload() |
| 458 | | } |
| 459 | 6× | }; |
| 460 | 8× | if !shallow { |
| 461 | 8× | match self.load_state_full(&cp.heads) { |
| 462 | 6× | Ok(full) if expected(&full) != payload => { |
| 463 | 0× | rep.error(Some(r), "checkpoint disagrees with the changes it names") |
| 464 | | } |
| 465 | 6× | Ok(_) => {} |
| 466 | 2× | Err(e) => rep.error( |
| 467 | 2× | Some(r), |
| 468 | 2× | format!("checkpoint names changes that do not form a state: {e}"), |
| 469 | | ), |
| 470 | | } |
| 471 | 0× | } |
| 472 | | } |
| 473 | 75× | let mut attests = Vec::new(); |
| 474 | 76× | for name in view.bookmarks.keys() { |
| 475 | 76× | if let Ok(Some((r, _))) = self.latest_ref_attest(name) { |
| 476 | 21× | attests.push((r, format!("bookmark {name}"))); |
| 477 | 55× | } |
| 478 | | } |
| 479 | 75× | for name in view.tags.keys() { |
| 480 | 8× | if let Ok(Some((r, _))) = self.tag_attest(name) { |
| 481 | 8× | attests.push((r, format!("tag {name}"))); |
| 482 | 8× | } |
| 483 | | } |
| 484 | 75× | for (r, what) in attests { |
| 485 | 29× | rep.attestations += 1; |
| 486 | 29× | let sigs = self.store.signatures(&r)?; |
| 487 | 29× | if sigs.is_empty() { |
| 488 | 0× | rep.warn(Some(r), format!("attestation for {what} is unsigned")); |
| 489 | 29× | } |
| 490 | 29× | for sig in sigs { |
| 491 | 29× | match self.store.get_identity(&sig.key) { |
| 492 | 29× | Ok(id) => { |
| 493 | 29× | if let Err(e) = verify_signature(&id, &sig, Domain::Attest, &r) { |
| 494 | 0× | rep.error( |
| 495 | 0× | Some(r), |
| 496 | 0× | format!("attestation for {what} has a bad signature: {e}"), |
| 497 | 0× | ); |
| 498 | 29× | } |
| 499 | | } |
| 500 | 0× | Err(_) => rep.warn( |
| 501 | 0× | Some(r), |
| 502 | 0× | format!( |
| 503 | | "attestation for {what} is signed by {}, whose identity is not stored", |
| 504 | 0× | sig.key.short(12) |
| 505 | | ), |
| 506 | | ), |
| 507 | | } |
| 508 | | } |
| 509 | | } |
| 510 | 75× | Ok(()) |
| 511 | 76× | } |
| 512 | | } |