From bad8ba5ea2998cd105f8c11b80d916c47d57a66a Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 26 Oct 2022 23:40:09 +0800 Subject: [PATCH] tools: sign-image: write remainder of file During the previous port, we only wrote the first 4096 bytes. Write the remainder of the file to the destination. Signed-off-by: Sean Cross --- tools/src/bin/sign-image.rs | 6 +----- tools/src/sign_image.rs | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/src/bin/sign-image.rs b/tools/src/bin/sign-image.rs index 3d5fe2574..09e0329eb 100644 --- a/tools/src/bin/sign-image.rs +++ b/tools/src/bin/sign-image.rs @@ -1,12 +1,8 @@ use clap::{crate_version, App, Arg}; -use std::io::{Error, ErrorKind, Read, Write}; -use std::path::Path; +use std::io::{Error, ErrorKind}; use tools::sign_image::{load_pem, sign_file}; -use ring::signature::Ed25519KeyPair; - const DEVKEY_PATH: &str = "devkey/dev.key"; -const LOADER_VERSION: u32 = 1; use xous_semver::SemVer; diff --git a/tools/src/sign_image.rs b/tools/src/sign_image.rs index 86ddacd7d..2065ec1b6 100644 --- a/tools/src/sign_image.rs +++ b/tools/src/sign_image.rs @@ -84,6 +84,8 @@ pub fn sign_image( source[16778] ^= 0x1 // flip one bit at some random offset } + dest_file.write_all(&source)?; + Ok(dest_file) }