User tests: Successful: Unsuccessful:
Pull Request for Issue #43328
This PR adds a generic catch block that catches exceptions thrown in the TUF library. So far, we only caught attack-specific exceptions, internal errors, or errors related to metadata syntax error remained uncaught, making the site unusable.
Furthermore, it catches non-tuf exceptions from the HTTP library in our transport and converts them into TUF exceptions to also get them caught in the fetcher library.
We have to simulate an exception in the library in order to verify that the patch works. To do so, find the following code block in libraries/src/TUF/TufFetcher.php:
try {
// Refresh the data if needed, it will be written inside the DB, then we fetch it afterwards and return it to
// the caller
$updater->refresh();
// Persist the data as it was correctly fetched and verified
$storage->persist();
return $storage->read('targets');
} catch (\Exception $e) {
and replace it with
try {
throw new Tuf\Exception\TufException("Test TUF exception");
// Refresh the data if needed, it will be written inside the DB, then we fetch it afterwards and return it to
// the caller
$updater->refresh();
// Persist the data as it was correctly fetched and verified
$storage->persist();
return $storage->read('targets');
} catch (\Exception $e) {
Unhandled exception.
Proper system message shown, system remains usable.
Please select:
Documentation link for docs.joomla.org:
[x ] No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
[x ] No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Language & Strings Libraries |
Labels |
Added:
Language Change
PR-5.1-dev
|
I have tested this item ✅ successfully on fa179de
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-05-20 12:13:50 |
Closed_By | ⇒ | LadySolveig |
Thank you @SniperSister and also for testing and review @dautrich @brianteeman @Fedik
For the record: a user from the german forum has tested the patch and it solved a http-transport related issue, see: https://forum.joomla.de/thread/20986-failed-to-connect-to-update-joomla-org-port-443/?postID=154136#post154136