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

Side by Side Diff: net/quic/crypto/proof_verifier_chromium.cc

Issue 432553003: Remove redundant mapping of net errors to strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/crypto/proof_verifier_chromium.h" 5 #include "net/quic/crypto/proof_verifier_chromium.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 &verify_details_->cert_verify_result, 222 &verify_details_->cert_verify_result,
223 base::Bind(&ProofVerifierChromium::Job::OnIOComplete, 223 base::Bind(&ProofVerifierChromium::Job::OnIOComplete,
224 base::Unretained(this)), 224 base::Unretained(this)),
225 net_log_); 225 net_log_);
226 } 226 }
227 227
228 int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) { 228 int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
229 verifier_.reset(); 229 verifier_.reset();
230 230
231 if (result != OK) { 231 if (result != OK) {
232 std::string error_string = ErrorToString(result);
232 error_details_ = StringPrintf("Failed to verify certificate chain: %s", 233 error_details_ = StringPrintf("Failed to verify certificate chain: %s",
233 ErrorToString(result)); 234 error_string.c_str());
234 DLOG(WARNING) << error_details_; 235 DLOG(WARNING) << error_details_;
235 } 236 }
236 237
237 // Exit DoLoop and return the result to the caller to VerifyProof. 238 // Exit DoLoop and return the result to the caller to VerifyProof.
238 DCHECK_EQ(STATE_NONE, next_state_); 239 DCHECK_EQ(STATE_NONE, next_state_);
239 return result; 240 return result;
240 } 241 }
241 242
242 bool ProofVerifierChromium::Job::VerifySignature(const string& signed_data, 243 bool ProofVerifierChromium::Job::VerifySignature(const string& signed_data,
243 const string& signature, 244 const string& signature,
244 const string& cert) { 245 const string& cert) {
245 StringPiece spki; 246 StringPiece spki;
246 if (!asn1::ExtractSPKIFromDERCert(cert, &spki)) { 247 if (!asn1::ExtractSPKIFromDERCert(cert, &spki)) {
247 DLOG(WARNING) << "ExtractSPKIFromDERCert failed"; 248 DLOG(WARNING) << "ExtractSPKIFromDERCert failed";
248 return false; 249 return false;
249 } 250 }
250 251
251 crypto::SignatureVerifier verifier; 252 crypto::SignatureVerifier verifier;
252 253
253 size_t size_bits; 254 size_t size_bits;
254 X509Certificate::PublicKeyType type; 255 X509Certificate::PublicKeyType type;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 347 }
347 return status; 348 return status;
348 } 349 }
349 350
350 void ProofVerifierChromium::OnJobComplete(Job* job) { 351 void ProofVerifierChromium::OnJobComplete(Job* job) {
351 active_jobs_.erase(job); 352 active_jobs_.erase(job);
352 delete job; 353 delete job;
353 } 354 }
354 355
355 } // namespace net 356 } // namespace net
OLDNEW
« net/base/net_errors.cc ('K') | « net/base/net_log_logger.cc ('k') | net/tools/gdig/gdig.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698