mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
Introduce secure mode (part 1) (#1808)
Use noise protocol on handshake. Check peer's public key if needed. Also support rekey and replay attack prevention. E2EE and temporary password will be implemented based on this.
This commit is contained in:
@@ -56,7 +56,7 @@ pub struct WGTunnelHeader {
|
||||
}
|
||||
pub const WG_TUNNEL_HEADER_SIZE: usize = std::mem::size_of::<WGTunnelHeader>();
|
||||
|
||||
#[derive(AsBytes, FromZeroes, Clone, Debug)]
|
||||
#[derive(AsBytes, FromZeroes, Copy, Clone, Debug)]
|
||||
#[repr(u8)]
|
||||
pub enum PacketType {
|
||||
Invalid = 0,
|
||||
@@ -72,6 +72,9 @@ pub enum PacketType {
|
||||
ForeignNetworkPacket = 10,
|
||||
KcpSrc = 11,
|
||||
KcpDst = 12,
|
||||
NoiseHandshakeMsg1 = 13,
|
||||
NoiseHandshakeMsg2 = 14,
|
||||
NoiseHandshakeMsg3 = 15,
|
||||
}
|
||||
|
||||
bitflags::bitflags! {
|
||||
|
||||
Reference in New Issue
Block a user