summaryrefslogtreecommitdiffstats
path: root/tests/component
diff options
context:
space:
mode:
authorxunchang <xunchang@google.com>2019-03-26 17:54:34 +0100
committerxunchang <xunchang@google.com>2019-03-26 20:28:23 +0100
commit908ad77af8731c0e8a7645575ea71fbbdd404d41 (patch)
treee348ee403e9305962978ec7e326245a8e3b1d8da /tests/component
parentMerge "Move librecovery_ui to a sub-directory" (diff)
downloadandroid_bootable_recovery-908ad77af8731c0e8a7645575ea71fbbdd404d41.tar
android_bootable_recovery-908ad77af8731c0e8a7645575ea71fbbdd404d41.tar.gz
android_bootable_recovery-908ad77af8731c0e8a7645575ea71fbbdd404d41.tar.bz2
android_bootable_recovery-908ad77af8731c0e8a7645575ea71fbbdd404d41.tar.lz
android_bootable_recovery-908ad77af8731c0e8a7645575ea71fbbdd404d41.tar.xz
android_bootable_recovery-908ad77af8731c0e8a7645575ea71fbbdd404d41.tar.zst
android_bootable_recovery-908ad77af8731c0e8a7645575ea71fbbdd404d41.zip
Diffstat (limited to 'tests/component')
-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);