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

Unified Diff: net/socket/ssl_server_socket.h

Issue 5746003: Defines SSLServerSocket and implements SSLServerSocketNSS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix style Created 10 years 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
Index: net/socket/ssl_server_socket.h
diff --git a/net/socket/ssl_server_socket.h b/net/socket/ssl_server_socket.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed8ab89fe240859c345d9046201251ac12a7f335
--- /dev/null
+++ b/net/socket/ssl_server_socket.h
@@ -0,0 +1,61 @@
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
wtc 2010/12/17 00:16:26 Nit: 2006-2009 => 2010
Alpha Left Google 2010/12/17 08:30:43 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_SOCKET_SSL_SERVER_SOCKET_H_
+#define NET_SOCKET_SSL_SERVER_SOCKET_H_
+
+#include "base/basictypes.h"
+#include "net/base/completion_callback.h"
+#include "net/socket/socket.h"
+
+namespace base {
+class RSAPrivateKey;
+} // namespace base
+
+namespace net {
+
+class IOBuffer;
+class X509Certificate;
+
+// SSLServerSocket takes an already connected socket and performs SSL
+// authentication and encryption on top of it.
wtc 2010/12/17 00:16:26 Nit: remove "authentication and encryption".
Alpha Left Google 2010/12/17 08:30:43 Done.
+class SSLServerSocket : public Socket {
+ public:
+ SSLServerSocket() {}
wtc 2010/12/17 00:16:26 Delete the constructor, and the four 'Socket' inte
+ virtual ~SSLServerSocket() {}
+
+ // Performs SSL server handshaking on an existing socket. The socket given
+ // to this object has to be already connected.
+ //
+ // This method takes a callback. Return true value of this method is the
wtc 2010/12/17 00:16:26 Nit: Return true value => Return value
Alpha Left Google 2010/12/17 08:30:43 Done.
+ // error code of the handshaking operation. If the return value is
+ // net::ERR_IO_PENDING the given callback will be invoked in the future with
+ // an error code. Other values of error code returned by this method indicate
+ // the handshaking operation has completed synchronously.
+ virtual int Accept(CompletionCallback* callback) = 0;
+
+ // Socket interface.
+ virtual int Read(IOBuffer* buf, int buf_len,
+ CompletionCallback* callback) = 0;
+ virtual int Write(IOBuffer* buf, int buf_len,
+ CompletionCallback* callback) = 0;
+ virtual bool SetReceiveBufferSize(int32 size) = 0;
+ virtual bool SetSendBufferSize(int32 size) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SSLServerSocket);
+};
+
+// Creates a SSL server socket using a already connected socket. A signed
wtc 2010/12/17 00:16:26 Nit: a SSL => an SSL a already => an already
Alpha Left Google 2010/12/17 08:30:43 Fixed nits. Added a TODO to define ServerSocketFac
+// certificate and private key needs to be provided.
+//
+// This created server socket will take ownership of |socket|. However |key|
wtc 2010/12/17 00:16:26 Since we can't copy a base::RSAPrivateKey easily,
Alpha Left Google 2010/12/17 08:30:43 In the case of chromoting this is not desirable. B
wtc 2010/12/17 16:38:32 I see. Perhaps the proper solution is to make RSA
Alpha Left Google 2010/12/17 20:09:57 Added TODO to RSAPrivateKey.
+// is copied.
+SSLServerSocket* CreateSSLServerSocket(
+ Socket* socket, scoped_refptr<X509Certificate> certificate,
wtc 2010/12/17 00:16:26 Just use X509Certificate* certificate. No need to
Alpha Left Google 2010/12/17 08:30:43 Done.
+ base::RSAPrivateKey* key);
+
+} // namespace net
+
+#endif // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_

Powered by Google App Engine
This is Rietveld 408576698