-
Notifications
You must be signed in to change notification settings - Fork 61
Fix/ota 4941/installed version matching #1666
Conversation
@@ -115,7 +115,7 @@ void ImageRepository::fetchTargets(INvStorage& storage, const IMetadataFetcher& | |||
verifyTargets(image_targets, false); | |||
|
|||
if (local_version > remote_version) { | |||
throw Uptane::SecurityException(RepositoryType::IMAGE, "Mismatched target versions"); | |||
throw Uptane::SecurityException(RepositoryType::IMAGE, "Rollback attempt"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks like smth which deserves big bold red error in the log output. Is this done where this exception is caught?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I believe so, although the real tragedy is we don't think we make this particularly obvious in the web UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I though there's a ticket for that but can't find it now.
@@ -110,6 +110,7 @@ bool PackageManagerFake::fetchTarget(const Uptane::Target& target, Uptane::Fetch | |||
return false; | |||
} | |||
|
|||
// TODO(OTA-4939): Unify this and make it more generic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps explicitly saying unification with what exactly is desired would be helpful in future? Like function name or file for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point, done.
Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Functionally should be no change. I'm just trying to make the online and offline metadata checks as similar as possible, as well as the handling of the Director and Image repo. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Specifically, if metadata content changes but the version is not updated. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
This is the same function used for matching Targets from the Director and Image repo. Notably, it also matches hashes and length. Functionally, this shouldn't change much in practice, but if a Target is received in the Director Targets metadata that matches the filename of the currently installed version but *not* the length and/or hashes, we throw an error, since that is unexpected. This is covered by a test. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
5173bcc
to
1230c4f
Compare
Codecov Report
@@ Coverage Diff @@
## master #1666 +/- ##
=======================================
Coverage 82.68% 82.69%
=======================================
Files 191 191
Lines 12088 12088
=======================================
+ Hits 9995 9996 +1
+ Misses 2093 2092 -1
Continue to review full report at Codecov.
|
No description provided.