mirror of
https://github.com/chenxiaolong/avbroot.git
synced 2026-07-03 14:05:11 +02:00
Add more context for avb::Header::set_algo_for_key() calls
Previously, it was not always obvious which key was problematic. Issue: #366 Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This commit is contained in:
@@ -398,7 +398,9 @@ fn sign_or_clear(info: &mut AvbInfo, orig_header: &Header, key_group: &KeyGroup)
|
||||
RsaSigningKey::Internal(private_key)
|
||||
};
|
||||
|
||||
info.header.set_algo_for_key(&signing_key)?;
|
||||
info.header
|
||||
.set_algo_for_key(&signing_key)
|
||||
.context("Failed to set signature algorithm")?;
|
||||
info.header
|
||||
.sign(&signing_key)
|
||||
.context("Failed to sign new AVB header")?;
|
||||
|
||||
@@ -593,7 +593,9 @@ fn update_vbmeta_headers(
|
||||
// have no dependencies and are only being processed to ensure that the
|
||||
// flags are set to a sane value.
|
||||
if parent_header != &orig_parent_header {
|
||||
parent_header.set_algo_for_key(key)?;
|
||||
parent_header
|
||||
.set_algo_for_key(key)
|
||||
.with_context(|| format!("Failed to set signature algorithm: {name}"))?;
|
||||
parent_header
|
||||
.sign(key)
|
||||
.with_context(|| format!("Failed to sign vbmeta header for image: {name}"))?;
|
||||
|
||||
Reference in New Issue
Block a user