Iota Connection
This commit is contained in:
parent
d55f485e03
commit
0ca5178aa6
2 changed files with 30 additions and 11 deletions
12
Cargo.lock
generated
12
Cargo.lock
generated
|
|
@ -271,9 +271,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
|
|||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.5.0"
|
||||
version = "1.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
||||
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
||||
|
||||
[[package]]
|
||||
name = "aws-lc-rs"
|
||||
|
|
@ -2987,9 +2987,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.149"
|
||||
version = "1.0.150"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
|
||||
checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"memchr",
|
||||
|
|
@ -3420,7 +3420,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
|||
[[package]]
|
||||
name = "ttp-core"
|
||||
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 = [
|
||||
"base64 0.22.1",
|
||||
"byteorder",
|
||||
|
|
@ -3433,7 +3433,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ttp-native"
|
||||
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 = [
|
||||
"quinn",
|
||||
"rustls",
|
||||
|
|
|
|||
|
|
@ -113,10 +113,9 @@ impl GeneralConnection {
|
|||
log_cv_out!(success_msg);
|
||||
let _ = self.sender.send(&success_msg).await;
|
||||
} else {
|
||||
let err_msg = CommunicationValue::new(
|
||||
CommunicationType::error_invalid_omikron_id,
|
||||
)
|
||||
.with_id(cv.get_id());
|
||||
let err_msg =
|
||||
CommunicationValue::new(CommunicationType::error_invalid_omikron_id)
|
||||
.with_id(cv.get_id());
|
||||
let _ = self.sender.send(&err_msg).await;
|
||||
}
|
||||
}
|
||||
|
|
@ -196,6 +195,12 @@ impl GeneralConnection {
|
|||
let response_cv = match response_cv {
|
||||
Ok(r) => r,
|
||||
Err(_) => {
|
||||
log_err!(
|
||||
*iota_id,
|
||||
PrintType::Iota,
|
||||
"Failed to get Iota data from Omega for iota_id={}",
|
||||
iota_id
|
||||
);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
|
@ -208,6 +213,12 @@ impl GeneralConnection {
|
|||
let pub_key = match load_public_key(base64_pub) {
|
||||
Some(pk) => pk,
|
||||
None => {
|
||||
log_err!(
|
||||
*iota_id,
|
||||
PrintType::Iota,
|
||||
"Failed to load public key for iota_id={}",
|
||||
iota_id
|
||||
);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
|
@ -363,7 +374,7 @@ impl GeneralConnection {
|
|||
.add_data(
|
||||
DataTypes::message,
|
||||
DataValue::Str(
|
||||
"Challenge response mismatch — authentication rejected".to_string(),
|
||||
"Challenge response mismatch; authentication rejected".to_string(),
|
||||
),
|
||||
);
|
||||
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();
|
||||
}
|
||||
ConnectionKind::AnonymousClient => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue