Loading libs/binder/RpcTransportRaw.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -29,8 +29,6 @@ namespace android { namespace { // RpcTransport with TLS disabled. class RpcTransportRaw : public RpcTransport { public: Loading Loading @@ -96,8 +94,6 @@ public: std::vector<uint8_t> getCertificate(RpcCertificateFormat) const override { return {}; } }; } // namespace std::unique_ptr<RpcTransportCtx> RpcTransportCtxFactoryRaw::newServerCtx() const { return std::make_unique<RpcTransportCtxRaw>(); } Loading libs/binder/RpcTransportTipcAndroid.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -31,8 +31,6 @@ using android::base::Result; namespace android { namespace { // RpcTransport for writing Trusty IPC clients in Android. class RpcTransportTipcAndroid : public RpcTransport { public: Loading Loading @@ -217,8 +215,6 @@ public: std::vector<uint8_t> getCertificate(RpcCertificateFormat) const override { return {}; } }; } // namespace std::unique_ptr<RpcTransportCtx> RpcTransportCtxFactoryTipcAndroid::newServerCtx() const { return std::make_unique<RpcTransportCtxTipcAndroid>(); } Loading libs/binder/RpcTransportTls.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -275,6 +275,8 @@ private: bssl::UniquePtr<SSL> mSsl; }; } // namespace class RpcTransportTls : public RpcTransport { public: RpcTransportTls(RpcTransportFd socket, Ssl ssl) Loading Loading @@ -411,7 +413,8 @@ status_t RpcTransportTls::interruptableReadFully( } // For |ssl|, set internal FD to |fd|, and do handshake. Handshake is triggerable by |fdTrigger|. bool setFdAndDoHandshake(Ssl* ssl, const android::RpcTransportFd& socket, FdTrigger* fdTrigger) { static bool setFdAndDoHandshake(Ssl* ssl, const android::RpcTransportFd& socket, FdTrigger* fdTrigger) { bssl::UniquePtr<BIO> bio = newSocketBio(socket.fd); TEST_AND_RETURN(false, bio != nullptr); auto [_, errorQueue] = ssl->call(SSL_set_bio, bio.get(), bio.get()); Loading Loading @@ -540,8 +543,6 @@ protected: } }; } // namespace std::unique_ptr<RpcTransportCtx> RpcTransportCtxFactoryTls::newServerCtx() const { return android::RpcTransportCtxTls::create<RpcTransportCtxTlsServer>(mCertVerifier, mAuth.get()); Loading libs/binder/include/binder/RpcTransport.h +33 −3 Original line number Diff line number Diff line Loading @@ -39,6 +39,16 @@ namespace android { class FdTrigger; struct RpcTransportFd; // for 'friend' class RpcTransportRaw; class RpcTransportTls; class RpcTransportTipcAndroid; class RpcTransportTipcTrusty; class RpcTransportCtxRaw; class RpcTransportCtxTls; class RpcTransportCtxTipcAndroid; class RpcTransportCtxTipcTrusty; // Represents a socket connection. // No thread-safety is guaranteed for these APIs. class RpcTransport { Loading Loading @@ -92,7 +102,21 @@ public: */ [[nodiscard]] virtual bool isWaiting() = 0; protected: private: // limit the classes which can implement RpcTransport. Being able to change this // interface is important to allow development of RPC binder. In the past, we // changed this interface to use iovec for efficiency, and we added FDs to the // interface. If another transport is needed, it should be added directly here. // non-socket FDs likely also need changes in RpcSession in order to get // connected, and similarly to how addrinfo was type-erased from RPC binder // interfaces when RpcTransportTipc* was added, other changes may be needed // to add more transports. friend class ::android::RpcTransportRaw; friend class ::android::RpcTransportTls; friend class ::android::RpcTransportTipcAndroid; friend class ::android::RpcTransportTipcTrusty; RpcTransport() = default; }; Loading @@ -117,7 +141,13 @@ public: [[nodiscard]] virtual std::vector<uint8_t> getCertificate( RpcCertificateFormat format) const = 0; protected: private: // see comment on RpcTransport friend class ::android::RpcTransportCtxRaw; friend class ::android::RpcTransportCtxTls; friend class ::android::RpcTransportCtxTipcAndroid; friend class ::android::RpcTransportCtxTipcTrusty; RpcTransportCtx() = default; }; Loading @@ -140,7 +170,7 @@ protected: RpcTransportCtxFactory() = default; }; struct RpcTransportFd { struct RpcTransportFd final { private: mutable bool isPolling{false}; Loading libs/binder/trusty/RpcTransportTipcTrusty.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -29,8 +29,6 @@ namespace android { namespace { // RpcTransport for Trusty. class RpcTransportTipcTrusty : public RpcTransport { public: Loading Loading @@ -282,8 +280,6 @@ public: std::vector<uint8_t> getCertificate(RpcCertificateFormat) const override { return {}; } }; } // namespace std::unique_ptr<RpcTransportCtx> RpcTransportCtxFactoryTipcTrusty::newServerCtx() const { return std::make_unique<RpcTransportCtxTipcTrusty>(); } Loading Loading
libs/binder/RpcTransportRaw.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -29,8 +29,6 @@ namespace android { namespace { // RpcTransport with TLS disabled. class RpcTransportRaw : public RpcTransport { public: Loading Loading @@ -96,8 +94,6 @@ public: std::vector<uint8_t> getCertificate(RpcCertificateFormat) const override { return {}; } }; } // namespace std::unique_ptr<RpcTransportCtx> RpcTransportCtxFactoryRaw::newServerCtx() const { return std::make_unique<RpcTransportCtxRaw>(); } Loading
libs/binder/RpcTransportTipcAndroid.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -31,8 +31,6 @@ using android::base::Result; namespace android { namespace { // RpcTransport for writing Trusty IPC clients in Android. class RpcTransportTipcAndroid : public RpcTransport { public: Loading Loading @@ -217,8 +215,6 @@ public: std::vector<uint8_t> getCertificate(RpcCertificateFormat) const override { return {}; } }; } // namespace std::unique_ptr<RpcTransportCtx> RpcTransportCtxFactoryTipcAndroid::newServerCtx() const { return std::make_unique<RpcTransportCtxTipcAndroid>(); } Loading
libs/binder/RpcTransportTls.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -275,6 +275,8 @@ private: bssl::UniquePtr<SSL> mSsl; }; } // namespace class RpcTransportTls : public RpcTransport { public: RpcTransportTls(RpcTransportFd socket, Ssl ssl) Loading Loading @@ -411,7 +413,8 @@ status_t RpcTransportTls::interruptableReadFully( } // For |ssl|, set internal FD to |fd|, and do handshake. Handshake is triggerable by |fdTrigger|. bool setFdAndDoHandshake(Ssl* ssl, const android::RpcTransportFd& socket, FdTrigger* fdTrigger) { static bool setFdAndDoHandshake(Ssl* ssl, const android::RpcTransportFd& socket, FdTrigger* fdTrigger) { bssl::UniquePtr<BIO> bio = newSocketBio(socket.fd); TEST_AND_RETURN(false, bio != nullptr); auto [_, errorQueue] = ssl->call(SSL_set_bio, bio.get(), bio.get()); Loading Loading @@ -540,8 +543,6 @@ protected: } }; } // namespace std::unique_ptr<RpcTransportCtx> RpcTransportCtxFactoryTls::newServerCtx() const { return android::RpcTransportCtxTls::create<RpcTransportCtxTlsServer>(mCertVerifier, mAuth.get()); Loading
libs/binder/include/binder/RpcTransport.h +33 −3 Original line number Diff line number Diff line Loading @@ -39,6 +39,16 @@ namespace android { class FdTrigger; struct RpcTransportFd; // for 'friend' class RpcTransportRaw; class RpcTransportTls; class RpcTransportTipcAndroid; class RpcTransportTipcTrusty; class RpcTransportCtxRaw; class RpcTransportCtxTls; class RpcTransportCtxTipcAndroid; class RpcTransportCtxTipcTrusty; // Represents a socket connection. // No thread-safety is guaranteed for these APIs. class RpcTransport { Loading Loading @@ -92,7 +102,21 @@ public: */ [[nodiscard]] virtual bool isWaiting() = 0; protected: private: // limit the classes which can implement RpcTransport. Being able to change this // interface is important to allow development of RPC binder. In the past, we // changed this interface to use iovec for efficiency, and we added FDs to the // interface. If another transport is needed, it should be added directly here. // non-socket FDs likely also need changes in RpcSession in order to get // connected, and similarly to how addrinfo was type-erased from RPC binder // interfaces when RpcTransportTipc* was added, other changes may be needed // to add more transports. friend class ::android::RpcTransportRaw; friend class ::android::RpcTransportTls; friend class ::android::RpcTransportTipcAndroid; friend class ::android::RpcTransportTipcTrusty; RpcTransport() = default; }; Loading @@ -117,7 +141,13 @@ public: [[nodiscard]] virtual std::vector<uint8_t> getCertificate( RpcCertificateFormat format) const = 0; protected: private: // see comment on RpcTransport friend class ::android::RpcTransportCtxRaw; friend class ::android::RpcTransportCtxTls; friend class ::android::RpcTransportCtxTipcAndroid; friend class ::android::RpcTransportCtxTipcTrusty; RpcTransportCtx() = default; }; Loading @@ -140,7 +170,7 @@ protected: RpcTransportCtxFactory() = default; }; struct RpcTransportFd { struct RpcTransportFd final { private: mutable bool isPolling{false}; Loading
libs/binder/trusty/RpcTransportTipcTrusty.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -29,8 +29,6 @@ namespace android { namespace { // RpcTransport for Trusty. class RpcTransportTipcTrusty : public RpcTransport { public: Loading Loading @@ -282,8 +280,6 @@ public: std::vector<uint8_t> getCertificate(RpcCertificateFormat) const override { return {}; } }; } // namespace std::unique_ptr<RpcTransportCtx> RpcTransportCtxFactoryTipcTrusty::newServerCtx() const { return std::make_unique<RpcTransportCtxTipcTrusty>(); } Loading