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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
//! **A leaf that already exists is adopted, not refused** (REMOTE §1.4 as
//! amended, §4.1, §8.2; bl-bd48, bl-6b14) — what an enrollment does with the
//! name it was handed, in its own file on the seam [`enroll`](super)'s own doc
//! draws: everything there is the act's order, and this is the one question
//! asked before any of it runs.
//!
//! **The dead end it closes.** `yog wire-certs WIRE_LEAF=<name>` is the act the
//! binary's own help teaches for provisioning another box, and it mints a leaf
//! that is **registered in no workspace** — REMOTE §5.1's advertisement then
//! presents into the empty set, and the foot is connectable and useless. The
//! one act that registers is this one, and it refused: a pair already under
//! that name, because re-issuing distrusts nothing and two live certificates
//! under one identity is the hazard. Both halves were right and the conclusion
//! was wrong. **Registering is not issuing.** Adopting the standing pair mints
//! nothing, distrusts nothing and creates no second certificate — it seats the
//! registration the leaf was always missing, and hands over the material the
//! operator was going to carry by hand anyway.
//!
//! **And a name is burnt only by a device, never by a typo** (bl-f867). The
//! same reasoning reaches one arm further. A certificate whose key is gone was
//! handed out by this door, and refusing every later enrollment under it made
//! a mistyped name — or a lost envelope — cost the whole trust root, `FORCE=1`
//! being the only remedy on offer and a rotation distrusting every device this
//! box ever enrolled. The question the refusal never asked is whether that
//! enrollment was ever **taken up**, and `registry::seen` answers it durably:
//! never dialled, the standing certificate is superseded and a fresh pair is
//! minted under the same name; dialled, it stays sealed and the refusal says
//! when the device last spoke.
//!
//! **The grade is read off the certificate and never taken on trust.** A grade
//! is minted into a subject by the operator's own CA (§4.2), so an adoption
//! that believed the word typed at a seat would be a promotion granted by
//! registration — exactly what default-operator exists to make impossible.
use Path;
use crateRequest;
use crate;
use crateprovision;
/// Mint this enrollment's leaf, or adopt the one already here — and answer the
/// grade the material actually carries.
///
/// The four states of a name are the four arms, and each names its own remedy:
/// nothing here is the mint; a whole pair is the adoption; a certificate whose
/// key is gone was enrolled through this door already, and whether that
/// enrollment was ever **taken up** is [`remint`]'s question; a key with no
/// certificate is debris no act can use.
pub
/// **An enrollment nobody ever took up is not a burnt name** (bl-f867).
///
/// The shred is what makes the answered material the device's only copy, so a
/// certificate with no key beside it means this door has already handed a name
/// out. Refusing every second enrollment under it was the safe half of a true
/// statement and the wrong conclusion: an operator who typed the box's name
/// wrong, or lost the envelope before it reached the device, had burned that
/// name for the life of the CA — the only remedy on offer was `FORCE=1`, which
/// rotates the trust root and distrusts **every** device this box ever
/// enrolled, to repair one that was never used.
///
/// So the question is whether the leaf was ever **adopted**, and the registry
/// answers it durably: `seen` is stamped the first time a client's bytes reach
/// the wire's intake (`registry::seen`, REMOTE §5 as amended), so its absence
/// is "no device has ever presented this identity". Never adopted, the standing
/// certificate is superseded here and a fresh pair is minted under the same
/// name; adopted, it stays **sealed** and the refusal now says when the device
/// last spoke, which is the fact that makes the seal readable rather than
/// arbitrary.
///
/// **What the re-mint costs, stated.** The CA has now signed two certificates
/// for one common name, and the first is not revoked — there is no CRL here.
/// That matters only if the superseded envelope is *also* used, and the arm is
/// reached exactly when nothing has ever used it and the operator is asking for
/// another. The alternative was a rotation, which distrusts every other device
/// on the box: a wider destruction, to undo a smaller one.
/// The standing pair's own grade, refusing when it is not the one asked for.
///
/// The refusal is the whole of the grade's integrity here: adoption grants the
/// authority a certificate already carries and never a word more, so an
/// operator who asks for a foot and finds an operator leaf is told which one is
/// on disk rather than handed it under the other name.