Skip to content

Commit e3d5561

Browse files
Merge pull request #682 from tgonzalezorlandoarm/fix-compilation-issues
Fix compilation issues
2 parents f46e326 + 7ccec89 commit e3d5561

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

e2e_tests/tests/per_provider/normal_tests/capability_discovery.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ fn rsa_encrypt_use_check() {
6363
feature = "mbed-crypto-provider",
6464
feature = "trusted-service-provider",
6565
))]
66-
let supported_algs = all_algs.clone();
66+
let supported_algs = vec![
67+
AsymmetricEncryption::RsaPkcs1v15Crypt {},
68+
AsymmetricEncryption::RsaOaep {
69+
hash_alg: Hash::Sha256,
70+
},
71+
];
6772

6873
#[cfg(feature = "cryptoauthlib-provider")]
6974
let supported_algs = vec![];
@@ -178,7 +183,19 @@ fn hash_use_check() {
178183
];
179184

180185
#[cfg(any(feature = "mbed-crypto-provider", feature = "trusted-service-provider",))]
181-
let supported_hashes = all_hashes.clone();
186+
let supported_hashes = vec![
187+
Hash::Ripemd160,
188+
Hash::Sha224,
189+
Hash::Sha256,
190+
Hash::Sha384,
191+
Hash::Sha512,
192+
Hash::Sha512_224,
193+
Hash::Sha512_256,
194+
Hash::Sha3_224,
195+
Hash::Sha3_256,
196+
Hash::Sha3_384,
197+
Hash::Sha3_512,
198+
];
182199

183200
#[cfg(feature = "tpm-provider")]
184201
let supported_hashes = vec![

src/providers/mbed_crypto/asym_sign.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ impl Provider {
1515
op: psa_sign_hash::Operation,
1616
) -> Result<psa_sign_hash::Result> {
1717
let key_name = op.key_name.clone();
18-
let hash = op.hash.clone();
1918
let alg = op.alg;
2019
let key_identity = KeyIdentity::new(
2120
application_identity.clone(),
@@ -36,7 +35,7 @@ impl Provider {
3635

3736
op.validate(key_attributes)?;
3837

39-
match asym_signature::sign_hash(id, alg, &hash, &mut signature) {
38+
match asym_signature::sign_hash(id, alg, &(op.hash), &mut signature) {
4039
Ok(size) => {
4140
signature.resize(size, 0);
4241
Ok(psa_sign_hash::Result {
@@ -57,9 +56,7 @@ impl Provider {
5756
op: psa_verify_hash::Operation,
5857
) -> Result<psa_verify_hash::Result> {
5958
let key_name = op.key_name.clone();
60-
let hash = op.hash.clone();
6159
let alg = op.alg;
62-
let signature = op.signature.clone();
6360
let key_identity = KeyIdentity::new(
6461
application_identity.clone(),
6562
self.provider_identity.clone(),
@@ -77,7 +74,7 @@ impl Provider {
7774
op.validate(key_attributes)?;
7875

7976
let id = key::Id::from_persistent_key_id(key_id)?;
80-
match asym_signature::verify_hash(id, alg, &hash, &signature) {
77+
match asym_signature::verify_hash(id, alg, &(op.hash), &(op.signature)) {
8178
Ok(()) => Ok(psa_verify_hash::Result {}),
8279
Err(error) => {
8380
let error = ResponseStatus::from(error);

0 commit comments

Comments
 (0)