feat(client): TLS 1.3 control connection with SPKI pinning and LNEx v3
Replace the custom X25519/HKDF/ChaCha20 TCP layer with rustls (TLS 1.3 only, ALPN vnox-lnex/3, no plaintext or fallback). Add a trust store (pin, trust on first use, public CA), block changed fingerprints and identities, bind the Ed25519 auth signature to the TLS exporter, add RU/EN trust dialog and update the interop test and e2e voice tool.
This commit is contained in:
parent
5f594046a6
commit
29883a3187
31 changed files with 2085 additions and 567 deletions
|
|
@ -16,6 +16,14 @@ export component ConnectScreen inherits Rectangle {
|
|||
callback remove-bookmark(string);
|
||||
callback add-bookmark(string);
|
||||
callback open-settings();
|
||||
// 0 none, 1 first use, 2 certificate fingerprint changed, 3 server identity changed
|
||||
in property <int> trust-kind: 0;
|
||||
in property <string> trust-address;
|
||||
in property <string> trust-received;
|
||||
in property <string> trust-expected;
|
||||
callback trust-accept();
|
||||
callback trust-forget();
|
||||
callback trust-dismiss();
|
||||
background: Theme.bg-base;
|
||||
VerticalLayout {
|
||||
padding: 32px; spacing: 22px;
|
||||
|
|
@ -86,4 +94,50 @@ export component ConnectScreen inherits Rectangle {
|
|||
Rectangle { vertical-stretch: 1; }
|
||||
Text { text: @tr("Your server. Your community."); color: Theme.text-disabled; font-size: Math.max(11px, Theme.font-size * 0.75); horizontal-alignment: center; }
|
||||
}
|
||||
if root.trust-kind != 0 : Rectangle {
|
||||
background: #000000a0;
|
||||
TouchArea { }
|
||||
HorizontalLayout {
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
VerticalLayout {
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
Rectangle {
|
||||
width: 560px;
|
||||
height: trust-card.preferred-height;
|
||||
background: Theme.bg-surface; border-radius: 14px;
|
||||
border-width: 1px; border-color: root.trust-kind == 1 ? Theme.border : Theme.danger;
|
||||
trust-card := VerticalLayout {
|
||||
padding: 26px; spacing: 12px; alignment: start;
|
||||
Text {
|
||||
text: root.trust-kind == 1 ? @tr("Trust this server?") : root.trust-kind == 2 ? @tr("Server fingerprint changed") : @tr("Server identity changed");
|
||||
color: root.trust-kind == 1 ? Theme.text-primary : Theme.danger;
|
||||
font-size: Math.max(11px, Theme.font-size * 1.375); font-weight: 600; wrap: word-wrap;
|
||||
}
|
||||
Text {
|
||||
text: root.trust-kind == 1
|
||||
? @tr("This is the first connection to this server. Its certificate is not issued by a public authority, so Vnox cannot verify it automatically. Compare the fingerprint with the one published by the server owner and trust it only if they match.")
|
||||
: root.trust-kind == 2
|
||||
? @tr("The certificate of this server is different from the one you trusted before. This can mean an attack on your connection, or the owner reinstalled the server. The connection was blocked and nothing was sent. Ask the owner whether the change is expected.")
|
||||
: @tr("The server proved a different identity key than the one you trusted before. The connection was blocked and nothing was sent. Ask the owner whether the change is expected.");
|
||||
color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.8125); wrap: word-wrap;
|
||||
}
|
||||
Text { text: @tr("Server address"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
Text { text: root.trust-address; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); wrap: word-wrap; }
|
||||
if root.trust-kind != 1 : Text { text: @tr("Previously trusted fingerprint"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
if root.trust-kind != 1 : Text { text: root.trust-expected; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.75); wrap: word-wrap; }
|
||||
Text { text: root.trust-kind == 1 ? @tr("Fingerprint (SHA-256)") : @tr("Received fingerprint"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
Text { text: root.trust-received; color: root.trust-kind == 1 ? Theme.accent : Theme.danger; font-size: Math.max(11px, Theme.font-size * 0.75); wrap: word-wrap; }
|
||||
HorizontalLayout {
|
||||
spacing: 9px; alignment: end;
|
||||
if root.trust-kind != 1 : ActionButton { text: @tr("Forget this server"); danger: true; clicked => { root.trust-forget(); } }
|
||||
ActionButton { text: root.trust-kind == 1 ? @tr("Cancel") : @tr("Close"); clicked => { root.trust-dismiss(); } }
|
||||
if root.trust-kind == 1 : ActionButton { text: @tr("Trust and connect"); active: true; clicked => { root.trust-accept(); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
}
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue