-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a software rollback protection policy in RoT update_server. #1809
base: master
Are you sure you want to change the base?
Changes from all commits
1f7abf1
38d7017
b381b21
e6be5ce
6f5d861
aca5140
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1567,7 +1567,7 @@ fn build_kernel( | |
/// Returns true if the header was found and updated, | ||
/// false otherwise. | ||
fn update_image_header( | ||
cfg: &PackageConfig, | ||
_cfg: &PackageConfig, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we just remove this argument, since it's now unused? |
||
input: &Path, | ||
output: &Path, | ||
map: &IndexMap<String, Range<u32>>, | ||
|
@@ -1606,16 +1606,8 @@ fn update_image_header( | |
// `xtask build kernel`, we need a result from this calculation | ||
// but `end` will be `None`. Substitute a placeholder: | ||
let end = end.unwrap_or(flash.start); | ||
|
||
let len = end - flash.start; | ||
|
||
let header = abi::ImageHeader { | ||
version: cfg.toml.version, | ||
epoch: cfg.toml.epoch, | ||
magic: abi::HEADER_MAGIC, | ||
total_image_len: len, | ||
..Default::default() | ||
}; | ||
let header = abi::ImageHeader::new(len); | ||
|
||
header | ||
.write_to_prefix( | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -242,6 +242,16 @@ impl From<RotSlot> for SlotId { | |||||||||||||||||||
} | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
impl SlotId { | ||||||||||||||||||||
pub fn other(&self) -> SlotId { | ||||||||||||||||||||
if *self == SlotId::A { | ||||||||||||||||||||
SlotId::B | ||||||||||||||||||||
} else { | ||||||||||||||||||||
SlotId::A | ||||||||||||||||||||
} | ||||||||||||||||||||
Comment on lines
+247
to
+251
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
slightly shorter, and will break loudly if someone adds a third slot |
||||||||||||||||||||
} | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
impl TryFrom<u16> for SlotId { | ||||||||||||||||||||
type Error = (); | ||||||||||||||||||||
fn try_from(i: u16) -> Result<Self, Self::Error> { | ||||||||||||||||||||
|
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.
I'm assuming this is an unrelated change which you discovered when building every
app-*.toml
?