Revert "Review: check if the target key is symmetric before use"

This reverts commit fdc90f35afa2db6be59969a5f1e49ca27ff9900a.

This is required to make Nitrokey Webcrypt working at the moment, but should be removed in the future.
This commit is contained in:
Szczepan Zalega
2023-06-29 13:09:42 +02:00
parent db6cf12bdc
commit 22f20000a2
+1 -2
View File
@@ -11,7 +11,6 @@ use trussed::{
types::{Bytes, CoreContext, KeyId, Location, Mechanism},
Error,
};
use trussed::key::Kind::Symmetric;
#[derive(Debug, Default)]
pub struct HmacSha256P256Extension;
@@ -148,7 +147,7 @@ pub fn derive_key_from_hash(
type HmacSha256P256 = Hmac<sha2::Sha256>;
let key_id = request.key;
let key = keystore.load_key(key::Secrecy::Secret, Some(Symmetric(32)), &key_id)?;
let key = keystore.load_key(key::Secrecy::Secret, None, &key_id)?;
let shared_secret = key.material;
let mut mac =