summaryrefslogtreecommitdiffstats
path: root/verifier.h
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2018-10-25 06:18:29 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-10-25 06:18:29 +0200
commitaa7d7f122a2cc62c82ddd4bffb816887799c2af9 (patch)
tree05ff31a44b186b7b0b80096cdec4c096f5f6afb7 /verifier.h
parentMerge "minui: Cleanup GRSurfaceDrm and MinuiBackendDrm." am: c17c819693 (diff)
parentMerge "Add sanity check when loading public keys for OTA package" (diff)
downloadandroid_bootable_recovery-aa7d7f122a2cc62c82ddd4bffb816887799c2af9.tar
android_bootable_recovery-aa7d7f122a2cc62c82ddd4bffb816887799c2af9.tar.gz
android_bootable_recovery-aa7d7f122a2cc62c82ddd4bffb816887799c2af9.tar.bz2
android_bootable_recovery-aa7d7f122a2cc62c82ddd4bffb816887799c2af9.tar.lz
android_bootable_recovery-aa7d7f122a2cc62c82ddd4bffb816887799c2af9.tar.xz
android_bootable_recovery-aa7d7f122a2cc62c82ddd4bffb816887799c2af9.tar.zst
android_bootable_recovery-aa7d7f122a2cc62c82ddd4bffb816887799c2af9.zip
Diffstat (limited to 'verifier.h')
-rw-r--r--verifier.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/verifier.h b/verifier.h
index b7924c71f..944823293 100644
--- a/verifier.h
+++ b/verifier.h
@@ -72,6 +72,12 @@ int verify_file(const unsigned char* addr, size_t length, const std::vector<Cert
bool load_keys(const char* filename, std::vector<Certificate>& certs);
+// Checks that the RSA key has a modulus of 2048 bits long, and public exponent is 3 or 65537.
+bool CheckRSAKey(const std::unique_ptr<RSA, RSADeleter>& rsa);
+
+// Checks that the field size of the curve for the EC key is 256 bits.
+bool CheckECKey(const std::unique_ptr<EC_KEY, ECKEYDeleter>& ec_key);
+
// Parses a PEM-encoded x509 certificate from the given buffer and saves it into |cert|. Returns
// false if there is a parsing failure or the signature's encryption algorithm is not supported.
bool LoadCertificateFromBuffer(const std::vector<uint8_t>& pem_content, Certificate* cert);