summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/socket/ssl_client_socket.cc11
-rw-r--r--net/socket/ssl_client_socket.h10
-rw-r--r--net/socket/ssl_client_socket_nss.cc6
3 files changed, 25 insertions, 2 deletions
diff --git a/net/socket/ssl_client_socket.cc b/net/socket/ssl_client_socket.cc
index 4f87202..b1e31f5 100644
--- a/net/socket/ssl_client_socket.cc
+++ b/net/socket/ssl_client_socket.cc
@@ -10,7 +10,8 @@ namespace net {
SSLClientSocket::SSLClientSocket()
: was_npn_negotiated_(false),
- was_spdy_negotiated_(false) {
+ was_spdy_negotiated_(false),
+ was_origin_bound_cert_sent_(false) {
}
SSLClientSocket::NextProto SSLClientSocket::NextProtoFromString(
@@ -90,4 +91,12 @@ bool SSLClientSocket::set_was_spdy_negotiated(bool negotiated) {
return was_spdy_negotiated_ = negotiated;
}
+bool SSLClientSocket::was_origin_bound_cert_sent() const {
+ return was_origin_bound_cert_sent_;
+}
+
+bool SSLClientSocket::set_was_origin_bound_cert_sent(bool sent) {
+ return was_origin_bound_cert_sent_ = sent;
+}
+
} // namespace net
diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h
index 858f3fb..c847e9f 100644
--- a/net/socket/ssl_client_socket.h
+++ b/net/socket/ssl_client_socket.h
@@ -126,11 +126,21 @@ class NET_EXPORT SSLClientSocket : public SSLSocket {
virtual bool set_was_spdy_negotiated(bool negotiated);
+ // Returns true if an origin bound certificate was sent on this connection.
+ // This may be useful for protocols, like SPDY, which allow the same
+ // connection to be shared between multiple origins, each of which need
+ // an origin bound certificate.
+ virtual bool was_origin_bound_cert_sent() const;
+
+ virtual bool set_was_origin_bound_cert_sent(bool sent);
+
private:
// True if NPN was responded to, independent of selecting SPDY or HTTP.
bool was_npn_negotiated_;
// True if NPN successfully negotiated SPDY.
bool was_spdy_negotiated_;
+ // True if an origin bound certificate was sent.
+ bool was_origin_bound_cert_sent_;
};
} // namespace net
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index 3e9907b..6c16c4a 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -1717,6 +1717,7 @@ int SSLClientSocketNSS::DoGetOBCertComplete(int result) {
return MapNSSError(PORT_GetError());
GotoState(STATE_HANDSHAKE);
+ set_was_origin_bound_cert_sent(true);
return OK;
}
@@ -2272,8 +2273,11 @@ SECStatus SSLClientSocketNSS::OriginBoundClientAuthHandler(
// Synchronous success.
int result = ImportOBCertAndKey(result_certificate,
result_private_key);
- if (result != OK)
+ if (result == OK) {
+ set_was_origin_bound_cert_sent(true);
+ } else {
rv = SECFailure;
+ }
} else {
rv = SECFailure; // Synchronous failure.
}