Skip to content

Commit

Permalink
fix: update to fix compile issue
Browse files Browse the repository at this point in the history
The code is not compilable due to the below error:

could not find `sign` in `cose`

Signed-off-by: Dave Chen <dave.chen@arm.com>
  • Loading branch information
chendave authored and setrofim committed Oct 13, 2023
1 parent 5b41088 commit 6bbf358
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::error::Error;
use crate::id::VerifierID;
use crate::nonce::Nonce;
use crate::trust::tier::TrustTier;
use cose::message::CoseMessage;

#[allow(clippy::upper_case_acronyms)]
enum KeyFormat {
Expand Down Expand Up @@ -151,7 +152,7 @@ impl Ear {
}

fn from_cose(token: &[u8], key: &cose::keys::CoseKey) -> Result<Self, Error> {
let mut sign1 = cose::sign::CoseSign::new();
let mut sign1 = CoseMessage::new_sign();

sign1.bytes = token.to_vec();
sign1.init_decoder(None).unwrap();
Expand Down Expand Up @@ -290,7 +291,7 @@ impl Ear {
ciborium::ser::into_writer(self, &mut payload)
.map_err(|e| Error::SignError(e.to_string()))?;

let mut sign1 = cose::sign::CoseSign::new();
let mut sign1 = CoseMessage::new_sign();
sign1.payload(payload);
sign1.header.alg(alg, true, false);

Expand All @@ -307,7 +308,7 @@ impl Ear {
.map_err(|e| Error::SignError(format!("{e:?}")))?;

sign1
.gen_signature(None)
.secure_content(None)
.map_err(|e| Error::SignError(format!("{e:?}")))?;
sign1
.encode(true)
Expand Down

0 comments on commit 6bbf358

Please sign in to comment.