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

Side by Side Diff: chrome/browser/payments/ssl_validity_checker.cc

Issue 2815763002: Prevent usage of web payments API over insecure HTTPS. (Closed)
Patch Set: Self-review Created 3 years, 8 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/payments/ssl_validity_checker.h"
6
7 #include "base/logging.h"
8 #include "chrome/browser/ssl/security_state_tab_helper.h"
9 #include "components/security_state/core/security_state.h"
10
11 namespace payments {
12
13 // static
14 bool SslValidityChecker::IsValidSslCertificate(
15 content::WebContents* web_contents) {
16 DCHECK(web_contents);
17 SecurityStateTabHelper::CreateForWebContents(web_contents);
18 SecurityStateTabHelper* helper =
19 SecurityStateTabHelper::FromWebContents(web_contents);
20 DCHECK(helper);
21 security_state::SecurityInfo security_info;
22 helper->GetSecurityInfo(&security_info);
23 return security_info.security_level == security_state::EV_SECURE ||
24 security_info.security_level == security_state::SECURE ||
25 security_info.security_level ==
26 security_state::SECURE_WITH_POLICY_INSTALLED_CERT;
27 }
28
29 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698