Iota Connection

This commit is contained in:
Alex Emmet 2026-05-22 15:18:34 +02:00
commit 0ca5178aa6
2 changed files with 30 additions and 11 deletions

12
Cargo.lock generated
View file

@ -271,9 +271,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.5.0" version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
[[package]] [[package]]
name = "aws-lc-rs" name = "aws-lc-rs"
@ -2987,9 +2987,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.149" version = "1.0.150"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
dependencies = [ dependencies = [
"itoa", "itoa",
"memchr", "memchr",
@ -3420,7 +3420,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]] [[package]]
name = "ttp-core" name = "ttp-core"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.methanium.net/Tensamin/TTP.git#3e3f939f64088cb01c13348b58c504593953ec0e" source = "git+https://git.methanium.net/Tensamin/TTP.git#886edbf51d26636e46745c3637b80610df82f5dc"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"byteorder", "byteorder",
@ -3433,7 +3433,7 @@ dependencies = [
[[package]] [[package]]
name = "ttp-native" name = "ttp-native"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.methanium.net/Tensamin/TTP.git#3e3f939f64088cb01c13348b58c504593953ec0e" source = "git+https://git.methanium.net/Tensamin/TTP.git#886edbf51d26636e46745c3637b80610df82f5dc"
dependencies = [ dependencies = [
"quinn", "quinn",
"rustls", "rustls",

View file

@ -113,9 +113,8 @@ impl GeneralConnection {
log_cv_out!(success_msg); log_cv_out!(success_msg);
let _ = self.sender.send(&success_msg).await; let _ = self.sender.send(&success_msg).await;
} else { } else {
let err_msg = CommunicationValue::new( let err_msg =
CommunicationType::error_invalid_omikron_id, CommunicationValue::new(CommunicationType::error_invalid_omikron_id)
)
.with_id(cv.get_id()); .with_id(cv.get_id());
let _ = self.sender.send(&err_msg).await; let _ = self.sender.send(&err_msg).await;
} }
@ -196,6 +195,12 @@ impl GeneralConnection {
let response_cv = match response_cv { let response_cv = match response_cv {
Ok(r) => r, Ok(r) => r,
Err(_) => { Err(_) => {
log_err!(
*iota_id,
PrintType::Iota,
"Failed to get Iota data from Omega for iota_id={}",
iota_id
);
return; return;
} }
}; };
@ -208,6 +213,12 @@ impl GeneralConnection {
let pub_key = match load_public_key(base64_pub) { let pub_key = match load_public_key(base64_pub) {
Some(pk) => pk, Some(pk) => pk,
None => { None => {
log_err!(
*iota_id,
PrintType::Iota,
"Failed to load public key for iota_id={}",
iota_id
);
return; return;
} }
}; };
@ -363,7 +374,7 @@ impl GeneralConnection {
.add_data( .add_data(
DataTypes::message, DataTypes::message,
DataValue::Str( DataValue::Str(
"Challenge response mismatch authentication rejected".to_string(), "Challenge response mismatch; authentication rejected".to_string(),
), ),
); );
let _ = self.sender.send(&err_msg).await; let _ = self.sender.send(&err_msg).await;
@ -599,6 +610,14 @@ impl GeneralConnection {
} }
} }
let ident_resp =
CommunicationValue::new(CommunicationType::identification_response)
.with_id(*self.challenge_cv_id.read().await)
.add_data(DataTypes::accepted, DataValue::Bool(true));
log_cv_out!(ident_resp);
let _ = self.sender.send(&ident_resp).await;
iota.clone().start(); iota.clone().start();
} }
ConnectionKind::AnonymousClient => { ConnectionKind::AnonymousClient => {