| Index: net/ssl/client_cert_store_win.cc
|
| diff --git a/net/ssl/client_cert_store_win.cc b/net/ssl/client_cert_store_win.cc
|
| index 24ae1aa6d51bd308559cdb84afdddd4ed5851953..3a985ad4e4c72a16a88949b05bcfc0251c9688e2 100644
|
| --- a/net/ssl/client_cert_store_win.cc
|
| +++ b/net/ssl/client_cert_store_win.cc
|
| @@ -29,12 +29,12 @@ namespace {
|
| // default behavior of IE8. See http://support.microsoft.com/kb/890326 and
|
| // http://blogs.msdn.com/b/askie/archive/2009/06/09/my-expired-client-certifica
|
| // tes-no-longer-display-when-connecting-to-my-web-server-using-ie8.aspx
|
| -static BOOL WINAPI ClientCertFindCallback(PCCERT_CONTEXT cert_context,
|
| - void* find_arg) {
|
| +static BOOL WINAPI
|
| +ClientCertFindCallback(PCCERT_CONTEXT cert_context, void* find_arg) {
|
| // Verify the certificate key usage is appropriate or not specified.
|
| BYTE key_usage;
|
| - if (CertGetIntendedKeyUsage(X509_ASN_ENCODING, cert_context->pCertInfo,
|
| - &key_usage, 1)) {
|
| + if (CertGetIntendedKeyUsage(
|
| + X509_ASN_ENCODING, cert_context->pCertInfo, &key_usage, 1)) {
|
| if (!(key_usage & CERT_DIGITAL_SIGNATURE_KEY_USAGE))
|
| return FALSE;
|
| } else {
|
| @@ -109,9 +109,8 @@ void GetClientCertsImpl(HCERTSTORE cert_store,
|
| chain_context->rgpChain[0]->rgpElement[0]->pCertContext;
|
| // Copy the certificate, so that it is valid after |cert_store| is closed.
|
| PCCERT_CONTEXT cert_context2 = NULL;
|
| - BOOL ok = CertAddCertificateContextToStore(NULL, cert_context,
|
| - CERT_STORE_ADD_USE_EXISTING,
|
| - &cert_context2);
|
| + BOOL ok = CertAddCertificateContextToStore(
|
| + NULL, cert_context, CERT_STORE_ADD_USE_EXISTING, &cert_context2);
|
| if (!ok) {
|
| NOTREACHED();
|
| continue;
|
| @@ -123,33 +122,37 @@ void GetClientCertsImpl(HCERTSTORE cert_store,
|
| PCCERT_CONTEXT chain_intermediate =
|
| chain_context->rgpChain[0]->rgpElement[i]->pCertContext;
|
| PCCERT_CONTEXT copied_intermediate = NULL;
|
| - ok = CertAddCertificateContextToStore(NULL, chain_intermediate,
|
| + ok = CertAddCertificateContextToStore(NULL,
|
| + chain_intermediate,
|
| CERT_STORE_ADD_USE_EXISTING,
|
| &copied_intermediate);
|
| if (ok)
|
| intermediates.push_back(copied_intermediate);
|
| }
|
| - scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle(
|
| - cert_context2, intermediates);
|
| + scoped_refptr<X509Certificate> cert =
|
| + X509Certificate::CreateFromHandle(cert_context2, intermediates);
|
| selected_certs->push_back(cert);
|
| CertFreeCertificateContext(cert_context2);
|
| for (size_t i = 0; i < intermediates.size(); ++i)
|
| CertFreeCertificateContext(intermediates[i]);
|
| }
|
|
|
| - std::sort(selected_certs->begin(), selected_certs->end(),
|
| + std::sort(selected_certs->begin(),
|
| + selected_certs->end(),
|
| x509_util::ClientCertSorter());
|
| }
|
|
|
| } // namespace
|
|
|
| -ClientCertStoreWin::ClientCertStoreWin() {}
|
| +ClientCertStoreWin::ClientCertStoreWin() {
|
| +}
|
|
|
| -ClientCertStoreWin::~ClientCertStoreWin() {}
|
| +ClientCertStoreWin::~ClientCertStoreWin() {
|
| +}
|
|
|
| void ClientCertStoreWin::GetClientCerts(const SSLCertRequestInfo& request,
|
| - CertificateList* selected_certs,
|
| - const base::Closure& callback) {
|
| + CertificateList* selected_certs,
|
| + const base::Closure& callback) {
|
| // Client certificates of the user are in the "MY" system certificate store.
|
| HCERTSTORE my_cert_store = CertOpenSystemStore(NULL, L"MY");
|
| if (!my_cert_store) {
|
| @@ -171,11 +174,11 @@ bool ClientCertStoreWin::SelectClientCertsForTesting(
|
| CertificateList* selected_certs) {
|
| typedef crypto::ScopedCAPIHandle<
|
| HCERTSTORE,
|
| - crypto::CAPIDestroyerWithFlags<HCERTSTORE,
|
| - CertCloseStore, 0> > ScopedHCERTSTORE;
|
| + crypto::CAPIDestroyerWithFlags<HCERTSTORE, CertCloseStore, 0> >
|
| + ScopedHCERTSTORE;
|
|
|
| - ScopedHCERTSTORE test_store(CertOpenStore(CERT_STORE_PROV_MEMORY, 0, NULL, 0,
|
| - NULL));
|
| + ScopedHCERTSTORE test_store(
|
| + CertOpenStore(CERT_STORE_PROV_MEMORY, 0, NULL, 0, NULL));
|
| if (!test_store)
|
| return false;
|
|
|
| @@ -185,16 +188,16 @@ bool ClientCertStoreWin::SelectClientCertsForTesting(
|
| PCCERT_CONTEXT cert = NULL;
|
| if (!CertAddCertificateContextToStore(test_store,
|
| input_certs[i]->os_cert_handle(),
|
| - CERT_STORE_ADD_NEW, &cert)) {
|
| + CERT_STORE_ADD_NEW,
|
| + &cert)) {
|
| return false;
|
| }
|
| // Add dummy private key data to the certificate - otherwise the certificate
|
| // would be discarded by the filtering routines.
|
| CRYPT_KEY_PROV_INFO private_key_data;
|
| memset(&private_key_data, 0, sizeof(private_key_data));
|
| - if (!CertSetCertificateContextProperty(cert,
|
| - CERT_KEY_PROV_INFO_PROP_ID,
|
| - 0, &private_key_data)) {
|
| + if (!CertSetCertificateContextProperty(
|
| + cert, CERT_KEY_PROV_INFO_PROP_ID, 0, &private_key_data)) {
|
| return false;
|
| }
|
| // Decrement the reference count of the certificate (since we requested a
|
|
|