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

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

Issue 2066603004: Return enum from TransportSecurityState::CheckPublicKeyPins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add DCHECK() Created 4 years, 6 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
Index: net/quic/crypto/proof_verifier_chromium.cc
diff --git a/net/quic/crypto/proof_verifier_chromium.cc b/net/quic/crypto/proof_verifier_chromium.cc
index 48b408be1578dff615de38c2693a92ced16be4dd..a4b760403b912f2ee44f4da2bdd8c203f97c405b 100644
--- a/net/quic/crypto/proof_verifier_chromium.cc
+++ b/net/quic/crypto/proof_verifier_chromium.cc
@@ -336,18 +336,26 @@ int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
if (transport_security_state_ &&
(result == OK ||
- (IsCertificateError(result) && IsCertStatusMinorError(cert_status))) &&
- !transport_security_state_->CheckPublicKeyPins(
- HostPortPair(hostname_, port_),
- cert_verify_result.is_issued_by_known_root,
- cert_verify_result.public_key_hashes, cert_.get(),
- cert_verify_result.verified_cert.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS,
- &verify_details_->pinning_failure_log)) {
- if (cert_verify_result.is_issued_by_known_root)
- result = ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN;
- else
- verify_details_->pkp_bypassed = true;
+ (IsCertificateError(result) && IsCertStatusMinorError(cert_status)))) {
+ TransportSecurityState::PKPStatus pin_validity =
+ transport_security_state_->CheckPublicKeyPins(
+ HostPortPair(hostname_, port_),
+ cert_verify_result.is_issued_by_known_root,
+ cert_verify_result.public_key_hashes, cert_.get(),
+ cert_verify_result.verified_cert.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ &verify_details_->pinning_failure_log);
+ switch (pin_validity) {
+ case TransportSecurityState::PKPStatus::VIOLATED:
+ result = ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN;
+ break;
+ case TransportSecurityState::PKPStatus::BYPASSED:
+ verify_details_->pkp_bypassed = true;
+ // Fall through.
+ case TransportSecurityState::PKPStatus::OK:
+ // Do nothing.
+ break;
+ }
}
if (result != OK) {

Powered by Google App Engine
This is Rietveld 408576698