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

Side by Side Diff: content/browser/ssl/ssl_policy.cc

Issue 20628006: Reject certificates that are valid for too long. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "Manual rebase" due to age. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/ssl/ssl_policy.h" 5 #include "content/browser/ssl/ssl_policy.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // For all other hosts, which must be DENIED, a blocking page is shown to the 49 // For all other hosts, which must be DENIED, a blocking page is shown to the
50 // user every time they come back to the page. 50 // user every time they come back to the page.
51 int options_mask = 0; 51 int options_mask = 0;
52 switch (handler->cert_error()) { 52 switch (handler->cert_error()) {
53 case net::ERR_CERT_COMMON_NAME_INVALID: 53 case net::ERR_CERT_COMMON_NAME_INVALID:
54 case net::ERR_CERT_DATE_INVALID: 54 case net::ERR_CERT_DATE_INVALID:
55 case net::ERR_CERT_AUTHORITY_INVALID: 55 case net::ERR_CERT_AUTHORITY_INVALID:
56 case net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM: 56 case net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM:
57 case net::ERR_CERT_WEAK_KEY: 57 case net::ERR_CERT_WEAK_KEY:
58 case net::ERR_CERT_NAME_CONSTRAINT_VIOLATION: 58 case net::ERR_CERT_NAME_CONSTRAINT_VIOLATION:
59 case net::ERR_CERT_TOO_LONG_VALIDITY:
59 if (!handler->fatal()) 60 if (!handler->fatal())
60 options_mask |= OVERRIDABLE; 61 options_mask |= OVERRIDABLE;
61 else 62 else
62 options_mask |= STRICT_ENFORCEMENT; 63 options_mask |= STRICT_ENFORCEMENT;
63 if (expired_previous_decision) 64 if (expired_previous_decision)
64 options_mask |= EXPIRED_PREVIOUS_DECISION; 65 options_mask |= EXPIRED_PREVIOUS_DECISION;
65 OnCertErrorInternal(handler, options_mask); 66 OnCertErrorInternal(handler, options_mask);
66 break; 67 break;
67 case net::ERR_CERT_NO_REVOCATION_MECHANISM: 68 case net::ERR_CERT_NO_REVOCATION_MECHANISM:
68 // Ignore this error. 69 // Ignore this error.
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED; 232 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED;
232 } 233 }
233 234
234 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { 235 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) {
235 GURL parsed_origin(origin); 236 GURL parsed_origin(origin);
236 if (parsed_origin.SchemeIsSecure()) 237 if (parsed_origin.SchemeIsSecure())
237 backend_->HostRanInsecureContent(parsed_origin.host(), pid); 238 backend_->HostRanInsecureContent(parsed_origin.host(), pid);
238 } 239 }
239 240
240 } // namespace content 241 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698