This commit is contained in:
parent
bbb9a2d6c2
commit
1efcb8837c
2 changed files with 34 additions and 24 deletions
|
|
@ -539,7 +539,8 @@ impl MTPClient {
|
|||
.add_typed_default(DataType::Version, DataValue::Str(version_str.clone()))
|
||||
.add_typed_default(DataType::PublicKeys, DataValue::Bytes(pk_bytes.clone()));
|
||||
if let Some(desc) = &config.description {
|
||||
register = register.add_typed_default(DataType::Description, DataValue::Str(desc.clone()));
|
||||
register =
|
||||
register.add_typed_default(DataType::Description, DataValue::Str(desc.clone()));
|
||||
}
|
||||
if let Err(e) = sender.send(®ister).await {
|
||||
sender.close();
|
||||
|
|
|
|||
|
|
@ -251,7 +251,9 @@ impl MTPHost {
|
|||
Some(v) => v,
|
||||
None => return Err(AcceptError::MissingVersion),
|
||||
};
|
||||
let negotiated = match self.registry.negotiate(std::slice::from_ref(&client_version))
|
||||
let negotiated = match self
|
||||
.registry
|
||||
.negotiate(std::slice::from_ref(&client_version))
|
||||
{
|
||||
Some(v) => v,
|
||||
None => return Err(AcceptError::UnsupportedVersion(client_version)),
|
||||
|
|
@ -288,7 +290,9 @@ impl MTPHost {
|
|||
Some(v) => v,
|
||||
None => return Err(AcceptError::MissingVersion),
|
||||
};
|
||||
let negotiated = match self.registry.negotiate(std::slice::from_ref(&client_version))
|
||||
let negotiated = match self
|
||||
.registry
|
||||
.negotiate(std::slice::from_ref(&client_version))
|
||||
{
|
||||
Some(v) => v,
|
||||
None => return Err(AcceptError::UnsupportedVersion(client_version)),
|
||||
|
|
@ -435,7 +439,16 @@ impl MTPHost {
|
|||
));
|
||||
};
|
||||
|
||||
self.complete_auth_handshake(sender, receiver, flow, response_type, &version_str, client_version, description).await
|
||||
self.complete_auth_handshake(
|
||||
sender,
|
||||
receiver,
|
||||
flow,
|
||||
response_type,
|
||||
&version_str,
|
||||
client_version,
|
||||
description,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -455,7 +468,7 @@ impl MTPHost {
|
|||
description: Option<String>,
|
||||
) -> Result<Option<MTPConnection>, AcceptError> {
|
||||
use mtp_crypto::{
|
||||
auth, verify_ed25519, verify_ml_dsa, Ed25519Signer, MlDsaSigner, SignatureScheme,
|
||||
Ed25519Signer, MlDsaSigner, SignatureScheme, auth, verify_ed25519, verify_ml_dsa,
|
||||
};
|
||||
|
||||
let tm = mtp_codec::TypeMap::latest();
|
||||
|
|
@ -688,7 +701,9 @@ impl MTPHost {
|
|||
})?,
|
||||
_ => {
|
||||
sender.close();
|
||||
return Err(AcceptError::AuthenticationFailed("missing public keys".into()));
|
||||
return Err(AcceptError::AuthenticationFailed(
|
||||
"missing public keys".into(),
|
||||
));
|
||||
}
|
||||
};
|
||||
let pk_bytes = bundle.as_bytes();
|
||||
|
|
@ -696,10 +711,7 @@ impl MTPHost {
|
|||
.complete_auth_handshake(
|
||||
sender,
|
||||
receiver,
|
||||
Flow::Register {
|
||||
bundle,
|
||||
pk_bytes,
|
||||
},
|
||||
Flow::Register { bundle, pk_bytes },
|
||||
mtp_codec::CommunicationType::RegisterResponse,
|
||||
&version_str,
|
||||
client_version,
|
||||
|
|
@ -722,10 +734,7 @@ impl MTPHost {
|
|||
.complete_auth_handshake(
|
||||
sender,
|
||||
receiver,
|
||||
Flow::Login {
|
||||
id: cid,
|
||||
bundle,
|
||||
},
|
||||
Flow::Login { id: cid, bundle },
|
||||
mtp_codec::CommunicationType::IdentificationResponse,
|
||||
&version_str,
|
||||
client_version,
|
||||
|
|
|
|||
Loading…
Reference in a new issue