Upgrade signing key generation (#379)

* adds the upgrade signing key generation and the partition offset

* use openssl in build.rs instead
This commit is contained in:
kaczmarczyck
2021-09-15 21:25:19 +02:00
committed by GitHub
parent 7a975acf33
commit 596b47886c
9 changed files with 87 additions and 31 deletions

View File

@@ -57,6 +57,10 @@ impl UpgradeStorage for BufferUpgradeStorage {
}
}
fn partition_address(&self) -> usize {
0x60000
}
fn partition_length(&self) -> usize {
PARTITION_LENGTH
}

View File

@@ -317,6 +317,10 @@ impl UpgradeStorage for SyscallUpgradeStorage {
}
}
fn partition_address(&self) -> usize {
self.partition.start()
}
fn partition_length(&self) -> usize {
self.partition.length()
}

View File

@@ -34,6 +34,9 @@ pub trait UpgradeStorage {
/// Returns [`StorageError::OutOfBounds`] if the data does not fit the partition.
fn write_partition(&mut self, offset: usize, data: &[u8]) -> StorageResult<()>;
/// Returns the address of the partition.
fn partition_address(&self) -> usize;
/// Returns the length of the partition.
fn partition_length(&self) -> usize;