mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
place the public key in the correct location
This commit is contained in:
parent
3c341d0f8e
commit
4413b95162
1 changed files with 6 additions and 10 deletions
|
|
@ -1,9 +1,7 @@
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use bao1x_api::signatures::{
|
use bao1x_api::signatures::{FunctionCode, PADDING_LEN, Pubkey, SIGBLOCK_LEN, SealedFields, UNSIGNED_LEN};
|
||||||
FunctionCode, PADDING_LEN, PUBLIC_KEY_LENGTH, SIGBLOCK_LEN, SealedFields, UNSIGNED_LEN,
|
|
||||||
};
|
|
||||||
use ed25519_dalek::{DigestSigner, SigningKey};
|
use ed25519_dalek::{DigestSigner, SigningKey};
|
||||||
use pkcs8::PrivateKeyInfo;
|
use pkcs8::PrivateKeyInfo;
|
||||||
use pkcs8::der::Decodable;
|
use pkcs8::der::Decodable;
|
||||||
|
|
@ -216,14 +214,12 @@ pub fn sign_image(
|
||||||
reserved: 0,
|
reserved: 0,
|
||||||
min_semver: minver_bytes,
|
min_semver: minver_bytes,
|
||||||
semver,
|
semver,
|
||||||
pubkeys: [
|
pubkeys: [Pubkey::default(), Pubkey::default(), Pubkey::default(), Pubkey::default()],
|
||||||
[0u8; PUBLIC_KEY_LENGTH],
|
|
||||||
[0u8; PUBLIC_KEY_LENGTH],
|
|
||||||
[0u8; PUBLIC_KEY_LENGTH],
|
|
||||||
[0u8; PUBLIC_KEY_LENGTH],
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
sealed_fields.pubkeys[3].copy_from_slice(sk.public_key().as_ref());
|
sealed_fields.pubkeys[3].aad_len = 0;
|
||||||
|
sealed_fields.pubkeys[3].pk.copy_from_slice(sk.public_key().as_ref());
|
||||||
|
sealed_fields.pubkeys[3].tag =
|
||||||
|
u32::from_le_bytes(*bao1x_api::signatures::KEYSLOT_INITIAL_TAGS[3]);
|
||||||
|
|
||||||
let mut protected = Vec::new();
|
let mut protected = Vec::new();
|
||||||
protected.extend_from_slice(sealed_fields.as_ref());
|
protected.extend_from_slice(sealed_fields.as_ref());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue