summaryrefslogtreecommitdiffstats
path: root/ppapi/c
diff options
context:
space:
mode:
authorraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-12 03:38:22 +0000
committerraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-12 03:38:22 +0000
commit92a794994111f442e9c7ba1792a5418a77c2ca74 (patch)
tree6ccf61412e2d7c33adab5611354db381c8367fc1 /ppapi/c
parent8d813a832c341a54a8a8aff5702bd392e990cda7 (diff)
downloadchromium_src-92a794994111f442e9c7ba1792a5418a77c2ca74.zip
chromium_src-92a794994111f442e9c7ba1792a5418a77c2ca74.tar.gz
chromium_src-92a794994111f442e9c7ba1792a5418a77c2ca74.tar.bz2
This adds the following to functions to the ppapi TCPSocket interface:
1) GetServer certificate, which returns the server X509Certificate if an SSL connection has been established. 2) AddChainBuilding certificate. This is currently unimplemented in Chrome but the interface and plumbing has been added so it can easily be hooked up. This should add a trusted/untrusted chain building certificate to be used by the client for a particular connection when performing the SSL handshake. BUG=114626 TEST=out/Release/browser_tests --gtest_filter=*PPAPITest.*TCP*Trusted* Review URL: http://codereview.chromium.org/9699100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131918 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r--ppapi/c/private/ppb_tcp_socket_private.h56
1 files changed, 52 insertions, 4 deletions
diff --git a/ppapi/c/private/ppb_tcp_socket_private.h b/ppapi/c/private/ppb_tcp_socket_private.h
index 7cdf591..7d6ca46 100644
--- a/ppapi/c/private/ppb_tcp_socket_private.h
+++ b/ppapi/c/private/ppb_tcp_socket_private.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From private/ppb_tcp_socket_private.idl modified Wed Nov 16 15:27:20 2011. */
+/* From private/ppb_tcp_socket_private.idl modified Fri Apr 6 14:42:45 2012. */
#ifndef PPAPI_C_PRIVATE_PPB_TCP_SOCKET_PRIVATE_H_
#define PPAPI_C_PRIVATE_PPB_TCP_SOCKET_PRIVATE_H_
@@ -17,7 +17,8 @@
#include "ppapi/c/private/ppb_net_address_private.h"
#define PPB_TCPSOCKET_PRIVATE_INTERFACE_0_3 "PPB_TCPSocket_Private;0.3"
-#define PPB_TCPSOCKET_PRIVATE_INTERFACE PPB_TCPSOCKET_PRIVATE_INTERFACE_0_3
+#define PPB_TCPSOCKET_PRIVATE_INTERFACE_0_4 "PPB_TCPSocket_Private;0.4"
+#define PPB_TCPSOCKET_PRIVATE_INTERFACE PPB_TCPSOCKET_PRIVATE_INTERFACE_0_4
/**
* @file
@@ -33,7 +34,7 @@
* The <code>PPB_TCPSocket_Private</code> interface provides TCP socket
* operations.
*/
-struct PPB_TCPSocket_Private_0_3 {
+struct PPB_TCPSocket_Private_0_4 {
/**
* Allocates a TCP socket resource.
*/
@@ -88,6 +89,24 @@ struct PPB_TCPSocket_Private_0_3 {
uint16_t server_port,
struct PP_CompletionCallback callback);
/**
+ * Returns the server's <code>PPB_X509Certificate_Private</code> for a socket
+ * connection if an SSL connection has been established using
+ * <code>SSLHandshake</code>. If no SSL connection has been established, a
+ * null resource is returned.
+ */
+ PP_Resource (*GetServerCertificate)(PP_Resource tcp_socket);
+ /**
+ * NOTE: This function is not implemented and will return
+ * <code>PP_FALSE</code>.
+ * Adds a trusted/untrusted chain building certificate to be used for this
+ * connection. The <code>certificate</code> must be a
+ * <code>PPB_X509Certificate_Private<code>. <code>PP_TRUE</code> is returned
+ * upon success.
+ */
+ PP_Bool (*AddChainBuildingCertificate)(PP_Resource tcp_socket,
+ PP_Resource certificate,
+ PP_Bool is_trusted);
+ /**
* Reads data from the socket. The size of |buffer| must be at least as large
* as |bytes_to_read|. May perform a partial read. Returns the number of bytes
* read or an error code. If the return value is 0, then it indicates that
@@ -122,7 +141,36 @@ struct PPB_TCPSocket_Private_0_3 {
void (*Disconnect)(PP_Resource tcp_socket);
};
-typedef struct PPB_TCPSocket_Private_0_3 PPB_TCPSocket_Private;
+typedef struct PPB_TCPSocket_Private_0_4 PPB_TCPSocket_Private;
+
+struct PPB_TCPSocket_Private_0_3 {
+ PP_Resource (*Create)(PP_Instance instance);
+ PP_Bool (*IsTCPSocket)(PP_Resource resource);
+ int32_t (*Connect)(PP_Resource tcp_socket,
+ const char* host,
+ uint16_t port,
+ struct PP_CompletionCallback callback);
+ int32_t (*ConnectWithNetAddress)(PP_Resource tcp_socket,
+ const struct PP_NetAddress_Private* addr,
+ struct PP_CompletionCallback callback);
+ PP_Bool (*GetLocalAddress)(PP_Resource tcp_socket,
+ struct PP_NetAddress_Private* local_addr);
+ PP_Bool (*GetRemoteAddress)(PP_Resource tcp_socket,
+ struct PP_NetAddress_Private* remote_addr);
+ int32_t (*SSLHandshake)(PP_Resource tcp_socket,
+ const char* server_name,
+ uint16_t server_port,
+ struct PP_CompletionCallback callback);
+ int32_t (*Read)(PP_Resource tcp_socket,
+ char* buffer,
+ int32_t bytes_to_read,
+ struct PP_CompletionCallback callback);
+ int32_t (*Write)(PP_Resource tcp_socket,
+ const char* buffer,
+ int32_t bytes_to_write,
+ struct PP_CompletionCallback callback);
+ void (*Disconnect)(PP_Resource tcp_socket);
+};
/**
* @}
*/