Skip to content

[stable33] fix(encryption): keep version and size in sync for files not in the cache - #64483

Merged
susnux merged 1 commit into
stable33from
backport/64365/stable33
Sep 20, 2026
Merged

susnux merged 1 commit into
stable33from
backport/64365/stable33

Conversation

@backportbot

@backportbot backportbot Bot commented Sep 17, 2026

Copy link
Copy Markdown

Backport of #64365

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot backportbot Bot added this to the Nextcloud 33.0.10 milestone Sep 17, 2026
@susnux
susnux force-pushed the backport/64365/stable33 branch from 8e05387 to b925e71 Compare September 20, 2026 12:43
@susnux
susnux marked this pull request as ready for review September 20, 2026 12:45
@susnux
susnux requested a review from a team as a code owner September 20, 2026 12:45
@susnux
susnux requested review from icewind1991 and salmart-dev and removed request for a team September 20, 2026 12:45
…ache

A file written through a stream has no file cache entry until the caller
scans it, but both inputs of the block signature are read from that entry:
stream_close() can only bump `encryptedVersion` if the entry exists, while
the reader got version 0 instead of the 1 the blocks were signed with, and
filesize() returned the wrapped storage's ciphertext size, which moved the
'end' position marker to the wrong block. Reading such a file back - e.g.
moving a part file to a target on another storage - failed with
"Bad Signature".

Treat a missing version as 1 on read, and let the size tracked while
writing win over the wrapped storage's size even without a cache entry.
Also stop reading `encryptedVersion` off a missing source entry when
updating the encrypted version of a copy or rename.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnux force-pushed the backport/64365/stable33 branch from b925e71 to 7a3e96f Compare September 20, 2026 22:04
@susnux
susnux merged commit c1c5e71 into stable33 Sep 20, 2026
171 of 172 checks passed
@susnux
susnux deleted the backport/64365/stable33 branch September 20, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants