Skip to content

Commit 85e4370

Browse files
Merge pull request #723 from tgonzalezorlandoarm/tg/tpm-testing-fix
e2e_tests/wrong_permitted_algorithm: Change used sha for hw compatibi…
2 parents e987290 + 3c4ea26 commit 85e4370

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

e2e_tests/Cargo.lock

Lines changed: 6 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e_tests/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,17 @@ impl TestClient {
522522
)
523523
}
524524

525+
/// Signs a short digest with an RSA key.
526+
pub fn sign_with_rsa_sha384(&mut self, key_name: String, hash: Vec<u8>) -> Result<Vec<u8>> {
527+
self.sign(
528+
key_name,
529+
AsymmetricSignature::RsaPkcs1v15Sign {
530+
hash_alg: Hash::Sha384.into(),
531+
},
532+
hash,
533+
)
534+
}
535+
525536
/// Signs a short digest with an ECDSA key.
526537
pub fn sign_with_ecdsa_sha256(&mut self, key_name: String, hash: Vec<u8>) -> Result<Vec<u8>> {
527538
self.sign(

e2e_tests/tests/per_provider/normal_tests/key_attributes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ fn wrong_permitted_algorithm() {
134134
// Do not permit RSA PKCS 1v15 signing algorithm with SHA-256.
135135
let permitted_algorithm =
136136
Algorithm::AsymmetricSignature(AsymmetricSignature::RsaPkcs1v15Sign {
137-
hash_alg: Hash::Sha512.into(),
137+
hash_alg: Hash::Sha256.into(),
138138
});
139139
let mut usage_flags: UsageFlags = Default::default();
140140
let _ = usage_flags.set_sign_hash();
@@ -159,7 +159,7 @@ fn wrong_permitted_algorithm() {
159159
.unwrap();
160160

161161
let status = client
162-
.sign_with_rsa_sha256(key_name, vec![0xDE; 32])
162+
.sign_with_rsa_sha384(key_name, vec![0xDE; 32])
163163
.unwrap_err();
164164

165165
assert_eq!(status, ResponseStatus::PsaErrorNotPermitted);

0 commit comments

Comments
 (0)