tighten up indenting

This commit is contained in:
Brendan Forster 2017-04-27 15:01:55 +10:00
parent 50af70a0e8
commit 5151107c28

View file

@ -12,8 +12,7 @@
namespace certificate_trust { namespace certificate_trust {
BOOL AddCertificateAndRefresh( BOOL AddCertificate(const HCERTSTORE certStore,
const HCERTSTORE certStore,
const PCCERT_CONTEXT certContext, const PCCERT_CONTEXT certContext,
const scoped_refptr<net::X509Certificate>& cert) { const scoped_refptr<net::X509Certificate>& cert) {
auto result = CertAddCertificateContextToStore( auto result = CertAddCertificateContextToStore(
@ -23,21 +22,18 @@ BOOL AddCertificateAndRefresh(
NULL); NULL);
if (result) { if (result) {
// force Chromium to reload it's database for this certificate
auto cert_db = net::CertDatabase::GetInstance(); auto cert_db = net::CertDatabase::GetInstance();
// Force Chromium to reload the certificate since it might be trusted
// now.
cert_db->NotifyObserversCertDBChanged(cert.get()); cert_db->NotifyObserversCertDBChanged(cert.get());
} }
return result; return result;
} }
// Add the provided certificate to the Trusted Root Certificate Authorities
// Add the provided certificate to the Trusted Root // store for the current user.
// Certificate Authorities store for the current user.
// //
// This requires prompting the user to confirm they // This requires prompting the user to confirm they trust the certificate.
// trust the certificate.
BOOL AddToTrustedRootStore(const PCCERT_CONTEXT certContext, BOOL AddToTrustedRootStore(const PCCERT_CONTEXT certContext,
const scoped_refptr<net::X509Certificate>& cert) { const scoped_refptr<net::X509Certificate>& cert) {
auto rootCertStore = CertOpenStore( auto rootCertStore = CertOpenStore(
@ -48,11 +44,10 @@ BOOL AddToTrustedRootStore(const PCCERT_CONTEXT certContext,
L"Root"); L"Root");
if (rootCertStore == NULL) { if (rootCertStore == NULL) {
// could not resolve the certificate store, giving up
return false; return false;
} }
auto result = AddCertificateAndRefresh(rootCertStore, certContext, cert); auto result = AddCertificate(rootCertStore, certContext, cert);
CertCloseStore(rootCertStore, CERT_CLOSE_STORE_FORCE_FLAG); CertCloseStore(rootCertStore, CERT_CLOSE_STORE_FORCE_FLAG);
@ -71,11 +66,10 @@ BOOL AddToPersonalStore(const PCCERT_CONTEXT certContext,
L"My"); L"My");
if (userCertStore == NULL) { if (userCertStore == NULL) {
// could not resolve the certificate store, giving up
return false; return false;
} }
auto result = AddCertificateAndRefresh(userCertStore, certContext, cert); auto result = AddCertificate(userCertStore, certContext, cert);
CertCloseStore(userCertStore, CERT_CLOSE_STORE_FORCE_FLAG); CertCloseStore(userCertStore, CERT_CLOSE_STORE_FORCE_FLAG);