@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix file encoding migration

Summary:
See [[ https://discourse.phabricator-community.org/t/file-encryption-corruption-when-trying-to-encode-existing-files/1605 | Discourse ]]

When migrating to aes-256-cbc, integrity hashes were not updated, so data was not properly

Test Plan:
I ran [[ https://gist.github.com/kaendfinger/3e0d78350af0ebe4e74b2c8a79707bae | this test script ]] to ensure it worked.
I created some files with lipsum, ensured that after encoding them with aes-256-cbc, they were not able to be cat'd.
After applying this patch and rerunning the script, it worked successfully.

Reviewers: epriestley, amckinley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Tags: #files, #storage

Differential Revision: https://secure.phabricator.com/D19533

+2 -1
+2 -1
src/applications/files/storage/PhabricatorFile.php
··· 492 492 $this->setStorageFormat($format->getStorageFormatKey()); 493 493 $this->setStorageProperties($properties); 494 494 495 - list($identifier, $new_handle) = $this->writeToEngine( 495 + list($identifier, $new_handle, $integrity_hash) = $this->writeToEngine( 496 496 $engine, 497 497 $data, 498 498 $params); 499 499 500 500 $this->setStorageHandle($new_handle); 501 + $this->setIntegrityHash($integrity_hash); 501 502 $this->save(); 502 503 503 504 $this->deleteFileDataIfUnused(