feat(gateway): TLS 1.3 only control plane and LNEx v3 channel-bound handshake
Replace the X25519/HKDF/ChaCha20 TCP layer with rustls TLS 1.3 (ALPN vnox-lnex/3). Auto-generate a self-signed certificate keyed by the server identity or load an operator certificate, publish the SPKI fingerprint, bind HELLO and AUTH signatures to the TLS exporter, reject plaintext, TLS 1.2 and LNEx v2 peers with an explicit error. BREAKING: protocol v3.
This commit is contained in:
parent
41cc0fe632
commit
ff051b7480
45 changed files with 1322 additions and 806 deletions
|
|
@ -102,12 +102,11 @@ pub async fn handle<S: AsyncRead + AsyncWrite + Unpin>(
|
|||
.iter()
|
||||
.map(info)
|
||||
.collect();
|
||||
return io::send_encrypted(
|
||||
return io::send_frame(
|
||||
ctx.stream,
|
||||
PacketId::WebhookListResult,
|
||||
ctx.seq,
|
||||
&to_payload(&WebhookListResult { hooks, request_id }),
|
||||
ctx.crypto,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
|
@ -221,7 +220,7 @@ pub async fn handle<S: AsyncRead + AsyncWrite + Unpin>(
|
|||
}
|
||||
h
|
||||
};
|
||||
io::send_encrypted(
|
||||
io::send_frame(
|
||||
ctx.stream,
|
||||
PacketId::WebhookResult,
|
||||
ctx.seq,
|
||||
|
|
@ -230,7 +229,6 @@ pub async fn handle<S: AsyncRead + AsyncWrite + Unpin>(
|
|||
secret,
|
||||
request_id,
|
||||
}),
|
||||
ctx.crypto,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
|
@ -240,7 +238,7 @@ async fn error<S: AsyncRead + AsyncWrite + Unpin>(
|
|||
code: ErrorCode,
|
||||
msg: &str,
|
||||
) -> Result<()> {
|
||||
io::send_encrypted(
|
||||
io::send_frame(
|
||||
ctx.stream,
|
||||
PacketId::WebhookErrorResult,
|
||||
ctx.seq,
|
||||
|
|
@ -249,7 +247,6 @@ async fn error<S: AsyncRead + AsyncWrite + Unpin>(
|
|||
code: code as u32,
|
||||
message: msg.into(),
|
||||
}),
|
||||
ctx.crypto,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue