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

Unified Diff: net/quic/chromium/quic_chromium_client_session.cc

Issue 2337253004: Update Token Binding code to the latest drafts (Closed)
Patch Set: Add call to CBS_len() Created 4 years, 3 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 | « net/quic/chromium/quic_chromium_client_session.h ('k') | net/quic/chromium/quic_http_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/chromium/quic_chromium_client_session.cc
diff --git a/net/quic/chromium/quic_chromium_client_session.cc b/net/quic/chromium/quic_chromium_client_session.cc
index f7a1c65131abda4e1533975f1128977aa73dedc2..3f5af02714aa799a03008c91b31d4483196d6352 100644
--- a/net/quic/chromium/quic_chromium_client_session.cc
+++ b/net/quic/chromium/quic_chromium_client_session.cc
@@ -593,7 +593,7 @@ bool QuicChromiumClientSession::GetSSLInfo(SSLInfo* ssl_info) const {
ssl_info->UpdateCertificateTransparencyInfo(*ct_verify_result_);
if (crypto_stream_->crypto_negotiated_params().token_binding_key_param ==
- kP256) {
+ kTB10) {
ssl_info->token_binding_negotiated = true;
ssl_info->token_binding_key_param = TB_PARAM_ECDSAP256;
}
@@ -603,6 +603,7 @@ bool QuicChromiumClientSession::GetSSLInfo(SSLInfo* ssl_info) const {
Error QuicChromiumClientSession::GetTokenBindingSignature(
crypto::ECPrivateKey* key,
+ TokenBindingType tb_type,
std::vector<uint8_t>* out) {
// The same key will be used across multiple requests to sign the same value,
// so the signature is cached.
@@ -610,7 +611,7 @@ Error QuicChromiumClientSession::GetTokenBindingSignature(
if (!key->ExportRawPublicKey(&raw_public_key))
return ERR_FAILED;
TokenBindingSignatureMap::iterator it =
- token_binding_signatures_.Get(raw_public_key);
+ token_binding_signatures_.Get(std::make_pair(tb_type, raw_public_key));
if (it != token_binding_signatures_.end()) {
*out = it->second;
return OK;
@@ -619,9 +620,9 @@ Error QuicChromiumClientSession::GetTokenBindingSignature(
std::string key_material;
if (!crypto_stream_->ExportTokenBindingKeyingMaterial(&key_material))
return ERR_FAILED;
- if (!SignTokenBindingEkm(key_material, key, out))
+ if (!CreateTokenBindingSignature(key_material, tb_type, key, out))
return ERR_FAILED;
- token_binding_signatures_.Put(raw_public_key, *out);
+ token_binding_signatures_.Put(std::make_pair(tb_type, raw_public_key), *out);
return OK;
}
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session.h ('k') | net/quic/chromium/quic_http_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698