summaryrefslogtreecommitdiffstats
path: root/verifier.h
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2018-10-11 00:44:17 +0200
committerTianjie Xu <xunchang@google.com>2018-10-12 20:12:08 +0200
commit825669802315fe11508f0e962490b77cfdfc6184 (patch)
treec889c946c0ecfe9b29d7cf2eeb4ba95c582fe9a7 /verifier.h
parentMerge "Use only signed/unsigned numbers with ParseInt/ParseUint respectively" (diff)
downloadandroid_bootable_recovery-825669802315fe11508f0e962490b77cfdfc6184.tar
android_bootable_recovery-825669802315fe11508f0e962490b77cfdfc6184.tar.gz
android_bootable_recovery-825669802315fe11508f0e962490b77cfdfc6184.tar.bz2
android_bootable_recovery-825669802315fe11508f0e962490b77cfdfc6184.tar.lz
android_bootable_recovery-825669802315fe11508f0e962490b77cfdfc6184.tar.xz
android_bootable_recovery-825669802315fe11508f0e962490b77cfdfc6184.tar.zst
android_bootable_recovery-825669802315fe11508f0e962490b77cfdfc6184.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 6fa8f2b0a..b13424126 100644
--- a/verifier.h
+++ b/verifier.h
@@ -17,6 +17,8 @@
#ifndef _RECOVERY_VERIFIER_H
#define _RECOVERY_VERIFIER_H
+#include <stdint.h>
+
#include <functional>
#include <memory>
#include <vector>
@@ -70,6 +72,10 @@ int verify_file(const unsigned char* addr, size_t length, const std::vector<Cert
bool load_keys(const char* filename, std::vector<Certificate>& certs);
+// 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);
+
#define VERIFY_SUCCESS 0
#define VERIFY_FAILURE 1