summaryrefslogtreecommitdiffstats
path: root/tests/component/verifier_test.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-03-27 19:21:01 +0100
committerandroid-build-merger <android-build-merger@google.com>2019-03-27 19:21:01 +0100
commit3de9ee62b84586523d1fa78129d36661d7d09a2b (patch)
tree2be8560dae4dfc7cf748d295d7c57da9a8973de7 /tests/component/verifier_test.cpp
parentMerge "Move out the code to parse block map in MemMap" (diff)
parentMerge "Allow RSA 4096 key in package verification" (diff)
downloadandroid_bootable_recovery-3de9ee62b84586523d1fa78129d36661d7d09a2b.tar
android_bootable_recovery-3de9ee62b84586523d1fa78129d36661d7d09a2b.tar.gz
android_bootable_recovery-3de9ee62b84586523d1fa78129d36661d7d09a2b.tar.bz2
android_bootable_recovery-3de9ee62b84586523d1fa78129d36661d7d09a2b.tar.lz
android_bootable_recovery-3de9ee62b84586523d1fa78129d36661d7d09a2b.tar.xz
android_bootable_recovery-3de9ee62b84586523d1fa78129d36661d7d09a2b.tar.zst
android_bootable_recovery-3de9ee62b84586523d1fa78129d36661d7d09a2b.zip
Diffstat (limited to 'tests/component/verifier_test.cpp')
-rw-r--r--tests/component/verifier_test.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/component/verifier_test.cpp b/tests/component/verifier_test.cpp
index c904cd038..bdb8af231 100644
--- a/tests/component/verifier_test.cpp
+++ b/tests/component/verifier_test.cpp
@@ -158,6 +158,17 @@ TEST(VerifierTest, LoadCertificateFromBuffer_sha256_ec256bits) {
VerifyPackageWithSingleCertificate("otasigned_v5.zip", std::move(cert));
}
+TEST(VerifierTest, LoadCertificateFromBuffer_sha256_rsa4096_bits) {
+ Certificate cert(0, Certificate::KEY_TYPE_RSA, nullptr, nullptr);
+ LoadKeyFromFile(from_testdata_base("testkey_4096bits.x509.pem"), &cert);
+
+ ASSERT_EQ(SHA256_DIGEST_LENGTH, cert.hash_len);
+ ASSERT_EQ(Certificate::KEY_TYPE_RSA, cert.key_type);
+ ASSERT_EQ(nullptr, cert.ec);
+
+ VerifyPackageWithSingleCertificate("otasigned_4096bits.zip", std::move(cert));
+}
+
TEST(VerifierTest, LoadCertificateFromBuffer_check_rsa_keys) {
std::unique_ptr<RSA, RSADeleter> rsa(RSA_new());
std::unique_ptr<BIGNUM, decltype(&BN_free)> exponent(BN_new(), BN_free);