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

Unified Diff: net/quic/crypto/proof_verifier_chromium.cc

Issue 22647002: Add support to QUIC for QUIC_VERSION_8: for RSA-PSS signatures, set (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 4 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/crypto/proof_verifier_chromium.h ('k') | net/quic/quic_crypto_client_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/proof_verifier_chromium.cc
===================================================================
--- net/quic/crypto/proof_verifier_chromium.cc (revision 216255)
+++ net/quic/crypto/proof_verifier_chromium.cc (working copy)
@@ -42,6 +42,7 @@
}
ProofVerifierChromium::Status ProofVerifierChromium::VerifyProof(
+ QuicVersion version,
const string& hostname,
const string& server_config,
const vector<string>& certs,
@@ -89,7 +90,7 @@
// We call VerifySignature first to avoid copying of server_config and
// signature.
- if (!VerifySignature(server_config, signature, certs[0])) {
+ if (!VerifySignature(version, server_config, signature, certs[0])) {
*error_details = "Failed to verify signature of server config";
DLOG(WARNING) << *error_details;
verify_details_->cert_verify_result.cert_status = CERT_STATUS_INVALID;
@@ -176,7 +177,8 @@
return result;
}
-bool ProofVerifierChromium::VerifySignature(const string& signed_data,
+bool ProofVerifierChromium::VerifySignature(QuicVersion version,
+ const string& signed_data,
const string& signature,
const string& cert) {
StringPiece spki;
@@ -196,8 +198,8 @@
crypto::SignatureVerifier::SHA256;
crypto::SignatureVerifier::HashAlgorithm mask_hash_alg = hash_alg;
unsigned int hash_len = 32; // 32 is the length of a SHA-256 hash.
- // TODO(wtc): change this to hash_len when we can change the wire format.
- unsigned int salt_len = signature.size() - hash_len - 2;
+ unsigned int salt_len =
+ version >= QUIC_VERSION_8 ? hash_len : signature.size() - hash_len - 2;
wtc 2013/08/08 00:37:33 This is the most important change, which selects t
bool ok = verifier.VerifyInitRSAPSS(
hash_alg, mask_hash_alg, salt_len,
« no previous file with comments | « net/quic/crypto/proof_verifier_chromium.h ('k') | net/quic/quic_crypto_client_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698