tighten up indenting
This commit is contained in:
parent
50af70a0e8
commit
5151107c28
1 changed files with 78 additions and 84 deletions
|
@ -12,8 +12,7 @@
|
|||
|
||||
namespace certificate_trust {
|
||||
|
||||
BOOL AddCertificateAndRefresh(
|
||||
const HCERTSTORE certStore,
|
||||
BOOL AddCertificate(const HCERTSTORE certStore,
|
||||
const PCCERT_CONTEXT certContext,
|
||||
const scoped_refptr<net::X509Certificate>& cert) {
|
||||
auto result = CertAddCertificateContextToStore(
|
||||
|
@ -23,21 +22,18 @@ BOOL AddCertificateAndRefresh(
|
|||
NULL);
|
||||
|
||||
if (result) {
|
||||
// force Chromium to reload it's database for this certificate
|
||||
auto cert_db = net::CertDatabase::GetInstance();
|
||||
// Force Chromium to reload the certificate since it might be trusted
|
||||
// now.
|
||||
cert_db->NotifyObserversCertDBChanged(cert.get());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// Add the provided certificate to the Trusted Root
|
||||
// Certificate Authorities store for the current user.
|
||||
// Add the provided certificate to the Trusted Root Certificate Authorities
|
||||
// store for the current user.
|
||||
//
|
||||
// This requires prompting the user to confirm they
|
||||
// trust the certificate.
|
||||
// This requires prompting the user to confirm they trust the certificate.
|
||||
BOOL AddToTrustedRootStore(const PCCERT_CONTEXT certContext,
|
||||
const scoped_refptr<net::X509Certificate>& cert) {
|
||||
auto rootCertStore = CertOpenStore(
|
||||
|
@ -48,11 +44,10 @@ BOOL AddToTrustedRootStore(const PCCERT_CONTEXT certContext,
|
|||
L"Root");
|
||||
|
||||
if (rootCertStore == NULL) {
|
||||
// could not resolve the certificate store, giving up
|
||||
return false;
|
||||
}
|
||||
|
||||
auto result = AddCertificateAndRefresh(rootCertStore, certContext, cert);
|
||||
auto result = AddCertificate(rootCertStore, certContext, cert);
|
||||
|
||||
CertCloseStore(rootCertStore, CERT_CLOSE_STORE_FORCE_FLAG);
|
||||
|
||||
|
@ -71,11 +66,10 @@ BOOL AddToPersonalStore(const PCCERT_CONTEXT certContext,
|
|||
L"My");
|
||||
|
||||
if (userCertStore == NULL) {
|
||||
// could not resolve the certificate store, giving up
|
||||
return false;
|
||||
}
|
||||
|
||||
auto result = AddCertificateAndRefresh(userCertStore, certContext, cert);
|
||||
auto result = AddCertificate(userCertStore, certContext, cert);
|
||||
|
||||
CertCloseStore(userCertStore, CERT_CLOSE_STORE_FORCE_FLAG);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue