Do most of the proto and database groundwork for the new mediaName.

This commit is contained in:
Greyson Parrelli
2025-06-20 11:47:54 -04:00
committed by Cody Henthorne
parent e705495638
commit 38c8f852bf
431 changed files with 600 additions and 781 deletions

View File

@@ -749,15 +749,25 @@ message FilePointer {
}
message LocatorInfo {
// Must be non-empty if transitCdnKey or mediaName are set/nonempty.
// Must be non-empty if transitCdnKey or plaintextHash are set/nonempty.
// Otherwise must be empty.
bytes key = 1;
// From the sender of the attachment (incl. ourselves)
// Must be non-empty if transitCdnKey or mediaName are set/nonempty.
// Otherwise must be empty.
bytes digest = 2;
// Must be non-zero if transitCdnKey or mediaName are set/nonempty.
// Otherwise must be zero.
// Will be reserved once all clients start reading integrityCheck
bytes legacyDigest = 2;
oneof integrityCheck {
// Set if file was at one point downloaded and its plaintextHash was calculated
bytes plaintextHash = 10;
// Set if file has not been downloaded so its integrity has not been verified
// From the sender of the attachment
bytes encryptedDigest = 11;
}
// NB: This is the plaintext size, and empty content attachments are legal, so this
// may be zero even if transitCdnKey or mediaName are set/nonempty.
uint32 size = 3;
// Either both transit cdn key and number are set or neither should be set.
@@ -775,7 +785,9 @@ message FilePointer {
// Nonempty any time the attachment was downloaded and its
// digest validated, whether free tier or paid subscription.
string mediaName = 8;
// Will be reserved once all clients start reading integrityCheck,
// when mediaName will be derived from the plaintextHash and encryption key
string legacyMediaName = 8;
// Separate key used to encrypt this file for the local backup.
// Generally required for local backups.