binder: Add tests for using pre-signed certificates.
Test: binderRpcTest
Fixes: 199344157
Change-Id: I0f9d8ce3d4fadecd197d87393f689bdeb35dbc56
diff --git a/libs/binder/tests/RpcAuthTesting.h b/libs/binder/tests/RpcAuthTesting.h
index fdc731d..c3c2df4 100644
--- a/libs/binder/tests/RpcAuthTesting.h
+++ b/libs/binder/tests/RpcAuthTesting.h
@@ -35,4 +35,15 @@
const uint32_t mValidSeconds;
};
+class RpcAuthPreSigned : public RpcAuth {
+public:
+ RpcAuthPreSigned(bssl::UniquePtr<EVP_PKEY> pkey, bssl::UniquePtr<X509> cert)
+ : mPkey(std::move(pkey)), mCert(std::move(cert)) {}
+ status_t configure(SSL_CTX* ctx) override;
+
+private:
+ bssl::UniquePtr<EVP_PKEY> mPkey;
+ bssl::UniquePtr<X509> mCert;
+};
+
} // namespace android