Skip to content

Commit

Permalink
removed debug prints and increased aslr variance
Browse files Browse the repository at this point in the history
  • Loading branch information
Athryx committed Mar 8, 2024
1 parent 4707357 commit 273a7d1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions application_processor/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ fn main() {

let sentry = 0x1000e200;

// by default ap is 196 kib
// by default ap is 192 kib
// this leaves about 8 kib of extra space in maximum size
let textoffset = gen_addr(0, 0x4000, &mut rng);
let textoffset = gen_addr(0, 0x5000, &mut rng);
let rodataoffset = 0;
let dataoffset = gen_addr(0, 0x1000, &mut rng);
let bssoffset = gen_addr(0, ram_length / 8, &mut rng);
Expand Down
15 changes: 7 additions & 8 deletions application_processor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ fn main() -> ! {
}

let mut driver = ApDriver::new();
driver.sleep(Duration::from_secs(1));
driver.sleep(Duration::from_millis(950));
let mut driver = Some(driver);

uprintln_info!("Application Processor Started");

led_on(Led::Blue);

let mut command_buf = [0u8; 16];
Expand All @@ -91,19 +89,20 @@ fn main() -> ! {
&_ => Err(ApError::InvalidCommand),
};

if let Err(error) = result {
uprintln_error!("{command}: {error}");
if let Err(_error) = result {
//uprintln_error!("{command}: {error}");
uprintln_error!("{command}");
}
}
}

#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
led_on(Led::Red);
fn panic(_info: &PanicInfo) -> ! {
/*led_on(Led::Red);
led_off(Led::Green);
led_off(Led::Blue);
uprintln_error!("Panic: {info}");
uprintln_error!("Panic: {info}");*/

loop {}
}
Expand Down
11 changes: 4 additions & 7 deletions component/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,13 @@ fn main() -> ! {
}

let mut driver = ComponentDriver::new();
driver.sleep(Duration::from_secs(1));
driver.sleep(Duration::from_millis(950));
let mut driver = Some(driver);

uprint_info!("Component Started");

led_on(Led::Green);

loop {
let Ok(command) = driver.as_mut().unwrap().recv_struct() else {
uprintln_error!("invalid command received");
continue;
};

Expand All @@ -95,12 +92,12 @@ fn main() -> ! {
}

#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
led_on(Led::Red);
fn panic(_info: &PanicInfo) -> ! {
/*led_on(Led::Red);
led_off(Led::Blue);
led_off(Led::Green);
uprintln_error!("{info}");
uprintln_error!("{info}");*/

loop {}
}
Expand Down
3 changes: 3 additions & 0 deletions deployment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub enum DeploymentError {
TooManyComponent,
}

#[derive(Debug)]
pub struct KeyPair {
pub pubkey: [u8; 32],
pub privkey: [u8; 32],
Expand All @@ -38,11 +39,13 @@ impl KeyPair {
}
}

#[derive(Debug)]
pub struct ComponentKeyPair {
pub build_id: u32,
pub keypair: KeyPair,
}

#[derive(Debug)]
pub struct GlobalSecrets {
pub hmac_key: [u8; 32],
pub attestation_data_enc_key: [u8; 32],
Expand Down

0 comments on commit 273a7d1

Please sign in to comment.