mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Fixing RSA tests not using the correct exponent
The Keymaster 4.0 HAL specifies that the public exponent for RSA is F4 (2^16+1). There were a few tests still using 3 as the exponent. This patch updates those incorrect exponents accordingly. Bug: 143404829 Test: atest VtsHalKeymasterV4_0TargetTest Change-Id: Ibc82a8a912bc5926bcdd544e0370e4185a888c0d
This commit is contained in:
@@ -527,9 +527,9 @@ TEST_F(NewKeyGenerationTest, Rsa) {
|
||||
HidlBuf key_blob;
|
||||
KeyCharacteristics key_characteristics;
|
||||
ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder()
|
||||
.RsaSigningKey(key_size, 3)
|
||||
.Digest(Digest::NONE)
|
||||
.Padding(PaddingMode::NONE),
|
||||
.RsaSigningKey(key_size, 65537)
|
||||
.Digest(Digest::NONE)
|
||||
.Padding(PaddingMode::NONE),
|
||||
&key_blob, &key_characteristics));
|
||||
|
||||
ASSERT_GT(key_blob.size(), 0U);
|
||||
@@ -579,11 +579,12 @@ TEST_F(NewKeyGenerationTest, NoInvalidRsaSizes) {
|
||||
for (auto key_size : InvalidKeySizes(Algorithm::RSA)) {
|
||||
HidlBuf key_blob;
|
||||
KeyCharacteristics key_characteristics;
|
||||
ASSERT_EQ(ErrorCode::UNSUPPORTED_KEY_SIZE, GenerateKey(AuthorizationSetBuilder()
|
||||
.RsaSigningKey(key_size, 3)
|
||||
.Digest(Digest::NONE)
|
||||
.Padding(PaddingMode::NONE),
|
||||
&key_blob, &key_characteristics));
|
||||
ASSERT_EQ(ErrorCode::UNSUPPORTED_KEY_SIZE,
|
||||
GenerateKey(AuthorizationSetBuilder()
|
||||
.RsaSigningKey(key_size, 65537)
|
||||
.Digest(Digest::NONE)
|
||||
.Padding(PaddingMode::NONE),
|
||||
&key_blob, &key_characteristics));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user