1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Copyright (c) 2026 Erik Lening (hollowpointer) and Contributors
//
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at
// https://mozilla.org/MPL/2.0/.
//! # Collected responses
//!
//! [`ResponseSet`] is everything the transport gathered from a port, handed to
//! the analyzers as one value. It replaces the bare `Vec<String>` the engine
//! started with so that non-banner evidence — a TLS certificate now, raw binary
//! protocol frames later — has a typed home instead of being squeezed through a
//! lossy `String`.
//!
//! The transport owns collection (I/O); analyzers own interpretation (CPU). So
//! the TLS certificate lives here as **raw DER bytes**, not a parsed structure:
//! parsing is x509 work that belongs in [`TlsCertAnalyzer`], off the reactor,
//! and keeping rustls/x509 types out of this model stops them leaking into every
//! analyzer.
//!
//! [`TlsCertAnalyzer`]: super::tls_cert::TlsCertAnalyzer
/// What a TLS handshake yielded: the certificate chain the peer presented, as
/// raw DER, leaf first.
///
/// Empty `certificates` still means "this port completed a TLS handshake" — a
/// signal in itself — but the analyzers here need a leaf cert to say anything.
/// Every response the transport collected from a single port.
///
/// Analyzers read only the fields they understand: [`BannerRegexAnalyzer`] reads
/// [`banners`](Self::banners); [`TlsCertAnalyzer`] reads [`tls`](Self::tls). A
/// field being empty simply means that source produced nothing.
///
/// [`BannerRegexAnalyzer`]: super::analyzer::BannerRegexAnalyzer
/// [`TlsCertAnalyzer`]: super::tls_cert::TlsCertAnalyzer
/// The raw frames an [`Analyzer`] gathered from its *own* probes during the
/// collect phase, kept separate from the shared first-contact data in
/// [`ResponseSet`].
///
/// Bytes, not text: an active analyzer speaks a specific protocol (a JARM
/// ClientHello sweep, an SSH `KEXINIT`, a Modbus request, and the future
/// nerva-derived binary handlers) and parses the reply byte-for-byte, so there
/// is no lossy `String` in the way. A passive analyzer — one that reads only the
/// shared [`ResponseSet`] — never overrides `collect`, so its `Collected` is
/// simply empty.
///
/// [`Analyzer`]: super::analyzer::Analyzer