From b996bb8afbc54391e38c03a92e6226d43aa8ecf8 Mon Sep 17 00:00:00 2001 From: Alex-Emmet Date: Mon, 28 Sep 2026 00:07:42 +0200 Subject: [PATCH] Add password and QR provisioning types --- app_protection.rs | 15 +++++++++++++++ type-maps.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 app_protection.rs diff --git a/app_protection.rs b/app_protection.rs new file mode 100644 index 0000000..2c76953 --- /dev/null +++ b/app_protection.rs @@ -0,0 +1,15 @@ +use mtp::codec::{ApplicationProtectionPurpose, ProtectionPurpose}; + +pub const REGISTRATION_ACTIVATION: u8 = 0x71; +pub const PASSWORD_MANAGEMENT_SIGNATURE: u8 = 0x72; +pub const PASSWORD_MANAGEMENT_ENCRYPTION: u8 = 0x73; +pub const PASSWORD_RESPONSE_SIGNATURE: u8 = 0x74; +pub const PASSWORD_RESPONSE_ENCRYPTION: u8 = 0x75; +pub const PROVISIONING_CREDENTIAL_SIGNATURE: u8 = 0x76; +pub const PROVISIONING_CREDENTIAL_ENCRYPTION: u8 = 0x77; + +pub fn purpose(value: u8) -> ProtectionPurpose { + ApplicationProtectionPurpose::new(value) + .expect("Tensamin application protection purpose must not be MTP-reserved") + .into() +} diff --git a/type-maps.yaml b/type-maps.yaml index cfe50bc..f98a585 100644 --- a/type-maps.yaml +++ b/type-maps.yaml @@ -168,6 +168,28 @@ type_maps: UserAssetDelete: 195 UserAssetChanged: 196 SessionActivitySet: 197 + ProvisioningCreate: 198 + ProvisioningCreated: 199 + ProvisioningJoin: 200 + ProvisioningPeerJoined: 201 + ProvisioningBindAccount: 202 + ProvisioningAccountBound: 203 + ProvisioningCancel: 204 + ProvisioningComplete: 205 + ProvisioningCredential: 206 + QrProvisioningConfirm: 207 + PasswordEnrollmentStart: 208 + PasswordEnrollmentResponse: 209 + PasswordEnrollmentFinish: 210 + PasswordEnrollmentStatus: 211 + PasswordEnrollmentDisable: 212 + PasswordProvisioningStart: 213 + PasswordProvisioningResponse: 214 + PasswordProvisioningFinish: 215 + CallContactCheck: 216 + CallEnvelopeStore: 217 + CallEnvelopeGet: 218 + CallContactAccept: 219 DataTypes: ErrorType: 32 @@ -365,3 +387,10 @@ type_maps: Foreground: 236 NotificationCapable: 237 SuppressNotification: 238 + ProvisioningMethod: 239 + ProvisioningRole: 240 + ProvisioningParticipantId: 241 + OpaqueMessage: 242 + EncryptedCredential: 243 + CredentialFormatVersion: 244 + CallInviterId: 245