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

Unified Diff: net/spdy/spdy_session.cc

Issue 1378613004: Set Token-Binding HTTP header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tb-tls-ext-new
Patch Set: Add UMA logging of Token Binding support and NetLog event for Token Binding key lookup Created 5 years, 1 month 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/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 80e24c6dd79ebf42ec56f304563a9581be9efe6a..b71f7daa9e9b17830601fdbe1a8c13eebb822885 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -47,6 +47,7 @@
#include "net/ssl/channel_id_service.h"
#include "net/ssl/ssl_cipher_suite_names.h"
#include "net/ssl/ssl_connection_status_flags.h"
+#include "net/ssl/token_binding.h"
namespace net {
@@ -2001,6 +2002,23 @@ bool SpdySession::GetSSLInfo(SSLInfo* ssl_info,
return connection_->socket()->GetSSLInfo(ssl_info);
}
+int SpdySession::GetProvidedTokenBindingWithKey(
+ const scoped_ptr<crypto::ECPrivateKey>& key,
+ std::string* out) {
+ if (!is_secure_) {
+ NOTREACHED();
+ return ERR_FAILED;
+ }
+ SSLClientSocket* ssl_socket =
+ static_cast<SSLClientSocket*>(connection_->socket());
+ std::vector<uint8_t> signed_ekm;
+ if (ssl_socket->GetSignedEKMForTokenBinding(key.get(), &signed_ekm) != OK ||
+ BuildProvidedTokenBinding(key.get(), signed_ekm, out) != OK) {
+ return ERR_FAILED;
+ }
+ return OK;
+}
+
void SpdySession::OnError(SpdyFramer::SpdyError error_code) {
CHECK(in_io_loop_);

Powered by Google App Engine
This is Rietveld 408576698