[WIP] Security work While on holiday

This commit is contained in:
Alex 2026-08-12 22:45:28 +02:00
commit 7f0231e3f1
Signed by: alex
SSH key fingerprint: SHA256:D1+Ub8o0v4K5y1JNivW8IxEOelqLSvPmUzBbDIoZkRQ
109 changed files with 19694 additions and 5210 deletions

View file

@ -28,7 +28,10 @@ pub use pipe::PipeRequest;
pub use mtp_codec::registry::Registry;
#[cfg(feature = "crypto")]
pub use config::{AuthenticationPolicy, CompleteRegister, GetExistingClient, GuestIdGenerator};
pub use config::{
AuthenticationPolicy, CompleteRegister, FindRegisteredClient, GetExistingClient,
GuestIdGenerator,
};
#[cfg(feature = "crypto")]
pub use error::AuthState;
@ -51,9 +54,9 @@ mod tests {
fn version_extraction() {
let tm = mtp_codec::TypeMap::latest();
let msg = mtp_codec::CommunicationValue::from_comm(CommunicationType::Identification, &tm)
.add_typed(DataType::Version, &tm, DataValue::Str("2.0".to_string()));
.add_typed(DataType::Version, &tm, DataValue::Str("3.0".to_string()));
let version = error::extract_version(&msg);
assert_eq!(version, Some(mtp_codec::Version(2, 0)));
assert_eq!(version, Some(mtp_codec::Version(3, 0)));
}
#[test]
@ -92,7 +95,7 @@ mod tests {
#[tokio::test]
async fn alternative_transports_use_the_shared_connection_type() {
let registry = Registry::builtin();
let version = mtp_codec::Version(1, 0);
let version = mtp_codec::Version(3, 0);
let codec = VersionedCodec::for_version(registry, version.clone()).unwrap();
let connection: MTPConnection<AlternateSender, AlternateReceiver> =
MTPConnection::from_transport_parts(