binder: Move no-verify test objects to libbinder_tls_test_utils
... so that it can be used in fuzzer.
Test: pass
Bug: 195598155
Change-Id: If71af5f70b2477b93d692878d59d98cfe3aaec14
diff --git a/libs/binder/tests/binderRpcBenchmark.cpp b/libs/binder/tests/binderRpcBenchmark.cpp
index f8b1686..6bf6e92 100644
--- a/libs/binder/tests/binderRpcBenchmark.cpp
+++ b/libs/binder/tests/binderRpcBenchmark.cpp
@@ -49,6 +49,7 @@
using android::RpcAuthPreSigned;
using android::RpcCertificateFormat;
using android::RpcCertificateVerifier;
+using android::RpcCertificateVerifierNoOp;
using android::RpcServer;
using android::RpcSession;
using android::RpcTransportCtxFactory;
@@ -89,13 +90,6 @@
Transport::RPC_TLS,
};
-// Certificate validation happens during handshake and does not affect the result of benchmarks.
-// Skip certificate validation to simplify the setup process.
-class RpcCertificateVerifierNoOp : public RpcCertificateVerifier {
-public:
- status_t verify(const SSL*, uint8_t*) override { return OK; }
-};
-
std::unique_ptr<RpcTransportCtxFactory> makeFactoryTls() {
auto pkey = android::makeKeyPairForSelfSignedCert();
CHECK_NE(pkey.get(), nullptr);
@@ -108,6 +102,8 @@
}
static sp<RpcSession> gSession = RpcSession::make();
+// Certificate validation happens during handshake and does not affect the result of benchmarks.
+// Skip certificate validation to simplify the setup process.
static sp<RpcSession> gSessionTls = RpcSession::make(makeFactoryTls());
#ifdef __BIONIC__
static const String16 kKernelBinderInstance = String16(u"binderRpcBenchmark-control");