Wire native Dosh auth runtime
ci / test (push) Has been cancelled
ci / remote-bench (push) Has been cancelled

This commit is contained in:
DuProcess
2026-06-13 11:54:24 -04:00
parent 80c7889b46
commit e7f3679fc1
8 changed files with 1086 additions and 11 deletions
+29
View File
@@ -1,5 +1,6 @@
use crate::auth::BootstrapResponse;
use crate::crypto;
use crate::native::{NativeAuthOk, NativeClientHello, NativeServerHello, NativeUserAuth};
use anyhow::{Context, Result, bail};
use serde::{Deserialize, Serialize};
@@ -25,6 +26,10 @@ pub enum PacketKind {
Ping = 11,
Pong = 12,
Detach = 13,
NativeClientHello = 14,
NativeServerHello = 15,
NativeUserAuth = 16,
NativeAuthOk = 17,
}
impl TryFrom<u8> for PacketKind {
@@ -45,6 +50,10 @@ impl TryFrom<u8> for PacketKind {
11 => Self::Ping,
12 => Self::Pong,
13 => Self::Detach,
14 => Self::NativeClientHello,
15 => Self::NativeServerHello,
16 => Self::NativeUserAuth,
17 => Self::NativeAuthOk,
_ => bail!("unknown packet kind {value}"),
})
}
@@ -214,6 +223,26 @@ pub struct TicketAttachOkEnvelope {
pub ciphertext: Vec<u8>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NativeClientHelloBody {
pub hello: NativeClientHello,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NativeServerHelloBody {
pub hello: NativeServerHello,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NativeUserAuthBody {
pub auth: NativeUserAuth,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NativeAuthOkBody {
pub ok: NativeAuthOk,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AttachOk {
pub client_id: [u8; 16],