Skip to content

Commit 53fb650

Browse files
KyleKotowickrobin-nitrokey
authored andcommitted
Fix to use serialized key length
1 parent e0a6a35 commit 53fb650

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use heapless_bytes::Bytes;
55
use serde::{Deserialize, Serialize};
6-
use trussed::config::MAX_KEY_MATERIAL_LENGTH;
6+
use trussed::types::SerializedKey;
77

88
/// Error type
99
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
@@ -40,7 +40,7 @@ pub struct RsaPublicParts<'d> {
4040
}
4141

4242
impl<'d> RsaPublicParts<'d> {
43-
pub fn serialize(&self) -> Result<Bytes<MAX_KEY_MATERIAL_LENGTH>, Error> {
43+
pub fn serialize(&self) -> Result<SerializedKey, Error> {
4444
use postcard::Error as PError;
4545
let vec = postcard::to_vec(self).map_err(|err| match err {
4646
PError::SerializeBufferFull => Error {
@@ -76,7 +76,7 @@ pub struct RsaImportFormat<'d> {
7676
}
7777

7878
impl<'d> RsaImportFormat<'d> {
79-
pub fn serialize(&self) -> Result<Bytes<MAX_KEY_MATERIAL_LENGTH>, Error> {
79+
pub fn serialize(&self) -> Result<SerializedKey, Error> {
8080
use postcard::Error as PError;
8181
let vec = postcard::to_vec(self).map_err(|err| match err {
8282
PError::SerializeBufferFull => Error {

0 commit comments

Comments
 (0)