Encrypt private media before fragmentation

This commit is contained in:
jack
2026-07-26 02:08:56 +02:00
committed by jack
parent 974510ad9e
commit a31cd80027
25 changed files with 892 additions and 137 deletions
+4
View File
@@ -79,6 +79,9 @@ enum NoisePayloadType: UInt8 {
case groupKeyUpdate = 0x07 // Creator-signed group state (key rotation / roster update)
// Live voice (push-to-talk)
case voiceFrame = 0x08 // One live voice-burst packet (see VoiceBurstPacket)
// Finalized private media. The complete BitchatFilePacket is encrypted
// inside Noise before the outer noiseEncrypted packet is fragmented.
case privateFile = 0x09
// Verification (QR-based OOB binding)
case verifyChallenge = 0x10 // Verification challenge
case verifyResponse = 0x11 // Verification response
@@ -93,6 +96,7 @@ enum NoisePayloadType: UInt8 {
case .groupInvite: return "groupInvite"
case .groupKeyUpdate: return "groupKeyUpdate"
case .voiceFrame: return "voiceFrame"
case .privateFile: return "privateFile"
case .verifyChallenge: return "verifyChallenge"
case .verifyResponse: return "verifyResponse"
case .vouch: return "vouch"
@@ -3,5 +3,5 @@ import BitFoundation
extension PeerCapabilities {
/// Capabilities this build advertises in its announce packets.
/// Each feature adds its bit here when it ships.
static let localSupported: PeerCapabilities = [.vouch, .prekeys, .groups]
static let localSupported: PeerCapabilities = [.vouch, .prekeys, .groups, .privateMedia]
}