Merge pull request #73 from snikket-im/fix-uploads-allow-for-gcm-tag

prosody: Add 16 bytes to upload limit to allow for appended GCM tag
This commit is contained in:
Matthew Wild 2021-11-09 16:17:50 +00:00 committed by GitHub
commit 8d16897cff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -263,8 +263,13 @@ Component ("share."..DOMAIN) "http_file_share"
http_host = "share."..DOMAIN
http_external_url = "https://share."..DOMAIN.."/"
end
http_file_share_size_limit = 1024 * 1024 * 100 -- 100MB
-- 128 bits (i.e. 16 bytes) is the maximum length of a GCM auth tag, which
-- is appended to encrypted uploads according to XEP-0454. This ensures we
-- allow files up to the size limit even if they are encrypted.
http_file_share_size_limit = (1024 * 1024 * 100) + 16 -- 100MB + 16 bytes
http_file_share_expire_after = 60 * 60 * 24 * RETENTION_DAYS -- N days
if UPLOAD_STORAGE_GB then
http_file_share_global_quota = 1024 * 1024 * 1024 * UPLOAD_STORAGE_GB
end