Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: webrtc/base/openssladapter.h

Issue 2877023002: Move webrtc/{base => rtc_base} (Closed)
Patch Set: update presubmit.py and DEPS include rules Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/openssl.h ('k') | webrtc/base/openssladapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/openssladapter.h
diff --git a/webrtc/base/openssladapter.h b/webrtc/base/openssladapter.h
index 2f0150f0f9a2fd6ff8d4bfaf2bbf41a0235a9875..6444215098bc932b500dd3636021907541dd7867 100644
--- a/webrtc/base/openssladapter.h
+++ b/webrtc/base/openssladapter.h
@@ -8,105 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_BASE_OPENSSLADAPTER_H__
-#define WEBRTC_BASE_OPENSSLADAPTER_H__
+#ifndef WEBRTC_BASE_OPENSSLADAPTER_H_
+#define WEBRTC_BASE_OPENSSLADAPTER_H_
-#include <string>
-#include "webrtc/base/buffer.h"
-#include "webrtc/base/messagehandler.h"
-#include "webrtc/base/messagequeue.h"
-#include "webrtc/base/ssladapter.h"
-typedef struct ssl_st SSL;
-typedef struct ssl_ctx_st SSL_CTX;
-typedef struct x509_store_ctx_st X509_STORE_CTX;
+// This header is deprecated and is just left here temporarily during
+// refactoring. See https://bugs.webrtc.org/7634 for more details.
+#include "webrtc/rtc_base/openssladapter.h"
-namespace rtc {
-
-///////////////////////////////////////////////////////////////////////////////
-
-class OpenSSLAdapter : public SSLAdapter, public MessageHandler {
-public:
- static bool InitializeSSL(VerificationCallback callback);
- static bool InitializeSSLThread();
- static bool CleanupSSL();
-
- OpenSSLAdapter(AsyncSocket* socket);
- ~OpenSSLAdapter() override;
-
- void SetMode(SSLMode mode) override;
- int StartSSL(const char* hostname, bool restartable) override;
- int Send(const void* pv, size_t cb) override;
- int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override;
- int Recv(void* pv, size_t cb, int64_t* timestamp) override;
- int RecvFrom(void* pv,
- size_t cb,
- SocketAddress* paddr,
- int64_t* timestamp) override;
- int Close() override;
-
- // Note that the socket returns ST_CONNECTING while SSL is being negotiated.
- ConnState GetState() const override;
-
-protected:
- void OnConnectEvent(AsyncSocket* socket) override;
- void OnReadEvent(AsyncSocket* socket) override;
- void OnWriteEvent(AsyncSocket* socket) override;
- void OnCloseEvent(AsyncSocket* socket, int err) override;
-
-private:
- enum SSLState {
- SSL_NONE, SSL_WAIT, SSL_CONNECTING, SSL_CONNECTED, SSL_ERROR
- };
-
- enum { MSG_TIMEOUT };
-
- int BeginSSL();
- int ContinueSSL();
- void Error(const char* context, int err, bool signal = true);
- void Cleanup();
-
- // Return value and arguments have the same meanings as for Send; |error| is
- // an output parameter filled with the result of SSL_get_error.
- int DoSslWrite(const void* pv, size_t cb, int* error);
-
- void OnMessage(Message* msg) override;
-
- static bool VerifyServerName(SSL* ssl, const char* host,
- bool ignore_bad_cert);
- bool SSLPostConnectionCheck(SSL* ssl, const char* host);
-#if !defined(NDEBUG)
- static void SSLInfoCallback(const SSL* s, int where, int ret);
-#endif
- static int SSLVerifyCallback(int ok, X509_STORE_CTX* store);
- static VerificationCallback custom_verify_callback_;
- friend class OpenSSLStreamAdapter; // for custom_verify_callback_;
-
- static bool ConfigureTrustedRootCertificates(SSL_CTX* ctx);
- SSL_CTX* SetupSSLContext();
-
- SSLState state_;
- bool ssl_read_needs_write_;
- bool ssl_write_needs_read_;
- // If true, socket will retain SSL configuration after Close.
- bool restartable_;
-
- // This buffer is used if SSL_write fails with SSL_ERROR_WANT_WRITE, which
- // means we need to keep retrying with *the same exact data* until it
- // succeeds. Afterwards it will be cleared.
- Buffer pending_data_;
-
- SSL* ssl_;
- SSL_CTX* ssl_ctx_;
- std::string ssl_host_name_;
- // Do DTLS or not
- SSLMode ssl_mode_;
-
- bool custom_verification_succeeded_;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-} // namespace rtc
-
-#endif // WEBRTC_BASE_OPENSSLADAPTER_H__
+#endif // WEBRTC_BASE_OPENSSLADAPTER_H_
« no previous file with comments | « webrtc/base/openssl.h ('k') | webrtc/base/openssladapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698